state-in-url 3.0.4 → 3.0.6

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 (2) hide show
  1. package/README.md +13 -7
  2. package/package.json +10 -10
package/README.md CHANGED
@@ -3,7 +3,14 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
3
3
  <div align="center">
4
4
  <img src="/assets/Logo_big.png?raw=true" alt="state-in-url logo"/>
5
5
 
6
- <div>Easily share complex state between unrelated React components, with IDE autocomplete and TS validation. Without any hasssle or boilerplate. </div>
6
+ <div><h2>Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Without any hasssle or boilerplate.</h2></div>
7
+
8
+ </div>
9
+
10
+ <hr />
11
+
12
+ <div align="center">
13
+ <a href="https://github.com/asmyshlyaev177/state-in-url/blob/master/Limits.md" target="_blank">URI size limitation, <b>up to 12KB</b> is safe</a>
7
14
  </div>
8
15
 
9
16
  <div align="center">
@@ -16,7 +23,6 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
16
23
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)]([https://github.com/semantic-release/semantic-release](https://github.com/asmyshlyaev177/state-in-url))
17
24
  ![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/state-in-url.svg)
18
25
 
19
- [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/master/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua/)
20
26
  </div>
21
27
 
22
28
  <div align="center">
@@ -26,12 +32,14 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
26
32
  ![Demo-gif](https://github.com/asmyshlyaev177/state-in-url/blob/master/assets/Demo-gif.gif)
27
33
 
28
34
  <a href="https://state-in-url-asmyshlyaev177.vercel.app/" target="_blank">DEMO</a> |
29
- <a href="https://state-in-url.netlify.app/" target="_blank">DEMO2</a> |
35
+ <a href="https://state-in-url.netlify.app/" target="_blank">DEMO2</a>
30
36
 
31
37
  <hr />
32
38
 
33
39
  Add a ⭐️ and <a href="https://github.com/asmyshlyaev177" target="_blank">follow me</a> to support the project!
34
40
 
41
+ Will appreciate you feedback/opinion on [discussions](https://github.com/asmyshlyaev177/state-in-url/discussions/1)
42
+
35
43
  Share if it useful for you.
36
44
  [FB](https://www.facebook.com/sharer.php?u=https://github.com/asmyshlyaev177/state-in-url)
37
45
  [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/asmyshlyaev177/state-in-url)
@@ -42,7 +50,7 @@ Share if it useful for you.
42
50
 
43
51
  </div>
44
52
 
45
- ## Why use state-in-url?
53
+ # Why use state-in-url?
46
54
 
47
55
  `state-in-url` Simple state management with optional URL sync. Good for implementing deep links. Share complex states between unrelated React components, TS-friendly, NextJS compatible. Most of users don't care about URL, so, can use it to store your app state.
48
56
 
@@ -103,7 +111,7 @@ pnpm add state-in-url
103
111
  In `tsconfig.json` in `compilerOptions` set `"moduleResolution": "Bundler"`, or`"moduleResolution": "Node16"`, or `"moduleResolution": "NodeNext"`.
104
112
  Possibly need to set `"module": "ES2022"`, or `"module": "ESNext"`
105
113
 
106
- # useUrlState
114
+ ## useUrlState
107
115
 
108
116
  `useUrlState` is a custom React hook for Next.js/React-Router applications that make communication between client components easy. It allows you to share any complex state and sync it with the URL search parameters, providing a way to persist state across page reloads and share application state via URLs.
109
117
 
@@ -353,7 +361,6 @@ API is same as for Next.js version, except can pass options from [NavigateOption
353
361
 
354
362
  [Docs](packages/urlstate/react-router/useUrlState#api)
355
363
 
356
-
357
364
  ### Example
358
365
 
359
366
  ```typescript
@@ -487,7 +494,6 @@ function SettingsComponent() {
487
494
 
488
495
  See [Contributing doc](CONTRIBUTING.md)
489
496
 
490
-
491
497
  ## Roadmap
492
498
 
493
499
  - [x] hook for `Next.js`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "state-in-url",
3
- "version": "3.0.4",
4
- "description": "Library to store complex state in browser URL, includes hook for NextJS, hook for pure React, and low level helpers.",
3
+ "version": "3.0.6",
4
+ "description": "Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Deep links and url state synchronization wthout any hasssle or boilerplate.",
5
5
  "homepage": "https://state-in-url-asmyshlyaev177.vercel.app",
6
6
  "keywords": [
7
7
  "front-end",
@@ -103,7 +103,7 @@
103
103
  "test:unit": "wireit",
104
104
  "test:int": "wireit",
105
105
  "test:int:ci": "wireit",
106
- "test:exports": "npx babel-node --extensions .js,.mjs,.ts,.mts --config-file ./babel.config.json -- ./packages/urlstate/exportsTest.ts",
106
+ "test:exports": "npm run build && npx babel-node --extensions .js,.mjs,.ts,.mts --config-file ./babel.config.json -- ./packages/urlstate/exportsTest.ts",
107
107
  "test": "wireit",
108
108
  "tsc": "wireit",
109
109
  "dev": "wireit",
@@ -126,8 +126,7 @@
126
126
  "reinstall": "rm -rf dist .wireit node_modules packages/example-nextjs14/node_modules packages/example-nextjs14/.next packages/example-react/node_modules && npm install",
127
127
  "setup": "playwright install --with-deps",
128
128
  "prepack": "npm run build && cp package.json dist/package.json && npm run build:demo",
129
- "prepare": "npx husky",
130
- "preinstall": "npx only-allow npm"
129
+ "prepare": "npx husky"
131
130
  },
132
131
  "wireit": {
133
132
  "test": {
@@ -136,7 +135,7 @@
136
135
  "test:unit",
137
136
  "build:packages"
138
137
  ],
139
- "command": "npm run test:int"
138
+ "command": "npm run test:exports && npm run test:int"
140
139
  },
141
140
  "kill-next": {
142
141
  "command": "ps aux | grep .next | grep -v grep | awk '{print $2}' | xargs kill -9 2>&1; exit 0"
@@ -304,7 +303,7 @@
304
303
  "command": "cd packages/example-react && npm run build"
305
304
  },
306
305
  "build": {
307
- "command": "rollup -c rollup.config.js --bundleConfigAsCjs && npm run test:exports",
306
+ "command": "rollup -c rollup.config.js --bundleConfigAsCjs",
308
307
  "dependencies": [
309
308
  "cleanup"
310
309
  ]
@@ -386,6 +385,7 @@
386
385
  "jest": "^29.7.0",
387
386
  "jest-environment-jsdom": "^29.7.0",
388
387
  "lint-staged": "^15.2.9",
388
+ "only-allow": "^1.2.1",
389
389
  "playwright": "^1.45.3",
390
390
  "prettier": "^3.2.5",
391
391
  "prettier-plugin-tailwindcss": "^0.6.8",
@@ -399,7 +399,7 @@
399
399
  "ts-node": "^10.9.2",
400
400
  "typescript": "^5.3.3",
401
401
  "wait-on": "^8.0.1",
402
- "wireit": "^0.14.9",
403
- "zx": "^8.1.5"
404
- }
402
+ "wireit": "^0.14.9"
403
+ },
404
+ "packageManager": "npm@10.8.2"
405
405
  }