From 95dd546407929d306de230b4f69df0515404c2e8 Mon Sep 17 00:00:00 2001 From: Andrew Busch <6486627+andrewbusch7@users.noreply.github.com> Date: Fri, 1 Dec 2023 04:59:40 +1100 Subject: [PATCH 1/4] Support for react-router@6.19 (#124) --- README.md | 4 ++-- package.json | 4 ++-- pnpm-lock.yaml | 28 ++++++++++++++-------------- src/hooks/use-prompt.ts | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 40cd9cd..f470422 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ### Prerequisite -**React-router-dom >= 6.7** and can be used only with [**data routers**](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis) +**React-router-dom >= 6.19** and can be used only with [**data routers**](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis) ```bash pnpm add react-router-prompt @@ -69,7 +69,7 @@ yarn add react-router-prompt #### Note 🗒️ -This version works with react-router-dom >=v6.7 +This version works with react-router-dom >=v6.19 Should be used within [data routers](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis) For react-router-support `(v6 - v6.2.x)` please install v0.3.0 diff --git a/package.json b/package.json index 7ff6242..5772ac0 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "prettier": "^2.8.4", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.8.1", + "react-router-dom": "^6.19.0", "size-limit": "^8.1.2", "tslib": "^2.5.0", "typescript": "^5.0.0", @@ -85,7 +85,7 @@ "peerDependencies": { "react": ">=16.8", "react-dom": ">=16.8", - "react-router-dom": ">=6.7" + "react-router-dom": ">=6.19" }, "size-limit": [ { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8540cc..c647593 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,8 +71,8 @@ devDependencies: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) react-router-dom: - specifier: ^6.8.1 - version: 6.8.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^6.19.0 + version: 6.19.0(react-dom@18.2.0)(react@18.2.0) size-limit: specifier: ^8.1.2 version: 8.1.2 @@ -653,9 +653,9 @@ packages: fastq: 1.15.0 dev: true - /@remix-run/router@1.3.2: - resolution: {integrity: sha512-t54ONhl/h75X94SWsHGQ4G/ZrCEguKSRQr7DrjTciJXW0YU1QhlwYeycvK5JgkzlxmvrK7wq1NB/PLtHxoiDcA==} - engines: {node: '>=14'} + /@remix-run/router@1.12.0: + resolution: {integrity: sha512-2hXv036Bux90e1GXTWSMfNzfDDK8LA8JYEWfyHxzvwdp6GyoWEovKc9cotb3KCKmkdwsIBuFGX7ScTWyiHv7Eg==} + engines: {node: '>=14.0.0'} dev: true /@rollup/pluginutils@5.0.2: @@ -3045,26 +3045,26 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true - /react-router-dom@6.8.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-67EXNfkQgf34P7+PSb6VlBuaacGhkKn3kpE51+P6zYSG2kiRoumXEL6e27zTa9+PGF2MNXbgIUHTVlleLbIcHQ==} - engines: {node: '>=14'} + /react-router-dom@6.19.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-N6dWlcgL2w0U5HZUUqU2wlmOrSb3ighJmtQ438SWbhB1yuLTXQ8yyTBMK3BSvVjp7gBtKurT554nCtMOgxCZmQ==} + engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' dependencies: - '@remix-run/router': 1.3.2 + '@remix-run/router': 1.12.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-router: 6.8.1(react@18.2.0) + react-router: 6.19.0(react@18.2.0) dev: true - /react-router@6.8.1(react@18.2.0): - resolution: {integrity: sha512-Jgi8BzAJQ8MkPt8ipXnR73rnD7EmZ0HFFb7jdQU24TynGW1Ooqin2KVDN9voSC+7xhqbbCd2cjGUepb6RObnyg==} - engines: {node: '>=14'} + /react-router@6.19.0(react@18.2.0): + resolution: {integrity: sha512-0W63PKCZ7+OuQd7Tm+RbkI8kCLmn4GPjDbX61tWljPxWgqTKlEpeQUwPkT1DRjYhF8KSihK0hQpmhU4uxVMcdw==} + engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' dependencies: - '@remix-run/router': 1.3.2 + '@remix-run/router': 1.12.0 react: 18.2.0 dev: true diff --git a/src/hooks/use-prompt.ts b/src/hooks/use-prompt.ts index 53f63bf..28fde00 100644 --- a/src/hooks/use-prompt.ts +++ b/src/hooks/use-prompt.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect } from "react" import { useBeforeUnload, - unstable_useBlocker as useBlocker, + useBlocker, unstable_Blocker as Blocker, unstable_BlockerFunction as BlockerFunction, } from "react-router-dom" From 5ec18e336a44f4312a7ef2526f9f31c583226424 Mon Sep 17 00:00:00 2001 From: Shyam Gupta Date: Thu, 30 Nov 2023 23:46:05 +0530 Subject: [PATCH 2/4] Bump version to 0.6.0 --- README.md | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f470422..404b1b3 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,12 @@ yarn add react-router-prompt This version works with react-router-dom >=v6.19 Should be used within [data routers](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis) -For react-router-support `(v6 - v6.2.x)` please install v0.3.0 +For react-router support `(v6 - v6.2.x)` please install v0.3.0 -_Skipped support in middle due to breaking changes on react-router apis_ +For react-router support (v6.7.x - v6.18.x) please install v0.5.4 -```sh -yarn add react-router-prompt@0.3.0 -``` + +_Skipped support in middle due to breaking changes on react-router apis_ ## Contributing diff --git a/package.json b/package.json index 5772ac0..7d23109 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-router-prompt", - "version": "0.5.4", + "version": "0.6.0", "description": "React Router Navigation Prompt for v6", "type": "module", "files": [ From 8415b14b72748ac97b531e9f5cd66bf88a78000c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:46:31 +0530 Subject: [PATCH 3/4] chore(deps): update actions/checkout action to v4 (#112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/publish-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3ea0392..33a0961 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index a84d50f..8afca4d 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -8,7 +8,7 @@ jobs: steps: # Checkout the exact commit tagged on the release. - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.release.target_commitish }} From 6622b6d55a569b7e6b6ffdb0189fc7d56e45a8a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:47:12 +0530 Subject: [PATCH 4/4] chore(deps): update actions/setup-node action to v4 (#119) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 8afca4d..467aeb9 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -21,7 +21,7 @@ jobs: version: 7 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} registry-url: "https://registry.npmjs.org"