Skip to content

v0.0.61

Choose a tag to compare

@justinvdm justinvdm released this 16 Apr 04:22
· 1546 commits to main since this release

❗️ Breaking Change: React upgraded to latest canary

We've upgraded our React version to the latest canary release. You'll need to update your React dependencies as follows:

{
  "react": "canary",
  "react-dom": "canary",
  "react-server-dom-webpack": "canary"
}

Be sure to run:

pnpm install

(or yarn / npm install) after updating.

📝 Changes to Starters

A change to <Document>

tl;dr We've made a backwards-compatible change to improve hydration timing and reduce complexity. You might want to update your Document components to match the changes in the starters.


🧠 Previously:

Starters used this structure, relying on a module script:

<html>
  <head>
    ...
    <script type="module" src="/src/client.tsx"></script>
  </head>
  <body>
    <div id="root">{children}</div>
  </body>
</html>

While this works in many cases, module scripts are deferred by browsers until the entire HTML document is fully parsed --- including after all Suspense boundaries resolve. This led to delayed hydration and a noticeable lack of interactivity in streamed responses.


✅ Now:

We've changed the starters to preload the script early and execute it at the end of as a classic script:

<html>
  <head>
    ...
    <link rel="preload" href="/src/client.tsx" as="script" />
  </head>
  <body>
    <div id="root">{children}</div>
    <script src="/src/client.tsx"></script>
  </body>
</html>

This setup:

  • Starts downloading the client script early via <link rel="preload">

  • Ensures hydration begins as soon as possible (as soon as #root is available)

  • Avoids the deferral behaviour of <script type="module">

  • Works seamlessly with streamed RSC and Suspense

  • Removes the need for inline scripts (helping with CSP policies)

Updated release script for deployments

We've updated the release script in all starters to improve deployment safety and reduce manual setup.

Previously, some setups could result in dev-mode builds affecting production asset output. The new script fixes this.

In your own package.json, we recommend updating your release script to:

"release": "rw-scripts ensure-deploy-env && npm run clean && prisma generate && RWSDK_DEPLOY=1 npm run build && wrangler deploy"

What's Changed

Full Changelog: v0.0.60...v0.0.61