Skip to content

Commit

Permalink
Remove initial url cleanup (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Jun 28, 2023
1 parent 9e87177 commit a23b158
Show file tree
Hide file tree
Showing 12 changed files with 1,058 additions and 1,022 deletions.
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/server.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Should render home page correctly 1`] = `"<div><a href=\\"/\\" class=\\"active\\">Home</a><a href=\\"/users\\">Users</a><a href=\\"/users/123\\">User</a><div>Home</div></div>"`;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hydration.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render } from "@testing-library/react";
import * as React from "react";
import { afterEach, expect, test, vi } from "vitest";
import { createRouter, Link } from "../src";
import { Link, createRouter } from "../src";

const Router = createRouter({
Home: "/",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as React from "react";
import * as ReactDOMServer from "react-dom/server";
import { expect, test } from "vitest";
import { createRouter, Link, ServerUrlProvider } from "../src";
import { Link, ServerUrlProvider, createRouter } from "../src";

const Router = createRouter({
Home: "/",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parsePath, Path as HistoryLocation } from "history";
import { Path as HistoryLocation, parsePath } from "history";
import { decodeLocation } from "../src/location";
import { Location } from "../src/types";

Expand Down
10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"@swan-io/chicane": "link:../",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"ts-pattern": "^4.3.0"
"ts-pattern": "^5.0.1"
},
"devDependencies": {
"@types/react": "^17.0.59",
"@types/react": "^17.0.62",
"@types/react-dom": "^17.0.20",
"@vitejs/plugin-react-swc": "^3.3.1",
"typescript": "^5.0.4",
"vite": "^4.3.8"
"@vitejs/plugin-react-swc": "^3.3.2",
"typescript": "^5.1.3",
"vite": "^4.3.9"
}
}
188 changes: 94 additions & 94 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


"@babel/runtime@^7.7.6":
version "7.21.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200"
integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==
version "7.22.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.3.tgz#0a7fce51d43adbf0f7b517a71f4c3aaca92ebcbb"
integrity sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==
dependencies:
regenerator-runtime "^0.13.11"

Expand Down Expand Up @@ -128,71 +128,71 @@
version "0.0.0"
uid ""

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.60.tgz#5ff6442e32d8c285d728b34a56af226af552cdfa"
integrity sha512-oCDKWGdSO1WyErduGfiITRDoq7ZBt9PXETlhi8BGKH/wCc/3mfSNI9wXAg3Stn8mrT0lUJtdsnwMI/eZp6dK+A==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.60.tgz#99a78e92c7f18d46e3bc48b589c62e55c5d98ce2"
integrity sha512-pcE/1oUlmN/BkKndOPtViqTkaM5pomagXATo+Muqn4QNMnkSOEVcmF9T3Lr3nB1A7O/fwCew3/aHwZ5B2TZ1tA==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.60.tgz#53a4e44fd7a81cd6887cb04abb282612986734a8"
integrity sha512-Moc+86SWcbPr06PaQYUb0Iwli425F7QgjwTCNEPYA6OYUsjaJhXMaHViW2WdGIXue2+eaQbg31BHQd14jXcoBg==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.60.tgz#ee80faccb9bb3f19372d8b4d862ec7789fa30501"
integrity sha512-pPGZrTgSXBvp6IrXPXz8UJr82AElf8hMuK4rNHmLGDCqrWnRIFLUpiAsc2WCFIgdwqitZNQoM+F2vbceA/bkKg==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.60.tgz#4db4bbb1c32a00adfd79ba787bc5217d23dd1e4f"
integrity sha512-HSFQaVUkjWYNsQeymAQ3IPX3csRQvHe6MFyqPfvCCQ4dFlxPvlS7VvNaLnGG+ZW1ek7Lc+hEX+4NGzZKsxDIHA==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.60.tgz#998850b1ad8c5eb137a3c914ce9e62e4ac006dbb"
integrity sha512-WJt/X6HHM3/TszckRA7UKMXec3FHYsB9xswQbIYxN4bfTQodu3Rc8bmpHYtFO7ScMLrhY+RljHLK6wclPvaEXw==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.60.tgz#7aff3519397f42b5255718bc5000970bb3a28be4"
integrity sha512-DGGBqAPUXy/aPMBKokL3osZC9kM97HchiDPuprzwgTMP40YQ3hGCzNJ5jK7sOk9Tc4PEdZ2Igfr9sBHmCrxxQw==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.60.tgz#f6fc2ad36eaf4e1a0d7783f1095b28092e9c5a7a"
integrity sha512-wQg/BZPJvp5WpUbsBp7VHjhUh0DfYOPhP6dH67WO9QQ07+DvOk2DR2Bfh0z0ts1k7H/FsAqExWtTDCWMCRJiRQ==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.60.tgz#8ab8e2c5520d6a9d5d043c25c6cafb156c5c419a"
integrity sha512-nqkd0XIVyGbnBwAxP4GIfx6n45/hAPETpmQYpDSGnucOKFJfvGdFGL81GDG1acPCq/oFtR3tIyTbPpKmJ0N6xQ==

"@swc/[email protected].60":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.60.tgz#5b53fd84ab74bfcfc6e691f9ac07f4373e37ca14"
integrity sha512-ouw+s22i9PYQpSE7Xc+ZittEyA87jElXABesviSpP+jgHt10sM5KFUpVAeV8DRlxJCXMJJ5AhOdCf4TAtFr+6A==

"@swc/core@^1.3.56":
version "1.3.60"
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.60.tgz#57f75930d3deafac3215e8cdda44ce11895d0894"
integrity sha512-dWfic7sVjnrStzGcMWakHd2XPau8UXGPmFUTkx6xGX+DOVtfAQVzG6ZW7ohw/yNcTqI05w6Ser26XMTMGBgXdA==
"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.62.tgz#dafb50bf784c6b7b40dce6d8cf0605f6729812cb"
integrity sha512-MmGilibITz68LEje6vJlKzc2gUUSgzvB3wGLSjEORikTNeM7P8jXVxE4A8fgZqDeudJUm9HVWrxCV+pHDSwXhA==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.62.tgz#324bd144268860338040db64c42c2345fcaaebcf"
integrity sha512-Xl93MMB3sCWVlYWuQIB+v6EQgzoiuQYK5tNt9lsHoIEVu2zLdkQjae+5FUHZb1VYqCXIiWcULFfVz0R4Sjb7JQ==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.62.tgz#9b5ca188ea3c91827e43e4287bd20ce2a7cb7d81"
integrity sha512-nJsp6O7kCtAjTTMcIjVB0g5y1JNiYAa5q630eiwrnaHUusEFoANDdORI3Z9vXeikMkng+6yIv9/V8Rb093xLjQ==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.62.tgz#b208b005223fd9c4c4a12fc0e24070c5e902965f"
integrity sha512-XGsV93vpUAopDt5y6vPwbK1Nc/MlL55L77bAZUPIiosWD1cWWPHNtNSpriE6+I+JiMHe0pqtfS/SSTk6ZkFQVw==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.62.tgz#bf66add093fa732d3b7f629e00b6ef9bf3c483f2"
integrity sha512-ESUmJjSlTTkoBy9dMG49opcNn8BmviqStMhwyeD1G8XRnmRVCZZgoBOKdvCXmJhw8bQXDhZumeaTUB+OFUKVXg==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.62.tgz#b97eee374986388b71d87c67d7edb8208356dde2"
integrity sha512-wnHJkt3ZBrax3SFnUHDcncG6mrSg9ZZjMhQV9Mc3JL1x1s1Gy9rGZCoBNnV/BUZWTemxIBcQbANRSDut/WO+9A==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.62.tgz#548ccdef6d7535ee7fea6ec9488322411f10da1a"
integrity sha512-9oRbuTC/VshB66Rgwi3pTq3sPxSTIb8k9L1vJjES+dDMKa29DAjPtWCXG/pyZ00ufpFZgkGEuAHH5uqUcr1JQg==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.62.tgz#fc0ca735b23c017fe8ff6f85aa4788ddd1ac583d"
integrity sha512-zv14vlF2VRrxS061XkfzGjCYnOrEo5glKJjLK5PwUKysIoVrx/L8nAbFxjkX5cObdlyoqo+ekelyBPAO+4bS0w==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.62.tgz#f8dfbb4f0763d2db5ef420b04da3b5cb73897756"
integrity sha512-8MC/PZQSsOP2iA/81tAfNRqMWyEqTS/8zKUI67vPuLvpx6NAjRn3E9qBv7iFqH79iqZNzqSMo3awnLrKZyFbcw==

"@swc/[email protected].62":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.62.tgz#e661ec99c5ac91f1cd63c02b5f114f73f55e7b15"
integrity sha512-GJSmUJ95HKHZXAxiuPUmrcm/S3ivQvEzXhOZaIqYBIwUsm02vFZkClsV7eIKzWjso1t0+I/8MjrnUNaSWqh1rQ==

"@swc/core@^1.3.61":
version "1.3.62"
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.62.tgz#bc93ede0981ee69fe17d753e1d693ce3afa6c16b"
integrity sha512-J58hWY+/G8vOr4J6ZH9hLg0lMSijZtqIIf4HofZezGog/pVX6sJyBJ40dZ1ploFkDIlWTWvJyqtpesBKS73gkQ==
optionalDependencies:
"@swc/core-darwin-arm64" "1.3.60"
"@swc/core-darwin-x64" "1.3.60"
"@swc/core-linux-arm-gnueabihf" "1.3.60"
"@swc/core-linux-arm64-gnu" "1.3.60"
"@swc/core-linux-arm64-musl" "1.3.60"
"@swc/core-linux-x64-gnu" "1.3.60"
"@swc/core-linux-x64-musl" "1.3.60"
"@swc/core-win32-arm64-msvc" "1.3.60"
"@swc/core-win32-ia32-msvc" "1.3.60"
"@swc/core-win32-x64-msvc" "1.3.60"
"@swc/core-darwin-arm64" "1.3.62"
"@swc/core-darwin-x64" "1.3.62"
"@swc/core-linux-arm-gnueabihf" "1.3.62"
"@swc/core-linux-arm64-gnu" "1.3.62"
"@swc/core-linux-arm64-musl" "1.3.62"
"@swc/core-linux-x64-gnu" "1.3.62"
"@swc/core-linux-x64-musl" "1.3.62"
"@swc/core-win32-arm64-msvc" "1.3.62"
"@swc/core-win32-ia32-msvc" "1.3.62"
"@swc/core-win32-x64-msvc" "1.3.62"

"@types/prop-types@*":
version "15.7.5"
Expand All @@ -206,10 +206,10 @@
dependencies:
"@types/react" "^17"

"@types/react@^17", "@types/react@^17.0.59":
version "17.0.59"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.59.tgz#5aa4e161a356fcb824d81f166e01bad9e82243bb"
integrity sha512-gSON5zWYIGyoBcycCE75E9+r6dCC2dHdsrVkOEiIYNU5+Q28HcBAuqvDuxHcCbMfHBHdeT5Tva/AFn3rnMKE4g==
"@types/react@^17", "@types/react@^17.0.60":
version "17.0.60"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.60.tgz#a4a97dcdbebad76612c188fc06440e4995fd8ad2"
integrity sha512-pCH7bqWIfzHs3D+PDs3O/COCQJka+Kcw3RnO9rFA2zalqoXg7cNjJDh6mZ7oRtY1wmY4LVwDdAbA1F7Z8tv3BQ==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
Expand All @@ -220,12 +220,12 @@
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5"
integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==

"@vitejs/plugin-react-swc@^3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@vitejs/plugin-react-swc/-/plugin-react-swc-3.3.1.tgz#d5f7b0b09359de65ba8000286a42571417392ebe"
integrity sha512-ZoYjGxMniXP7X+5ry/W1tpY7w0OeLUEsBF5RHFPmAhpgwwNWie8OF4056MRXRi9QgvYYoZPDzdOXGK3wlCoTfQ==
"@vitejs/plugin-react-swc@^3.3.2":
version "3.3.2"
resolved "https://registry.yarnpkg.com/@vitejs/plugin-react-swc/-/plugin-react-swc-3.3.2.tgz#34a82c1728066f48a86dfecb2f15df60f89207fb"
integrity sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==
dependencies:
"@swc/core" "^1.3.56"
"@swc/core" "^1.3.61"

csstype@^3.0.2:
version "3.1.2"
Expand Down Expand Up @@ -300,9 +300,9 @@ picocolors@^1.0.0:
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

postcss@^8.4.23:
version "8.4.23"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.23.tgz#df0aee9ac7c5e53e1075c24a3613496f9e6552ab"
integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==
version "8.4.24"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.24.tgz#f714dba9b2284be3cc07dbd2fc57ee4dc972d2df"
integrity sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==
dependencies:
nanoid "^3.3.6"
picocolors "^1.0.0"
Expand Down Expand Up @@ -331,9 +331,9 @@ regenerator-runtime@^0.13.11:
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

rollup@^3.21.0:
version "3.23.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.23.0.tgz#b8d6146dac4bf058ee817f92820988e9b358b564"
integrity sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==
version "3.24.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.24.0.tgz#865dee1fe0bb528747b59914dfab25e6f480e370"
integrity sha512-OgraHOIg2YpHQTjl0/ymWfFNBEyPucB7lmhXrQUh38qNOegxLapSPFs9sNr0qKR75awW41D93XafoR2QfhBdUQ==
optionalDependencies:
fsevents "~2.3.2"

Expand All @@ -350,25 +350,25 @@ source-map-js@^1.0.2:
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

ts-pattern@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ts-pattern/-/ts-pattern-4.3.0.tgz#7a995b39342f1b00d1507c2d2f3b90ea16e178a6"
integrity sha512-pefrkcd4lmIVR0LA49Imjf9DYLK8vtWhqBPA3Ya1ir8xCW0O2yjL9dsCVvI7pCodLC5q7smNpEtDR2yVulQxOg==
ts-pattern@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ts-pattern/-/ts-pattern-5.0.1.tgz#340d91647982b90ca6c71645ae438f78518e9842"
integrity sha512-ZyNm28Lsg34Co5DS3e9DVyjlX2Y+2exkI4jqTKyU+9/OL6Y2fKOOuL8i+7no71o74C6mVS+UFoP3ekM3iCT1HQ==

typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
typescript@^5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==

use-sync-external-store@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==

vite@^4.3.8:
version "4.3.8"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.8.tgz#70cd6a294ab52d7fb8f37f5bc63d117dd19e9918"
integrity sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==
vite@^4.3.9:
version "4.3.9"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.9.tgz#db896200c0b1aa13b37cdc35c9e99ee2fdd5f96d"
integrity sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==
dependencies:
esbuild "^0.17.5"
postcss "^8.4.23"
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swan-io/chicane",
"version": "1.4.0",
"version": "1.4.1",
"license": "MIT",
"description": "A simple and safe router for React and TypeScript",
"author": "Mathieu Acthernoene <[email protected]>",
Expand Down Expand Up @@ -55,20 +55,20 @@
},
"devDependencies": {
"@testing-library/react": "^12.1.5",
"@types/react": "^17.0.59",
"@types/react": "^17.0.62",
"@types/react-dom": "^17.0.20",
"@types/use-sync-external-store": "^0.0.3",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"eslint": "^8.41.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.43.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^22.0.0",
"jsdom": "^22.1.0",
"microbundle": "^0.15.1",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^5.0.4",
"vitest": "^0.31.1"
"typescript": "^5.1.3",
"vitest": "^0.32.2"
}
}
2 changes: 1 addition & 1 deletion src/createRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
Matcher,
Params,
ParamsArg,
ParsedRoute,
ParseRoute,
ParseRoutes,
ParsedRoute,
PrependBasePath,
Simplify,
} from "./types";
Expand Down
11 changes: 1 addition & 10 deletions src/history.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// This module makes the different routes created with @swan-io/chicane listen to the same history instance
import {
createBrowserHistory,
createMemoryHistory,
createPath,
parsePath,
} from "history";
import { createBrowserHistory, createMemoryHistory, parsePath } from "history";
import * as React from "react";
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
import { areParamsArrayEqual } from "./helpers";
Expand All @@ -26,10 +21,6 @@ export const history = canUseDOM
let currentLocation = decodeLocation(history.location, true);
let initialLocationHasChanged = false;

if (currentLocation.toString() !== createPath(history.location)) {
history.replace(currentLocation.toString()); // URL cleanup
}

history.listen(({ location }) => {
const nextLocation = decodeLocation(location, false);

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { Link } from "./Link";
export { createGroup } from "./createGroup";
export { createRouter } from "./createRouter";
export {
Expand All @@ -7,7 +8,6 @@ export {
subscribeToLocation,
useLocation,
} from "./history";
export { Link } from "./Link";
export { decodeSearch, encodeSearch } from "./search";
export { ServerUrlProvider } from "./server";
export type { Location, Search } from "./types";
Expand Down
2 changes: 1 addition & 1 deletion src/matcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parsePath, Path as HistoryPath } from "history";
import { Path as HistoryPath, parsePath } from "history";
import { isMultipleParam, isNonEmpty, isParam } from "./helpers";
import { encodeSearch } from "./search";
import { Location, Matcher, Params, Search } from "./types";
Expand Down
Loading

0 comments on commit a23b158

Please sign in to comment.