Skip to content

Commit

Permalink
Merge branch 'recruit-tech:main' into renovate
Browse files Browse the repository at this point in the history
  • Loading branch information
AkifumiSato authored Sep 23, 2023
2 parents 9292a19 + 1bdba54 commit 8cfbe80
Show file tree
Hide file tree
Showing 9 changed files with 2,130 additions and 1,148 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: yarn
run: yarn
- name: Run eslint for library
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16.14.0
Expand Down Expand Up @@ -45,6 +45,6 @@ jobs:
LICENSE
package.json
yarn.lock
dist/*
dist/**/*
src/
tsconfig.json
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,60 @@ function MyApp({ Component, pageProps }: AppProps) {
}
```

### \<RecoilURLSyncNext>

A version of [\<RecoilURLSync>](https://recoiljs.org/docs/recoil-sync/api/RecoilURLSync) that works with next/router
to sync atoms with the browser URL using your own serialize/deserialize algorithms.
This should be a child element of [\<RecoilRoot>](https://recoiljs.org/docs/api-reference/core/RecoilRoot).

```typescript
function RecoilURLSyncNext(props: {
storeKey?: string | undefined
location: LocationOption
serialize: (data: unknown) => string
deserialize: (str: string) => unknown
children: ReactNode
}): ReactNode
```

#### Props

- `storeKey`
- This prop is used to match up which atoms should sync with this external store.
See [Syncing with Multiple Storages](https://recoiljs.org/docs/recoil-sync/sync-effect#syncing-with-multiple-storages) for more info.
- `location`
- This prop specifies what part of the URL to sync.
See [URL Location](https://recoiljs.org/docs/recoil-sync/api/RecoilURLSync#url-location) for more info.
- `serialize`
- The callback can provide custom serializations.
See [Custom serialization](https://recoiljs.org/docs/recoil-sync/api/RecoilURLSync#custom-serialization) for more info.
- `deserialize`
- The callback can provide custom deserializations.
See [Custom serialization](https://recoiljs.org/docs/recoil-sync/api/RecoilURLSync#custom-serialization) for more info.
- `children`
- React elements in your component tree.

#### Example

```tsx
import { RecoilURLSyncNext } from 'recoil-sync-next'
import qs from 'qs'
function MyApp({ Component, pageProps }: AppProps) {
return (
<RecoilRoot>
<RecoilURLSyncNext
location={{ part: 'queryParams' }}
serialize={qs.stringify}
deserialize={qs.parse}
>
<Component {...pageProps} />
</RecoilURLSyncNext>
</RecoilRoot>
)
}
```

## Session Storage Persistence Synced with History

Provides persistence of atoms to session storage synced with the position of the history entry.
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recoil-sync-next",
"version": "0.0.3",
"version": "0.0.5",
"description": "recoil-sync stores for Next.js",
"keywords": [
"react",
Expand Down Expand Up @@ -61,37 +61,37 @@
"transit-js": "^0.8.874"
},
"devDependencies": {
"@jest/types": "29.2.1",
"@jest/types": "29.6.3",
"@recoiljs/refine": "0.1.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "13.4.0",
"@types/jest": "29.2.2",
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.8",
"@types/transit-js": "0.8.0",
"@typescript-eslint/eslint-plugin": "5.42.0",
"@typescript-eslint/parser": "5.42.0",
"eslint": "8.27.0",
"eslint-config-next": "13.0.2",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-react": "7.31.10",
"@testing-library/jest-dom": "6.1.3",
"@testing-library/react": "14.0.0",
"@types/jest": "29.5.5",
"@types/node": "18.17.18",
"@types/react": "18.2.22",
"@types/react-dom": "18.2.7",
"@types/transit-js": "0.8.1",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"eslint": "8.49.0",
"eslint-config-next": "13.5.2",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"jest": "29.2.2",
"jest-environment-jsdom": "29.2.2",
"next": "13.0.2",
"next-router-mock": "0.7.4",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"next": "13.5.2",
"next-router-mock": "0.9.9",
"npm-run-all": "4.1.5",
"prettier": "2.7.1",
"prettier": "3.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"recoil": "0.7.6",
"recoil": "0.7.7",
"recoil-sync": "0.2.0",
"simple-git-hooks": "2.8.1",
"simple-git-hooks": "2.9.0",
"transit-js": "0.8.874",
"ts-jest": "29.0.3",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"typescript": "4.8.4"
"typescript": "5.2.2"
}
}
1 change: 1 addition & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"schedule": ["after 10pm and before 5am"],
"dependencyDashboard": false,
"automerge": true,
"platformAutomerge": true,
"separateMultipleMajor": true
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './history/RecoilHistorySyncJSONNext'
export * from './history/RecoilHistorySyncTransitNext'
export * from './url/RecoilURLSyncJSONNext'
export * from './url/RecoilURLSyncNext'
export * from './url/RecoilURLSyncTransitNext'
export * from './utils/initializableAtom'
export * from './utils/initializableAtomFamily'
Loading

0 comments on commit 8cfbe80

Please sign in to comment.