Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/start": "^1.0.2",
"@solidjs/testing-library": "^0.8.7",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/start": "^1.0.2",
"@solidjs/testing-library": "^0.8.7",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/start": "^1.0.2",
"@solidjs/testing-library": "^0.8.7",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/start": "^1.0.2",
"@solidjs/testing-library": "^0.8.7",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@sentry/conventions": "^0.16.0"
},
"peerDependencies": {
"@solidjs/router": "^0.13.4 || ^0.14.0 || ^0.15.0",
"@solidjs/router": ">=0.13.4 <2.0.0-0",
Comment thread
cursor[bot] marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The peer dependency for @solidjs/router was updated to include v1.x, but the code using useBeforeLeave is not compatible with the breaking API changes, likely causing runtime errors.
Severity: HIGH

Suggested Fix

Update the implementation in packages/solid/src/solidrouter.ts to be compatible with the breaking changes in @solidjs/router v1.0.0, specifically how the useBeforeLeave event argument is handled. Alternatively, revert the peer dependency range in package.json to exclude v1.x versions.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/solid/package.json#L62

Potential issue: The peer dependency for `@solidjs/router` was updated to allow v1.x,
but the implementation in `packages/solid/src/solidrouter.ts` was not updated to handle
breaking changes. The code uses `useBeforeLeave` and expects the `to` property from the
event argument to be a string-like value. However, v1.0.0 of the router changes `to` to
be a location object. Calling `to.toString()` on this object will likely result in a
runtime error or incorrect behavior during navigation, as the code is not prepared to
handle the new object structure.

Also affects:

  • packages/solidstart/package.json:60~60

Did we get this right? 👍 / 👎 to inform future reviews.

"@tanstack/solid-router": "^1.132.27",
"solid-js": "^1.8.4"
},
Expand All @@ -72,7 +72,7 @@
}
},
"devDependencies": {
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/testing-library": "0.8.5",
"@tanstack/solid-router": "^1.169.2",
"@testing-library/dom": "^7.21.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/solidstart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"access": "public"
},
"peerDependencies": {
"@solidjs/router": "^0.13.4 || ^0.14.0 || ^0.15.0",
"@solidjs/router": ">=0.13.4 <2.0.0-0",
"@solidjs/start": "^1.0.0"
},
"peerDependenciesMeta": {
Expand All @@ -72,7 +72,7 @@
"@sentry/vite-plugin": "^5.3.0"
},
"devDependencies": {
"@solidjs/router": "^0.15.0",
"@solidjs/router": "^1.0.0",
"@solidjs/start": "^1.2.1",
"@solidjs/testing-library": "0.8.5",
"@testing-library/jest-dom": "^6.4.5",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8042,10 +8042,10 @@
resolved "https://registry.yarnpkg.com/@solidjs/meta/-/meta-0.29.4.tgz#28a444db5200d1c9e4e62d8762ea808d3e8beffd"
integrity sha512-zdIWBGpR9zGx1p1bzIPqF5Gs+Ks/BH8R6fWhmUa/dcK1L2rUC8BAcZJzNRYBQv74kScf1TSOs0EY//Vd/I0V8g==

"@solidjs/router@^0.15.0":
version "0.15.4"
resolved "https://registry.yarnpkg.com/@solidjs/router/-/router-0.15.4.tgz#e2b2d797541dcbdc36641e5f610f93ab4fa11c8a"
integrity sha512-WOpgg9a9T638cR+5FGbFi/IV4l2FpmBs1GpIMSPa0Ce9vyJN7Wts+X2PqMf9IYn0zUj2MlSJtm1gp7/HI/n5TQ==
"@solidjs/router@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@solidjs/router/-/router-1.0.0.tgz#9e4e5d6dbdeb725e8e4a9b5a3c7158c39fff096f"
integrity sha512-cCSk1hvgCowiMa9bzzYWHiLu1U4E22+DfJe6/rOwAyECKrxc3jrd5QnoW3sDDJtW+e077cz/M67bPl3DqOBw1Q==

"@solidjs/start@^1.2.1":
version "1.2.1"
Expand Down
Loading