-
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
Remove fetcher.type/fetcher.submission #5716
Conversation
🦋 Changeset detectedLatest commit: 04b6ba6 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 |
af955aa
to
ccdb039
Compare
4d3e2e8
to
5719710
Compare
data, | ||
formMethod: formMethod.toUpperCase() as FormMethod, |
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.
Small back-compat layer to preserve the Remix uppercase FormMethod
on useFetcher
9d92955
to
b00a959
Compare
Remove back-compat layer for `useFetcher`/`useFetchers`. This includes a few small breaking changes: | ||
* `fetcher.type` has been removed since it can be derived from other available information | ||
* "Submission" fields have been flattened from `fetcher.submission` down onto the root `fetcher` object, and prefixed with `form` in some cases (`fetcher.submission.action` => `fetcher.formAction`) | ||
* `<fetcher.Form method="get">` is now more accurately categorized as `state:"loading"` instead of `state:"submitting"` to better align with the underlying GET request |
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.
These are technically breaking since they happened in the same API and there's no flag that applied these changes. Is this something small enough we can call it out in the release notes? Or would it be worth a quick v2_fetcher
flag to add this behavior into v1?
We did not have this issue on useTransition
/useNavigation
because it was a new hook introducing the changed behavior.
let fetcher: FetcherStates["Loading"] = { | ||
state, | ||
data, | ||
formMethod: formMethod?.toUpperCase() as FormMethod, |
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.
We still need this back-compat to align to the old uppercase format of formMethod
. Separately we should figure out how to get RR to use uppercase so this can be removed, but that currently would be a breaking change in RR.
b00a959
to
04b6ba6
Compare
v2
once RemoveuseTransition
in favor ofuseNavigation
#5689 is mergedRemoves
fetcher.type
andfetcher.submission
for v2. We still keep a small back-compat layer for now since there's an unintentional mismatch in casing betweenformMethod
on RemixuseFetcher
/useTransition
versus react RouteruseFetcher
/useNavigation