Skip to content

Commit 0740881

Browse files
author
Alexis Bouhet
committed
Updated reflex-dom version
1 parent 412a2a3 commit 0740881

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

frameworks/keyed/reflex-dom/esbuild.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@ const _buildContext = await esbuild.context({
1414
//target: [ 'chrome58', 'edge18', 'firefox57', 'safari11' ],
1515
platform: "browser",
1616
format: "iife",
17-
minify: !isDev,
17+
// minify: !isDev,
18+
// Mangle all properties starting with an underscore
1819
mangleProps: isDev ? undefined : /^_/,
20+
// Important to keep perfs
21+
// and disable compressing "if ( a ) b()" in "a && b()"
22+
minifyWhitespace: !isDev,
23+
minifyIdentifiers: !isDev,
24+
minifySyntax: false,
25+
keepNames: true,
26+
1927
bundle: true,
2028
loader: {
2129
'.ts' : 'ts',

frameworks/keyed/reflex-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"esbuild": "^0.20.1"
2424
},
2525
"dependencies": {
26-
"reflex-dom": "0.20.3"
26+
"reflex-dom": "0.21.1"
2727
}
2828
}

frameworks/keyed/reflex-dom/src/main.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
import { h, render, state } from "reflex-dom"
2-
// import { h, render, state, shouldUpdate } from "../node_modules/reflex-dom/dist/index.es2020.mjs"
3+
import { For } from "reflex-dom/dist/performance-helpers"
4+
// import { h, render, state } from "../node_modules/reflex-dom/dist/index.es2020.mjs"
5+
// import { For } from "../node_modules/reflex-dom/dist/performance-helpers.es2020.mjs"
6+
37

48
// ----------------------------------------------------------------------------- DATA HELPERS
59

@@ -64,7 +68,7 @@ const toggleSelection = ( id:number ) => {
6468
let _counter = 1;
6569
const buildData = (count:number) => {
6670
const data = new Array(count);
67-
for ( let i = 0; i < count; i++ ) {
71+
for ( let i = 0; i < count; ++i ) {
6872
data[i] = {
6973
id: _counter++,
7074
label: `${_pick(A)} ${_pick(C)} ${_pick(N)}`,
@@ -139,14 +143,14 @@ function App () {
139143
return () => <div class="container">
140144
<Jumbotron />
141145
<table class="table table-hover table-striped test-data">
142-
<tbody>
143-
{$data.value.map(item => <Row
146+
<For as="tbody" each={ $data }>
147+
{item => <Row
144148
key={ item.id }
145149
id={ item.id }
146150
label={ item.label }
147151
selected={ $selected.value === item.id }
148-
/>)}
149-
</tbody>
152+
/>}
153+
</For>
150154
</table>
151155
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true" />
152156
</div>

0 commit comments

Comments
 (0)