synstate-react-hooks-compat 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/package.json +34 -33
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
# SynState React hooks
|
|
1
|
+
# SynState React hooks (compat)
|
|
2
2
|
|
|
3
|
-
synstate-react-hooks re-exports all exports from synstate except for `createState`, `createReducer`, and `createBooleanState`, and exports modified versions of those creation functions.
|
|
3
|
+
synstate-react-hooks-compat re-exports all exports from synstate except for `createState`, `createReducer`, and `createBooleanState`, and exports modified versions of those creation functions.
|
|
4
4
|
|
|
5
|
-
The first element of the array returned by the `createState<T>` function provided by synstate-
|
|
5
|
+
The first element of the array returned by the `createState<T>` function provided by synstate-react-hooks-compat is changed from `InitializedObservable<T>` to a React hook `() => T`, and the `InitializedObservable<T>` has been moved to the `state` property in the object at index 2.
|
|
6
|
+
|
|
7
|
+
This package provides the same API as [synstate-react-hooks](https://www.npmjs.com/package/synstate-react-hooks), but subscribes to observables with `useState` + `useEffect` instead of `useSyncExternalStore`, so it also works with React 16.8 and 17. Use synstate-react-hooks if you are on React 18 or later.
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "synstate-react-hooks-compat",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "SynState React hooks for React 16.8–17 (without useSyncExternalStore)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"LICENSE"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"synstate": "3.0.
|
|
31
|
+
"synstate": "3.0.5",
|
|
32
32
|
"ts-data-forge": "^14.7.1",
|
|
33
33
|
"ts-type-forge": "^9.2.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@testing-library/dom": "10.4.
|
|
36
|
+
"@testing-library/dom": "10.4.2",
|
|
37
37
|
"@testing-library/react": "16.3.3",
|
|
38
38
|
"@types/react": "19.3.0",
|
|
39
39
|
"@types/react-dom": "19.3.0",
|
|
40
|
-
"@vitest/browser-playwright": "5.0.
|
|
41
|
-
"eslint-config-typed": "5.
|
|
42
|
-
"eslint-plugin-ts-data-forge": "0.
|
|
43
|
-
"eslint-plugin-ts-fortress": "1.2.
|
|
44
|
-
"eslint-plugin-ts-type-forge": "0.8.
|
|
45
|
-
"playwright": "1.
|
|
46
|
-
"prettier": "3.9.
|
|
40
|
+
"@vitest/browser-playwright": "5.0.1",
|
|
41
|
+
"eslint-config-typed": "5.15.0",
|
|
42
|
+
"eslint-plugin-ts-data-forge": "0.8.1",
|
|
43
|
+
"eslint-plugin-ts-fortress": "1.2.3",
|
|
44
|
+
"eslint-plugin-ts-type-forge": "0.8.4",
|
|
45
|
+
"playwright": "1.63.0",
|
|
46
|
+
"prettier": "3.9.8",
|
|
47
47
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
48
48
|
"prettier-plugin-packagejson": "3.0.2",
|
|
49
|
-
"react": "19.
|
|
50
|
-
"react-dom": "19.
|
|
51
|
-
"ts-repo-utils": "10.
|
|
49
|
+
"react": "19.3.0",
|
|
50
|
+
"react-dom": "19.3.0",
|
|
51
|
+
"ts-repo-utils": "10.7.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": ">=16.8.0"
|
|
@@ -63,31 +63,32 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts",
|
|
66
|
-
"build:min": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts --skip-check",
|
|
67
66
|
"check:ext": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-ext.mts",
|
|
67
|
+
"check:lint": "eslint .",
|
|
68
|
+
"check:test": "pnpm run z:vitest:node run",
|
|
69
|
+
"check:test:browser": "pnpm run z:vitest --project='Browser' run",
|
|
70
|
+
"check:test:cov": "pnpm run z:vitest run --coverage",
|
|
71
|
+
"check:types": "node ../../node_modules/typescript-native/bin/tsc --noEmit",
|
|
68
72
|
"check-all": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-all.mts",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"fmt": "
|
|
74
|
-
"
|
|
75
|
-
"fmt
|
|
76
|
-
"gen
|
|
73
|
+
"doc": "run-s gen:readme gen:jsdoc fix:fmt",
|
|
74
|
+
"fix:codemod": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-codemod-cli/src/cmd/ts-codemod.mts --transformer convert-to-readonly '{src,samples,test}/**/*.{mts,tsx}'",
|
|
75
|
+
"fix:fmt": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-uncommitted.mts --cwd .",
|
|
76
|
+
"fix:fmt:diff": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-diff-from.mts origin/main --cwd .",
|
|
77
|
+
"fix:fmt:full": "pnpm run z:prettier .",
|
|
78
|
+
"fix:lint": "eslint . --fix",
|
|
79
|
+
"fmt": "pnpm run fix:fmt",
|
|
80
|
+
"gen": "run-s gen:index gen:re-export gen:readme gen:jsdoc",
|
|
81
|
+
"gen:index": "run-s gen:index:src fix:fmt",
|
|
82
|
+
"gen:index:src": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/gen-index-ts.mts ./src --index-ext .mts --export-ext .mjs --target-ext .mts --target-ext .tsx --exclude entry-point.mts",
|
|
83
|
+
"gen:jsdoc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples-in-jsdoc.mts",
|
|
84
|
+
"gen:re-export": "run-s gen:re-export:script fix:fmt",
|
|
77
85
|
"gen:re-export:script": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/generate-re-export-script.mts",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"lint": "eslint .",
|
|
81
|
-
"lint:fix": "eslint . --fix",
|
|
82
|
-
"test": "pnpm run z:vitest:node run",
|
|
83
|
-
"test:browser": "pnpm run z:vitest --project='Browser' run",
|
|
84
|
-
"test:cov": "pnpm run z:vitest run --coverage",
|
|
86
|
+
"gen:readme": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples.mts",
|
|
87
|
+
"test": "pnpm run check:test",
|
|
85
88
|
"test:cov:ui": "vite preview --outDir ./coverage",
|
|
86
89
|
"test:ui": "pnpm run z:vitest:node --ui",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"tscw": "node ../../node_modules/typescript-native/bin/tsc --noEmit --watch",
|
|
90
|
-
"type-check": "node ../../node_modules/typescript-native/bin/tsc --noEmit",
|
|
90
|
+
"watch:test": "pnpm run z:vitest:node watch",
|
|
91
|
+
"watch:types": "node ../../node_modules/typescript-native/bin/tsc --noEmit --watch",
|
|
91
92
|
"z:prettier": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --ignore-path ../../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
|
|
92
93
|
"z:vitest": "vitest --config ./configs/vitest.config.mts",
|
|
93
94
|
"z:vitest:node": "pnpm run z:vitest --project='Node.js'"
|