@use-raf/state 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/package.json +20 -27
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 einouqo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -60,7 +60,7 @@ const Demo = () => {
60
60
  **Note:** When multiple updater functions are called between frames (e.g., `setState(prev => prev + 1)` three times), `@use-raf/state` correctly chains them, resulting in `3`, while other implementations (`@shined/react-use`, `react-use`, `@reactuses/core`) only apply the last update, resulting in `1`. See [the trial test case](./src/state.test.ts#L367-L410):
61
61
 
62
62
  ```bash
63
- bun run test:trial
63
+ pnpm run test:trial
64
64
  ```
65
65
 
66
66
  Another example illustrating this behavior:
@@ -132,7 +132,7 @@ Benchmarked against similar hooks from popular libraries. While `react-use` lead
132
132
  **Running benchmarks:**
133
133
 
134
134
  ```bash
135
- bun run bench
135
+ pnpm run bench
136
136
  ```
137
137
 
138
138
  **Performance regression tracking:** benchmark results are continuously monitored via [CodSpeed][codspeed-link] to detect performance regressions.
package/package.json CHANGED
@@ -1,21 +1,14 @@
1
1
  {
2
2
  "name": "@use-raf/state",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "React frame-synchronized state hook",
5
5
  "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- ".": "./src/index.ts"
10
- },
11
- "publishConfig": {
12
- "main": "./dist/index.js",
13
- "types": "./dist/index.d.ts",
14
- "exports": {
15
- ".": {
16
- "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js"
18
- }
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
19
12
  }
20
13
  },
21
14
  "files": [
@@ -34,22 +27,11 @@
34
27
  "animation",
35
28
  "schedule"
36
29
  ],
37
- "scripts": {
38
- "build": "tsup",
39
- "lint": "biome check",
40
- "lint:fix": "biome check --write",
41
- "test": "vitest run",
42
- "test:watch": "vitest",
43
- "test:trial": "TRIAL=true vitest run",
44
- "bench": "vitest bench --run --no-file-parallelism --sequence.shuffle",
45
- "bench:watch": "vitest bench --no-file-parallelism --sequence.shuffle",
46
- "bench:regress": "vitest bench --run -t '#regress' --no-file-parallelism"
47
- },
48
30
  "peerDependencies": {
49
31
  "react": ">=16.14"
50
32
  },
51
33
  "dependencies": {
52
- "@use-raf/skd": "workspace:*"
34
+ "@use-raf/skd": "0.0.3"
53
35
  },
54
36
  "devDependencies": {
55
37
  "@reactuses/core": "^6.1.8",
@@ -65,5 +47,16 @@
65
47
  "bugs": {
66
48
  "url": "https://github.com/einouqo/use-raf/issues"
67
49
  },
68
- "license": "MIT"
69
- }
50
+ "license": "MIT",
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "lint": "biome check",
54
+ "lint:fix": "biome check --write",
55
+ "test": "vitest run",
56
+ "test:watch": "vitest",
57
+ "test:trial": "TRIAL=true vitest run",
58
+ "bench": "vitest bench --run --no-file-parallelism --sequence.shuffle",
59
+ "bench:watch": "vitest bench --no-file-parallelism --sequence.shuffle",
60
+ "bench:regress": "vitest bench --run -t '#regress' --no-file-parallelism"
61
+ }
62
+ }