-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type-safe href (#12994) #13012
Type-safe href (#12994) #13012
Conversation
* wip: type-safe href * consistent params parsing + type generation * href tests * href typegen tests * href types normalize route full path * fix `react-router --version` The `--version` flag reads the local `package.json` at `../package.json`. While this path is correct when running from source, it is incorrect after the CLI is built since `package.json` stays at the root of the package, but the built code gets nested into `dist/`. I only noticed this discrepancy because I was converting the unit tests to integration tests to fix an incompatibility issue with Node v22.14 and `esbuild-register`.
🦋 Changeset detectedLatest commit: b86e8c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -0,0 +1,174 @@ | |||
import { spawnSync } from "node:child_process"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 Awesome to have tests for this now!
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
I haven’t looked too much into the code here, but I’m curious if it would be possible to utilize this feature in library mode (I’m fine doing some custom wiring on our end). Any recommendations would be much appreciated. |
🤖 Hello there, We just published version Thanks! |
@pcattori any suggestions if this could be in library mode?
|
@skovhus all new type-safety features assume you are using That said, you can already build a SPA in framework mode today, so if you really want those type features but don't want SSR and all the other stuff, then SPA mode is probably your best bet. |
@pcattori Thanks for the response. We have currently rolled our own system on top of library mode, but I do like the features you are baking into framework mode. I’m really curious if |
@skovhus that's probably a better question for our Discord |
wip: type-safe href
consistent params parsing + type generation
href tests
href typegen tests
href types normalize route full path
fix
react-router --version
The
--version
flag reads the localpackage.json
at../package.json
. While this path is correct when running from source, it is incorrect after the CLI is built sincepackage.json
stays at the root of the package, but the built code gets nested intodist/
.I only noticed this discrepancy because I was converting the unit tests to integration tests to fix an incompatibility issue with Node v22.14 and
esbuild-register
.