state-in-url 6.0.5 → 6.1.1
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 +3 -2
- package/package.json +116 -65
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ This library is a good alternative for NUQS.
|
|
|
90
90
|
- **compatible**: Will keep 3rd party query params as is
|
|
91
91
|
- **flexible**: Can use more than 1 state objects on the same page, just use different keys
|
|
92
92
|
- **Fast**: Minimal rerenders, around [1ms](https://github.com/asmyshlyaev177/state-in-url/blob/87c8c7c995c5cd7d9e7aa039c30bfe64b24abe4b/packages/urlstate/encoder/encoder.test.ts#L185) to encode and decode big object
|
|
93
|
-
- **Server Side Rendering**: Can use it in Server Components, Next.js 14 and
|
|
93
|
+
- **Server Side Rendering**: Can use it in Server Components, Next.js 14, 15, and 16 are supported
|
|
94
94
|
- **Lightweight**: Zero dependencies, library less than 2KB
|
|
95
95
|
- **DX**: Good developer experience, documentation, JSDoc comments, and examples
|
|
96
96
|
- **Framework Flexibility**: Hooks for `Next.js` and `react-router`, helpers to use it with other frameworks or pure JS
|
|
@@ -138,6 +138,7 @@ This library is a good alternative for NUQS.
|
|
|
138
138
|
- [Changelog](#changelog)
|
|
139
139
|
- [Mentions](#mentions)
|
|
140
140
|
- [License](#license)
|
|
141
|
+
- [Personal website](#personal-website)
|
|
141
142
|
- [Inspiration](#inspiration)
|
|
142
143
|
|
|
143
144
|
## installation
|
|
@@ -728,7 +729,7 @@ export const useUserState = () => {
|
|
|
728
729
|
|
|
729
730
|
1. Can pass only serializable values, `Function`, `BigInt` or `Symbol` won't work, probably things like `ArrayBuffer` neither. Everything that can be serialized to JSON will work.
|
|
730
731
|
2. Vercel servers limit size of headers (query string and other stuff) to **14KB**, so keep your URL state under ~5000 words. <https://vercel.com/docs/errors/URL_TOO_LONG>
|
|
731
|
-
3. Tested with `next.js` 14/15 with app router, no plans to support pages.
|
|
732
|
+
3. Tested with `next.js` 14/15/16 with app router, no plans to support pages.
|
|
732
733
|
|
|
733
734
|
## Other
|
|
734
735
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "state-in-url",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Store state in URL as in object, types and structure are preserved, with TS validation. Same API as React.useState, wthout any hasssle or boilerplate. Next.js@14-15, react-router@6-7, and remix@2.",
|
|
5
5
|
"homepage": "https://state-in-url.dev",
|
|
6
6
|
"repository": {
|
|
@@ -25,15 +25,6 @@
|
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/asmyshlyaev177/state-in-url/issues"
|
|
27
27
|
},
|
|
28
|
-
"workspaces": [
|
|
29
|
-
"packages/urlstate",
|
|
30
|
-
"packages/example-nextjs14",
|
|
31
|
-
"packages/example-nextjs15",
|
|
32
|
-
"packages/example-react",
|
|
33
|
-
"packages/example-react-router6",
|
|
34
|
-
"packages/example-react-router7",
|
|
35
|
-
"packages/example-remix2"
|
|
36
|
-
],
|
|
37
28
|
"files": [
|
|
38
29
|
"dist"
|
|
39
30
|
],
|
|
@@ -101,14 +92,16 @@
|
|
|
101
92
|
"test:unit": "wireit",
|
|
102
93
|
"test:int": "wireit",
|
|
103
94
|
"test:int:ci": "wireit",
|
|
104
|
-
"test:exports": "
|
|
105
|
-
"install:all": "
|
|
106
|
-
"install:ci": "
|
|
95
|
+
"test:exports": "pnpm run build && npx babel-node --extensions .js,.mjs,.ts,.mts --config-file ./babel.config.json -- ./packages/urlstate/exportsTest.ts",
|
|
96
|
+
"install:all": "pnpm install",
|
|
97
|
+
"install:ci": "pnpm install --frozen-lockfile",
|
|
107
98
|
"test": "wireit",
|
|
108
99
|
"tsc": "wireit",
|
|
109
100
|
"dev": "wireit",
|
|
110
101
|
"dev:lib": "wireit",
|
|
111
102
|
"dev:nextjs14": "wireit",
|
|
103
|
+
"dev:nextjs15": "wireit",
|
|
104
|
+
"dev:nextjs16": "wireit",
|
|
112
105
|
"dev:remix2": "wireit",
|
|
113
106
|
"bump": "npx standard-version --no-verify",
|
|
114
107
|
"build": "wireit",
|
|
@@ -124,21 +117,38 @@
|
|
|
124
117
|
"kill-vite": "wireit",
|
|
125
118
|
"kill": "wireit",
|
|
126
119
|
"rmdist": "rm -rf dist",
|
|
127
|
-
"cleanup": "rm -rf dist .wireit node_modules test-results playwright-report coverage-reports nyc_coverage packages/example-nextjs14/node_modules packages/example-nextjs14/.next packages/example-nextjs15/node_modules packages/example-nextjs15/.next packages/example-react/node_modules packages/example-react-router6/node_modules packages/example-react-router7/node_modules packages/example-remix2/node_modules",
|
|
128
|
-
"reinstall": "
|
|
120
|
+
"cleanup": "rm -rf dist .wireit node_modules test-results playwright-report coverage-reports nyc_coverage packages/example-nextjs14/node_modules packages/example-nextjs14/.next packages/example-nextjs15/node_modules packages/example-nextjs15/.next packages/example-nextjs16/node_modules packages/example-nextjs16/.next packages/example-react/node_modules packages/example-react-router6/node_modules packages/example-react-router7/node_modules packages/example-remix2/node_modules",
|
|
121
|
+
"reinstall": "pnpm run cleanup && pnpm install",
|
|
129
122
|
"setup": "playwright install --with-deps",
|
|
130
|
-
"prepack": "
|
|
123
|
+
"prepack": "pnpm run build && cp package.json dist/package.json && pnpm run build:demo",
|
|
131
124
|
"pin-gh-deps": "pin-github-action -i .github/workflows/tests.yml",
|
|
132
|
-
"prepare": "
|
|
125
|
+
"prepare": "pnpm exec husky"
|
|
133
126
|
},
|
|
134
127
|
"wireit": {
|
|
128
|
+
"dev": {
|
|
129
|
+
"dependencies": [
|
|
130
|
+
"dev:lib",
|
|
131
|
+
"dev:react",
|
|
132
|
+
"dev:remix2",
|
|
133
|
+
"dev:router6",
|
|
134
|
+
"dev:router7",
|
|
135
|
+
"dev:nextjs16",
|
|
136
|
+
"start:demo14"
|
|
137
|
+
],
|
|
138
|
+
"service": {
|
|
139
|
+
"readyWhen": {
|
|
140
|
+
"lineMatches": "http://localhost:3000"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"command": "pnpm run dev:nextjs15"
|
|
144
|
+
},
|
|
135
145
|
"test": {
|
|
136
146
|
"dependencies": [
|
|
137
147
|
"tsc",
|
|
138
148
|
"test:unit",
|
|
139
149
|
"build:packages"
|
|
140
150
|
],
|
|
141
|
-
"command": "
|
|
151
|
+
"command": "pnpm run test:exports && pnpm run test:int"
|
|
142
152
|
},
|
|
143
153
|
"kill-next": {
|
|
144
154
|
"command": "ps aux | grep .next | grep -v grep | awk '{print $2}' | xargs kill -9 2>&1; exit 0"
|
|
@@ -172,22 +182,6 @@
|
|
|
172
182
|
],
|
|
173
183
|
"command": "npx vitest"
|
|
174
184
|
},
|
|
175
|
-
"dev": {
|
|
176
|
-
"dependencies": [
|
|
177
|
-
"dev:lib",
|
|
178
|
-
"dev:react",
|
|
179
|
-
"dev:remix2",
|
|
180
|
-
"dev:router6",
|
|
181
|
-
"dev:router7",
|
|
182
|
-
"dev:nextjs15"
|
|
183
|
-
],
|
|
184
|
-
"service": {
|
|
185
|
-
"readyWhen": {
|
|
186
|
-
"lineMatches": "http://localhost:3000"
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
"command": "npm run dev:nextjs14"
|
|
190
|
-
},
|
|
191
185
|
"dev:lib": {
|
|
192
186
|
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.mjs -w",
|
|
193
187
|
"service": {
|
|
@@ -200,45 +194,61 @@
|
|
|
200
194
|
]
|
|
201
195
|
},
|
|
202
196
|
"dev:router6": {
|
|
203
|
-
"command": "cd packages/example-react-router6 &&
|
|
197
|
+
"command": "cd packages/example-react-router6 && pnpm run dev",
|
|
204
198
|
"service": true
|
|
205
199
|
},
|
|
206
200
|
"dev:router7": {
|
|
207
|
-
"command": "cd packages/example-react-router7 &&
|
|
201
|
+
"command": "cd packages/example-react-router7 && pnpm run dev",
|
|
208
202
|
"service": true
|
|
209
203
|
},
|
|
210
204
|
"dev:remix2": {
|
|
211
|
-
"command": "cd packages/example-remix2 && PORT=3003
|
|
205
|
+
"command": "cd packages/example-remix2 && PORT=3003 pnpm run dev",
|
|
212
206
|
"service": true
|
|
213
207
|
},
|
|
214
208
|
"dev:nextjs14": {
|
|
215
|
-
"command": "cd packages/example-nextjs14 &&
|
|
209
|
+
"command": "cd packages/example-nextjs14 && pnpm run dev --turbo",
|
|
216
210
|
"service": true
|
|
217
211
|
},
|
|
218
212
|
"dev:nextjs15": {
|
|
219
|
-
"command": "cd packages/example-nextjs15 &&
|
|
213
|
+
"command": "cd packages/example-nextjs15 && pnpm run dev --turbo",
|
|
220
214
|
"service": true
|
|
221
215
|
},
|
|
216
|
+
"dev:nextjs16": {
|
|
217
|
+
"command": "cd packages/example-nextjs16 && pnpm run dev --turbo",
|
|
218
|
+
"service": true
|
|
219
|
+
},
|
|
220
|
+
"build:next14": {
|
|
221
|
+
"command": "cd packages/example-nextjs14 && pnpm run build",
|
|
222
|
+
"dependencies": [
|
|
223
|
+
"build"
|
|
224
|
+
]
|
|
225
|
+
},
|
|
222
226
|
"build:next15": {
|
|
223
|
-
"command": "cd packages/example-nextjs15 &&
|
|
227
|
+
"command": "cd packages/example-nextjs15 && pnpm run build",
|
|
228
|
+
"dependencies": [
|
|
229
|
+
"build"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"build:next16": {
|
|
233
|
+
"command": "cd packages/example-nextjs16 && pnpm run build",
|
|
224
234
|
"dependencies": [
|
|
225
235
|
"build"
|
|
226
236
|
]
|
|
227
237
|
},
|
|
228
238
|
"build:router6": {
|
|
229
|
-
"command": "cd packages/example-react-router6 &&
|
|
239
|
+
"command": "cd packages/example-react-router6 && pnpm run build",
|
|
230
240
|
"dependencies": [
|
|
231
241
|
"build"
|
|
232
242
|
]
|
|
233
243
|
},
|
|
234
244
|
"build:router7": {
|
|
235
|
-
"command": "cd packages/example-react-router7 &&
|
|
245
|
+
"command": "cd packages/example-react-router7 && pnpm run build",
|
|
236
246
|
"dependencies": [
|
|
237
247
|
"build"
|
|
238
248
|
]
|
|
239
249
|
},
|
|
240
250
|
"build:remix2": {
|
|
241
|
-
"command": "cd packages/example-remix2 &&
|
|
251
|
+
"command": "cd packages/example-remix2 && pnpm run build",
|
|
242
252
|
"dependencies": [
|
|
243
253
|
"build"
|
|
244
254
|
]
|
|
@@ -247,23 +257,23 @@
|
|
|
247
257
|
"dependencies": [
|
|
248
258
|
"build"
|
|
249
259
|
],
|
|
250
|
-
"command": "cd packages/example-
|
|
260
|
+
"command": "cd packages/example-nextjs15 && pnpm run build"
|
|
251
261
|
},
|
|
252
262
|
"build:demo:tests": {
|
|
253
263
|
"dependencies": [
|
|
254
264
|
"build"
|
|
255
265
|
],
|
|
256
|
-
"command": "cd packages/example-
|
|
266
|
+
"command": "cd packages/example-nextjs15 && npx cross-env TEST=true pnpm run build"
|
|
257
267
|
},
|
|
258
268
|
"start:demo": {
|
|
259
269
|
"dependencies": [
|
|
260
270
|
"build:demo"
|
|
261
271
|
],
|
|
262
|
-
"command": "cd packages/example-
|
|
272
|
+
"command": "cd packages/example-nextjs15 && pnpm run start",
|
|
263
273
|
"service": true
|
|
264
274
|
},
|
|
265
275
|
"start:demo:ci": {
|
|
266
|
-
"command": "cd packages/example-
|
|
276
|
+
"command": "cd packages/example-nextjs15 && pnpm run start",
|
|
267
277
|
"service": true
|
|
268
278
|
},
|
|
269
279
|
"start:react": {
|
|
@@ -300,31 +310,54 @@
|
|
|
300
310
|
"service": true
|
|
301
311
|
},
|
|
302
312
|
"start:remix2": {
|
|
303
|
-
"command": "cd packages/example-remix2 &&
|
|
313
|
+
"command": "cd packages/example-remix2 && pnpm run start",
|
|
304
314
|
"dependencies": [
|
|
305
315
|
"build:remix2"
|
|
306
316
|
],
|
|
307
317
|
"service": true
|
|
308
318
|
},
|
|
309
319
|
"start:remix2:ci": {
|
|
310
|
-
"command": "cd packages/example-remix2 &&
|
|
320
|
+
"command": "cd packages/example-remix2 && pnpm run start",
|
|
321
|
+
"service": true
|
|
322
|
+
},
|
|
323
|
+
"start:demo14": {
|
|
324
|
+
"dependencies": [
|
|
325
|
+
"build:next14"
|
|
326
|
+
],
|
|
327
|
+
"command": "cd packages/example-nextjs14 && pnpm run start",
|
|
311
328
|
"service": true
|
|
312
329
|
},
|
|
313
330
|
"start:demo15": {
|
|
314
331
|
"dependencies": [
|
|
315
332
|
"build:next15"
|
|
316
333
|
],
|
|
317
|
-
"command": "cd packages/example-nextjs15 &&
|
|
334
|
+
"command": "cd packages/example-nextjs15 && pnpm run start",
|
|
335
|
+
"service": true
|
|
336
|
+
},
|
|
337
|
+
"start:demo14:ci": {
|
|
338
|
+
"command": "cd packages/example-nextjs14 && pnpm run start",
|
|
318
339
|
"service": true
|
|
319
340
|
},
|
|
320
341
|
"start:demo15:ci": {
|
|
321
|
-
"command": "cd packages/example-nextjs15 &&
|
|
342
|
+
"command": "cd packages/example-nextjs15 && pnpm run start",
|
|
343
|
+
"service": true
|
|
344
|
+
},
|
|
345
|
+
"start:demo16": {
|
|
346
|
+
"dependencies": [
|
|
347
|
+
"build:next16"
|
|
348
|
+
],
|
|
349
|
+
"command": "cd packages/example-nextjs16 && pnpm run start",
|
|
350
|
+
"service": true
|
|
351
|
+
},
|
|
352
|
+
"start:demo16:ci": {
|
|
353
|
+
"command": "cd packages/example-nextjs16 && pnpm run start",
|
|
322
354
|
"service": true
|
|
323
355
|
},
|
|
324
356
|
"start": {
|
|
325
|
-
"command": "
|
|
357
|
+
"command": "pnpm run start:demo15",
|
|
326
358
|
"dependencies": [
|
|
327
|
-
"start:
|
|
359
|
+
"start:demo14",
|
|
360
|
+
"start:demo16",
|
|
328
361
|
"start:react",
|
|
329
362
|
"start:router6",
|
|
330
363
|
"start:router7",
|
|
@@ -333,9 +366,10 @@
|
|
|
333
366
|
"service": true
|
|
334
367
|
},
|
|
335
368
|
"start:ci": {
|
|
336
|
-
"command": "
|
|
369
|
+
"command": "pnpm run start:demo15:ci",
|
|
337
370
|
"dependencies": [
|
|
338
|
-
"start:
|
|
371
|
+
"start:demo14:ci",
|
|
372
|
+
"start:demo16:ci",
|
|
339
373
|
"start:react:ci",
|
|
340
374
|
"start:router6:ci",
|
|
341
375
|
"start:router7:ci",
|
|
@@ -344,7 +378,7 @@
|
|
|
344
378
|
"service": true
|
|
345
379
|
},
|
|
346
380
|
"dev:react": {
|
|
347
|
-
"command": "cd packages/example-react &&
|
|
381
|
+
"command": "cd packages/example-react && pnpm run dev",
|
|
348
382
|
"service": true
|
|
349
383
|
},
|
|
350
384
|
"build:packages": {
|
|
@@ -352,14 +386,15 @@
|
|
|
352
386
|
"build",
|
|
353
387
|
"build:react",
|
|
354
388
|
"build:demo:tests",
|
|
355
|
-
"build:
|
|
389
|
+
"build:next14",
|
|
390
|
+
"build:next16",
|
|
356
391
|
"build:router6",
|
|
357
392
|
"build:router7",
|
|
358
393
|
"build:remix2"
|
|
359
394
|
]
|
|
360
395
|
},
|
|
361
396
|
"build:react": {
|
|
362
|
-
"command": "cd packages/example-react &&
|
|
397
|
+
"command": "cd packages/example-react && pnpm run build"
|
|
363
398
|
},
|
|
364
399
|
"build": {
|
|
365
400
|
"command": "rollup -c rollup.config.mjs",
|
|
@@ -415,19 +450,19 @@
|
|
|
415
450
|
"@semantic-release/changelog": "^6.0.3",
|
|
416
451
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
417
452
|
"@semantic-release/git": "^10.0.1",
|
|
418
|
-
"@semantic-release/npm": "^
|
|
453
|
+
"@semantic-release/npm": "^13.1.3",
|
|
419
454
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
420
455
|
"@testing-library/dom": "^10.4.1",
|
|
421
456
|
"@testing-library/jest-dom": "^6.9.0",
|
|
422
457
|
"@testing-library/react": "^16.3.0",
|
|
423
458
|
"@testing-library/react-hooks": "^8.0.1",
|
|
424
|
-
"@types/glob": "^8.1.0",
|
|
425
459
|
"@types/node": "^20.19.18",
|
|
426
460
|
"@types/react": "^18.3.25",
|
|
427
461
|
"@types/react-dom": "^18.3.7",
|
|
428
462
|
"@vitest/coverage-istanbul": "^2.1.9",
|
|
429
463
|
"auto-changelog": "^2.4.0",
|
|
430
464
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
465
|
+
"baseline-browser-mapping": "^2.8.32",
|
|
431
466
|
"chokidar": "^4.0.3",
|
|
432
467
|
"commitizen": "^4.3.0",
|
|
433
468
|
"commitlint": "^19.8.1",
|
|
@@ -441,6 +476,7 @@
|
|
|
441
476
|
"eslint-plugin-prettier": "^5.2.1",
|
|
442
477
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
443
478
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
479
|
+
"glob": "^13.0.0",
|
|
444
480
|
"happy-dom": "^15.11.7",
|
|
445
481
|
"husky": "^9.1.7",
|
|
446
482
|
"lint-staged": "^15.5.2",
|
|
@@ -450,19 +486,23 @@
|
|
|
450
486
|
"playwright": "^1.55.1",
|
|
451
487
|
"prettier": "^3.6.2",
|
|
452
488
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
489
|
+
"react-router": "^7.10.1",
|
|
453
490
|
"release-it": "^17.11.0",
|
|
454
491
|
"rollup": "^4.52.3",
|
|
455
492
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
456
493
|
"rollup-plugin-filesize": "^10.0.0",
|
|
457
494
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
458
|
-
"semantic-release": "^
|
|
495
|
+
"semantic-release": "^25.0.2",
|
|
459
496
|
"standard-version": "^9.5.0",
|
|
460
497
|
"ts-node": "^10.9.2",
|
|
461
498
|
"typescript": "^5.9.2",
|
|
462
499
|
"unplugin-auto-import": "^0.18.6",
|
|
463
500
|
"vitest": "^2.1.9",
|
|
464
501
|
"wait-on": "^8.0.5",
|
|
465
|
-
"wireit": "^0.14.12"
|
|
502
|
+
"wireit": "^0.14.12",
|
|
503
|
+
"next": "^15.5.9",
|
|
504
|
+
"react": "^19.2.1",
|
|
505
|
+
"react-dom": "^19.2.1"
|
|
466
506
|
},
|
|
467
507
|
"keywords": [
|
|
468
508
|
"state in url",
|
|
@@ -519,8 +559,19 @@
|
|
|
519
559
|
"decode url",
|
|
520
560
|
"fast"
|
|
521
561
|
],
|
|
522
|
-
"packageManager": "
|
|
523
|
-
"
|
|
524
|
-
"
|
|
562
|
+
"packageManager": "pnpm@10.26.0",
|
|
563
|
+
"pnpm": {
|
|
564
|
+
"overrides": {
|
|
565
|
+
"@remix-run/react>react": "18.3.1",
|
|
566
|
+
"@remix-run/react>react-dom": "18.3.1"
|
|
567
|
+
},
|
|
568
|
+
"onlyBuiltDependencies": [
|
|
569
|
+
"@parcel/watcher",
|
|
570
|
+
"core-js",
|
|
571
|
+
"esbuild",
|
|
572
|
+
"less",
|
|
573
|
+
"sharp",
|
|
574
|
+
"unrs-resolver"
|
|
575
|
+
]
|
|
525
576
|
}
|
|
526
577
|
}
|