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) #9057

Merged

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-v6.4.0-pre.9, this PR will be updated.

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

release-v6.4.0-pre.9 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-v6.4.0-pre.9.

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

Releases

[email protected]

Patch Changes

  • d5b2560: Feat: adds deferred support to data routers

    Returning a deferred from a loader allows you to separate critical loader data that you want to wait for prior to rendering the destination page from non-critical data that you are OK to show a spinner for until it loads.

    // In your route loader, return a deferred() and choose per-key whether to
    // await the promise or not.  As soon as the awaited promises resolve, the
    // page will be rendered.
    function loader() {
      return deferred({
        critical: await getCriticalData(),
        lazy1: getLazyData(),
      });
    };
    
    // In your route element, grab the values from useLoaderData and render them
    // with <Deferred>
    function DeferredPage() {
      let data = useLoaderData();
      return (
        <>
          <p>Critical Data: {data.critical}</p>
          <Deferred
            value={data.lazy}
            fallback={<p>Loading...</p>}
            errorElement={<RenderDeferredError />}>
            <RenderDeferredData />
          </Deferred>
        </>
      );
    }
    
    // Use separate components to render the data once it resolves, and access it
    // via the useDeferredData hook
    function RenderDeferredData() {
      let data = useDeferredData();
      return <p>Lazy: {data}</p>;
    }
    
    function RenderDeferredError() {
      let data = useRouteError();
      return <p>Error! {data.message} {data.stack}</p>;
    }

    If you want to skip the separate components, you can use the Render Props
    pattern and handle the rendering of the deferred data inline:

    function DeferredPage() {
      let data = useLoaderData();
      return (
        <>
          <p>Critical Data: {data.critical}</p>
          <Deferred value={data.lazy} fallback={<p>Loading...</p>}>
            {data => <p>{data}</p>}
          </Deferred>
        </>
      );
    }
  • d68d03e: feat: add basename support for data routers

  • 3e7e502: fix: Fix trailing slash behavior on pathless routing when using a basename ([Bug]: useSearchParams hook removes path name from url #9045)

  • Updated dependencies [8ed30d3]

  • Updated dependencies [d5b2560]

  • Updated dependencies [d68d03e]

  • Updated dependencies [b7fadce]

  • Updated dependencies [3e7e502]

[email protected]

Patch Changes

[email protected]

Patch Changes

[email protected]

Patch Changes

@remix-run/[email protected]

Patch Changes

  • 8ed30d3: fix: Handle fetcher 404s as normal boundary errors

  • d5b2560: Feat: adds deferred support to data routers

    Returning a deferred from a loader allows you to separate critical loader data that you want to wait for prior to rendering the destination page from non-critical data that you are OK to show a spinner for until it loads.

    // In your route loader, return a deferred() and choose per-key whether to
    // await the promise or not.  As soon as the awaited promises resolve, the
    // page will be rendered.
    function loader() {
      return deferred({
        critical: await getCriticalData(),
        lazy1: getLazyData(),
      });
    };
    
    // In your route element, grab the values from useLoaderData and render them
    // with <Deferred>
    function DeferredPage() {
      let data = useLoaderData();
      return (
        <>
          <p>Critical Data: {data.critical}</p>
          <Deferred
            value={data.lazy}
            fallback={<p>Loading...</p>}
            errorElement={<RenderDeferredError />}>
            <RenderDeferredData />
          </Deferred>
        </>
      );
    }
    
    // Use separate components to render the data once it resolves, and access it
    // via the useDeferredData hook
    function RenderDeferredData() {
      let data = useDeferredData();
      return <p>Lazy: {data}</p>;
    }
    
    function RenderDeferredError() {
      let data = useRouteError();
      return <p>Error! {data.message} {data.stack}</p>;
    }

    If you want to skip the separate components, you can use the Render Props
    pattern and handle the rendering of the deferred data inline:

    function DeferredPage() {
      let data = useLoaderData();
      return (
        <>
          <p>Critical Data: {data.critical}</p>
          <Deferred value={data.lazy} fallback={<p>Loading...</p>}>
            {data => <p>{data}</p>}
          </Deferred>
        </>
      );
    }
  • d68d03e: feat: add basename support for data routers

  • b7fadce: ci: simplify dist/ directory for CJS/ESM only

  • 3e7e502: fix: Fix trailing slash behavior on pathless routing when using a basename ([Bug]: useSearchParams hook removes path name from url #9045)

@brophdawg11 brophdawg11 merged commit fe54e3d into release-v6.4.0-pre.9 Jul 14, 2022
@brophdawg11 brophdawg11 deleted the changeset-release/release-v6.4.0-pre.9 branch July 14, 2022 13:17
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