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

chore: Update version for release (pre) #10626

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

github-actions[bot]
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-next, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

release-next is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on release-next.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

[email protected]

Minor Changes

  • Add support for application/json and text/plain encodings for useSubmit/fetcher.submit. To reflect these additional types, useNavigation/useFetcher now also contain navigation.json/navigation.text and fetcher.json/fetcher.text which are getter functions mimicking request.json and request.text. Just as a Request does, if you access one of these methods for the incorrect encoding type, it will throw an Error (i.e. accessing navigation.formData when navigation.formEncType is application/json). (#10413)

    // The default behavior will still serialize as FormData
    function Component() {
      let navigation = useNavigation();
      let submit = useSubmit();
      submit({ key: "value" });
      // navigation.formEncType => "application/x-www-form-urlencoded"
      // navigation.formData    => FormData instance
      // navigation.text        => "key=value"
    }
    
    function action({ request }) {
      // request.headers.get("Content-Type") => "application/x-www-form-urlencoded"
      // request.formData                    => FormData instance
      // request.text                        => "key=value"
    }
    // Opt-into JSON encoding with `encType: "application/json"`
    function Component() {
      let submit = useSubmit();
      submit({ key: "value" }, { encType: "application/json" });
      // navigation.formEncType => "application/json"
      // navigation.json        => { key: "value" }
      // navigation.text        => '{"key":"value"}'
    }
    
    function action({ request }) {
      // request.headers.get("Content-Type") => "application/json"
      // request.json                        => { key: "value" }
      // request.text                        => '{"key":"value"}'
    }
    // Opt-into JSON encoding with `encType: "application/json"`
    function Component() {
      let submit = useSubmit();
      submit("Text submission", { encType: "text/plain" });
      // navigation.formEncType => "text/plain"
      // navigation.text        => "Text submission"
    }
    
    function action({ request }) {
      // request.headers.get("Content-Type") => "text/plain"
      // request.text                        => "Text submission"
    }

Patch Changes

  • When submitting a form from a submitter element, prefer the built-in new FormData(form, submitter) instead of the previous manual approach in modern browsers (those that support the new submitter parameter). For browsers that don't support it, we continue to just append the submit button's entry to the end, and we also add rudimentary support for type="image" buttons. If developers want full spec-compliant support for legacy browsers, they can use the formdata-submitter-polyfill. (#9865)
  • upgrade typescript to 5.1 (#10581)
  • Call window.history.pushState/replaceState before updating React Router state (instead of after) so that window.location matches useLocation during synchronous React 17 rendering. However, generally apps should not be relying on window.location and should always reference useLocation when possible, as window.location will not be in sync 100% of the time (due to popstate events, concurrent mode, etc.) (#10211)
  • Fix tsc --skipLibCheck:false issues on React 17 (#10622)
  • Updated dependencies:

@remix-run/[email protected]

Minor Changes

  • Add support for application/json and text/plain encodings for router.navigate/router.fetch submissions. To leverage these encodings, pass your data in a body parameter and specify the desired formEncType: (#10413)

    // By default, the encoding is "application/x-www-form-urlencoded"
    router.navigate("/", {
      formMethod: "post",
      body: { key: "value" },
    });
    
    function action({ request }) {
      // request.formData => FormData instance with entry [key=value]
      // request.text => "key=value"
    }
    // Pass `formEncType` to opt-into a different encoding
    router.navigate("/", {
      formMethod: "post",
      formEncType: "application/json",
      body: { key: "value" },
    });
    
    function action({ request }) {
      // request.json => { key: "value" }
      // request.text => '{ "key":"value" }'
    }
    router.navigate("/", {
      formMethod: "post",
      formEncType: "text/plain",
      body: "Text submission",
    });
    
    function action({ request }) {
      // request.text => "Text submission"
    }

Patch Changes

  • Fix unstable_useBlocker key issues in StrictMode (#10573)
  • Avoid calling shouldRevalidate for fetchers that have not yet completed a data load (#10623)
  • upgrade typescript to 5.1 (#10581)
  • Strip basename from the location provided to <ScrollRestoration getKey> to match the useLocation behavior (#10550)
  • Call window.history.pushState/replaceState before updating React Router state (instead of after) so that window.location matches useLocation during synchronous React 17 rendering. However, generally apps should not be relying on window.location and should always reference useLocation when possible, as window.location will not be in sync 100% of the time (due to popstate events, concurrent mode, etc.) (#10211)

[email protected]

Patch Changes

  • Fix unstable_useBlocker key issues in StrictMode (#10573)
  • Fix generatePath when passed a numeric 0 value parameter (#10612)
  • upgrade typescript to 5.1 (#10581)
  • Strip basename from locations provided to unstable_useBlocker functions to match useLocation (#10573)
  • Fix tsc --skipLibCheck:false issues on React 17 (#10622)
  • Updated dependencies:

[email protected]

Patch Changes

[email protected]

Patch Changes

@brophdawg11 brophdawg11 merged commit 8b95f2b into release-next Jun 21, 2023
@brophdawg11 brophdawg11 deleted the changeset-release/release-next branch June 21, 2023 16:08
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.

1 participant