Skip to content
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

Add future.v2_normalizeFormMethod flag #5815

Merged
merged 7 commits into from
Mar 20, 2023

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Mar 15, 2023

Note: CI will fail until we point this to an RR experimental/prerelease version with these changes

Add a future flag to normalize/align useNavigation().formMethod. We want our API to behave like fetch() - it can accept lowercase or uppercase, but exposes the method back to you as a normalized uppercase method:

new Request("/", { method: "post" }).method === "POST" // true
new Request("/", { method: "POST" }).method === "POST" // true

So this means that both <Form method="post"> and <Form method="POST"> should result in useNavigation().formMethod === "POST".

We inadvertently shipped lowercase useNavigation values in RR 6.4, and only noticed the inconsistency when we went to deprecate useTransition in Remix which used uppercase. Therefore, we're putting this behind a future flag to avoid breaking apps, and in Remix v2 we'll move to uppercase as the default.

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2023

🦋 Changeset detected

Latest commit: bb11865

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@remix-run/dev Minor
@remix-run/react Minor
@remix-run/server-runtime Minor
@remix-run/testing Minor
create-remix Minor
@remix-run/css-bundle Minor
@remix-run/cloudflare Minor
@remix-run/deno Minor
@remix-run/node Minor
@remix-run/cloudflare-pages Minor
@remix-run/cloudflare-workers Minor
@remix-run/architect Minor
@remix-run/express Minor
@remix-run/netlify Minor
@remix-run/vercel Minor
@remix-run/serve Minor
remix Minor
@remix-run/eslint-config Minor

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

@MichaelDeBoey MichaelDeBoey force-pushed the brophdawg11/normalize-form-method branch from f0f18d9 to e286bde Compare March 16, 2023 02:30
@brophdawg11 brophdawg11 force-pushed the brophdawg11/normalize-form-method branch from e286bde to 7626db0 Compare March 16, 2023 14:28
@brophdawg11
Copy link
Contributor Author

Cherry-picked the new future flags docs from main into here so I could add the new flag to them

@brophdawg11 brophdawg11 merged commit 0e8f3f0 into dev Mar 20, 2023
@brophdawg11 brophdawg11 deleted the brophdawg11/normalize-form-method branch March 20, 2023 16:14
@github-actions github-actions bot added the awaiting release This issue has been fixed and will be released soon label Mar 20, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-4d86674-20230321 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants