Skip to content

Commit 9631d73

Browse files
committed
Merge branch 'titoBouzout-16'
2 parents 1243b79 + 97a86ed commit 9631d73

File tree

4 files changed

+50
-28
lines changed

4 files changed

+50
-28
lines changed

frameworks/keyed/pota/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<head>
44
<meta charset="utf-8" />
55
<title>Pota</title>
6-
<link href="/css/currentStyle.css" rel="stylesheet" />
6+
<link
7+
href="/css/currentStyle.css"
8+
rel="stylesheet"
9+
/>
710
</head>
811
<body>
912
<div id="main"></div>

frameworks/keyed/pota/package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-framework-benchmark-pota",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"type": "module",
55
"main": "dist/main.js",
66
"js-framework-benchmark": {
@@ -20,13 +20,28 @@
2020
"url": "https://github.com/krausest/js-framework-benchmark.git"
2121
},
2222
"dependencies": {
23-
"pota": "^0.14.132"
23+
"pota": "^0.16.156"
2424
},
2525
"devDependencies": {
2626
"@babel/core": "7.25.2",
2727
"@rollup/plugin-babel": "6.0.4",
2828
"@rollup/plugin-node-resolve": "15.2.3",
2929
"@rollup/plugin-terser": "0.4.4",
3030
"rollup": "4.21.2"
31+
},
32+
"prettier": {
33+
"printWidth": 70,
34+
"useTabs": true,
35+
"semi": false,
36+
"singleQuote": true,
37+
"quoteProps": "as-needed",
38+
"jsxSingleQuote": false,
39+
"trailingComma": "all",
40+
"bracketSpacing": true,
41+
"bracketSameLine": false,
42+
"arrowParens": "avoid",
43+
"proseWrap": "never",
44+
"endOfLine": "lf",
45+
"singleAttributePerLine": true
3146
}
3247
}
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { babel } from "@rollup/plugin-babel";
2-
import { nodeResolve } from "@rollup/plugin-node-resolve";
3-
import terser from "@rollup/plugin-terser";
1+
import { babel } from '@rollup/plugin-babel'
2+
import { nodeResolve } from '@rollup/plugin-node-resolve'
3+
import terser from '@rollup/plugin-terser'
44

5-
const isProduction = process.env.BUILD === "production";
5+
const isProduction = process.env.BUILD === 'production'
66

77
/** @type {import('rollup').RollupOptions} */
88
export default {
9-
input: "./src/main.jsx",
9+
input: './src/main.jsx',
1010
plugins: [
1111
nodeResolve(),
1212
babel({
13-
babelHelpers: "bundled",
14-
presets: [["pota/babel-preset"]],
13+
babelHelpers: 'bundled',
14+
presets: [['pota/babel-preset']],
1515
}),
1616
isProduction && terser(),
1717
],
1818
output: [
1919
{
20-
format: "es",
20+
format: 'es',
2121
sourcemap: false,
22-
file: "./dist/main.js",
22+
file: './dist/main.js',
2323
},
2424
],
25-
};
25+
}

frameworks/keyed/pota/src/main.jsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, signal, batch } from 'pota'
1+
import { render, signal } from 'pota'
22
import { For } from 'pota/web'
33

44
import { useSelector } from 'pota/plugin/useSelector'
@@ -68,9 +68,7 @@ function buildData(count) {
6868
let data = new Array(count)
6969
for (let i = 0; i < count; i++) {
7070
const [label, setLabel, updateLabel] = signal(
71-
`${adjectives[_random(adjectives.length)]} ${
72-
colours[_random(colours.length)]
73-
} ${nouns[_random(nouns.length)]}`,
71+
`${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}`,
7472
)
7573
data[i] = {
7674
id: idCounter++,
@@ -97,16 +95,19 @@ const Button = ({ id, text, fn }) => (
9795
const App = () => {
9896
const [data, setData, updateData] = signal([]),
9997
[selected, setSelected] = signal(null),
100-
run = () => setData(buildData(1000)),
98+
run = () => {
99+
setData(buildData(1000))
100+
},
101101
runLots = () => {
102102
setData(buildData(10000))
103103
},
104-
add = () => updateData(d => [...d, ...buildData(1000)]),
105-
update = () =>
106-
batch(() => {
107-
for (let i = 0, d = data(), len = d.length; i < len; i += 10)
108-
d[i].updateLabel(l => l + ' !!!')
109-
}),
104+
add = () => {
105+
updateData(d => [...d, ...buildData(1000)])
106+
},
107+
update = () => {
108+
for (let i = 0, d = data(), len = d.length; i < len; i += 10)
109+
d[i].updateLabel(l => l + ' !!!')
110+
},
110111
swapRows = () => {
111112
const d = data().slice()
112113
if (d.length > 998) {
@@ -116,13 +117,16 @@ const App = () => {
116117
setData(d)
117118
}
118119
},
119-
clear = () => setData([]),
120-
remove = id =>
120+
clear = () => {
121+
setData([])
122+
},
123+
remove = id => {
121124
updateData(d => {
122125
const idx = d.findIndex(datum => datum.id === id)
123126
d.splice(idx, 1)
124127
return [...d]
125-
}),
128+
})
129+
},
126130
isSelected = useSelector(selected)
127131

128132
return (
@@ -186,7 +190,7 @@ const App = () => {
186190
const { id, label } = row
187191

188192
return (
189-
<tr class:danger={isSelected(id)}>
193+
<tr class={{ danger: isSelected(id) }}>
190194
<td
191195
class="col-md-1"
192196
textContent={id}

0 commit comments

Comments
 (0)