Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.19k stars 241 forks source link

Update Miniflare to fix compatibility with Node 21 #2003

Closed frandiox closed 1 month ago

frandiox commented 1 month ago

Closes https://github.com/Shopify/hydrogen/issues/1833 again, since this fix was reverted in an internal refactor when stabilizing Vite.

Aside from that, Miniflare now respects accept-encoding which means our responses during development can be compressed. This causes issues with our previous implementation so I'm changing the code here to use Node's HTTP instead of fetch.

More info: https://github.com/cloudflare/workers-sdk/pull/5409#issuecomment-2057431634


Update: our tests for sourcemaps started failing with the latest Miniflare version so I've downgraded it to 3.20240304.2, which still fixes the issue with Node 21 but doesn't support encoded responses.

github-actions[bot] commented 1 month ago

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset. If the changes are user-facing and should cause a version bump, run npm run changeset add to track your changes and include them in the next release CHANGELOG. If you are making simple updates to examples or documentation, you do not need to add a changeset.

shopify[bot] commented 1 month ago
Oxygen deployed a preview of your fd-update-miniflare-encoding branch. Details: Storefront Status Preview link Deployment details Last update (UTC)
optimistic-cart-ui ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:22 PM
skeleton ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:23 PM
subscriptions ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:22 PM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:22 PM
vite ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:23 PM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment April 15, 2024 7:22 PM

Learn more about Hydrogen's GitHub integration.