-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat(remix-dev): add warning when future.v2_routeConvention
is not enabled
#5606
Conversation
🦋 Changeset detectedLatest commit: 47a9ace The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 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 |
82b723e
to
b75bc13
Compare
… enabled Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: update warning test: update test to include v2_routeConvention error message Signed-off-by: Logan McAnsh <logan@mcan.sh> update warning Signed-off-by: Logan McAnsh <logan@mcan.sh>
b75bc13
to
d9a0228
Compare
… the warning ending up in stderr Signed-off-by: Logan McAnsh <logan@mcan.sh>
b972de8
to
d9b9049
Compare
future.v2_routeConvention
is not enabledfuture.v2_routeConvention
is not enabled
packages/remix-dev/config.ts
Outdated
@@ -727,3 +732,4 @@ let listFormat = new Intl.ListFormat("en", { | |||
}); | |||
|
|||
export let serverBuildTargetWarning = `The "serverBuildTarget" config option is deprecated. Use a combination of "publicPath", "serverBuildPath", "serverConditions", "serverDependenciesToBundle", "serverMainFields", "serverMinify", "serverModuleFormat" and/or "serverPlatform" instead.`; | |||
export let flatRoutesWarning = `The old route convention has been deprecated in favor of "flat routes". Please enable it via your remix.config https://remix.run/docs/en/main/file-conventions/route-files-v2`; |
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.
Should we prefix this with `
export let flatRoutesWarning = `The old route convention has been deprecated in favor of "flat routes". Please enable it via your remix.config https://remix.run/docs/en/main/file-conventions/route-files-v2`; | |
export let flatRoutesWarning = `⚠️ DEPRECATED: The old nested folders route convention has been deprecated in favor of "flat routes. Please enable the new routing convention via the \`future.v2_routeConvention\` flag in your \`remix.config.js\` file. For more information, please see https://remix.run/docs/en/main/file-conventions/route-files-v2.`; |
Eventually I'd love to see it in yellow via chalk
or something but I know we have future CLI improvements in the pipeline so probably worth waiting for that before doing anything too wild.
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.
I wonder if we should also make sure we have a section in the new docs on "here's how to continue using the old nested folders version via defineRoutes
"
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.
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.
Eventually I'd love to see it in yellow via chalk or something but I know we have future CLI improvements in the pipeline so probably worth waiting for that before doing anything too wild.
we can do this if we either make all warnOnce
uses yellow or an arg passed to it
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.
all uses of warnOnce
could benefit from being yellow imo
- sessions not being signed
- cookies have expires setup
- flat routes v2
- serverBuildTarget
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
🤖 Hello there, We just published version Thanks! |
for some reason adding the warning is causing the HMR tests to fail 🤔 https://github.com/remix-run/remix/actions/runs/4317024896/jobs/7533572210edit: it was checking stderr length and the warning goes to stderr 🤦♂️
Closes: #
Testing Strategy: