Skip to content

Commit d8879ed

Browse files
authored
Rewrite state management with pure tree operations (#45)
Replace mutation-based tree operations with immutable pure functions using structural sharing. Remove lodash dependency. - 12-32x faster updates (no more cloneDeep on every change) - 11-13x faster selection - Reorganize src/ into components/, tree/, hooks/, types.ts
1 parent c0a41f3 commit d8879ed

22 files changed

Lines changed: 584 additions & 475 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ coverage
1212
/.idea
1313
*.lock
1414
/dist
15+
bench-baseline.json

package-lock.json

Lines changed: 3 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"scripts": {
1616
"test": "vitest",
1717
"test:coverage": "vitest run --coverage",
18+
"bench": "vitest bench",
19+
"bench:save": "vitest bench --outputJson bench-baseline.json",
1820
"lint": "oxlint src",
1921
"storybook": "storybook dev -p 6006",
2022
"build-storybook": "storybook build -o .out",
@@ -45,7 +47,6 @@
4547
"@storybook/test": "^8.6.18",
4648
"@testing-library/jest-dom": "^6.6.3",
4749
"@testing-library/react": "^16.1.0",
48-
"@types/lodash": "^4.14.182",
4950
"@types/node": "^22.0.0",
5051
"@types/react": "^18.0.0",
5152
"@types/react-dom": "^18.0.0",
@@ -72,7 +73,6 @@
7273
"pre-commit": "npx pretty-quick --staged"
7374
},
7475
"dependencies": {
75-
"lodash": "^4.17.23",
7676
"styled-components": "^6.0.0"
7777
}
7878
}

0 commit comments

Comments
 (0)