-
[Breaking change] by @wizardlyhel
Support worker compatibility date that aligns with SFAPI release.
Starting from this major version, on each deploy to Oxygen, Hydrogen will be on Cloudflare worker compatibility date
2024-10-01
. Onwards, Hydrogen will update worker compatibility date on every SFAPI release.There is no specific project update that needs to be done in order to get this feature. However, please ensure your project is working properly in an Oxygen deployment when updating to this Hydrogen version. (#2380)
-
Prevent infinite redirects when a double slash exists in the URL (#2449) by @blittle
-
Add oxygen-buyer-postal-code and oxygen-buyer-metro-code headers (#2429) by @jgodson
- Security updates (#2263) by @dependabot
-
Update server in development when entry point (
<root>/server.js
) changes. (#2153) by @frandiox -
Improve errors when a CJS dependency needs to be added to Vite's ssr.optimizeDeps.include. (#2106) by @frandiox
-
Fix issue where
undici
dependency couldn't be found in some situations. (#2065) by @frandiox -
Fix HMR when changing files imported into routes. (#2077) by @frandiox
-
The default runtime exported from
@shopify/mini-oxygen
is now based on workerd. (#1891) by @frandioxThe previous Node.js sandbox runtime has been moved to the
@shopify/mini-oxygen/node
export.Example usage:
import {createMiniOxygen} from '@shopify/mini-oxygen'; const miniOxygen = createMiniOxygen({ workers: [ { name: 'main', modules: true, script: `export default { async fetch() { const response = await fetch("https://hydrogen.shopify.dev"); return response; } }`, }, ], }); const response = await miniOxygen.dispatchFetch('http://placeholder'); console.log(await response.text()); await miniOxygen.dispose();
- Export new Vite plugin from
@shopify/mini-oxygen/vite
. It integrates Vite with MiniOxygen by running the application code within a worker. (#1935) by @frandiox
-
Update all Node.js dependencies to version 18. (Not a breaking change, since Node.js 18 is already required by Remix v2.) (#1543) by @michenly
-
Fix how peer dependencies are resolved. (#1489) by @frandiox
- 8863d40: Update @types/connect from 3.4.35 to 3.4.36
- fc405c0: Fix error stack traces when using
script
option. The sourcemap for the script is loaded using the path passed inworkerFile
. - df9af93: Add
request-id
header to requests like in Oxygen production.
- 11a5d6c: - Add a
globalFetch
option to allow for custom fetch implementations.- Allow returning responses from the
onRequest
hook to intercept requests. This allows for custom handling of requests in a Node.js environment without going into the app sandbox. When returning a response fromonRequest
, theonResponse
hook will not be called. - Pass a
defaultDispatcher
function as the second parameter to theonRequest
hook. Calling this function will dispatch the request to the app sandbox as usual and return the response within the context of the hook. This is useful to wrap each request handling in AsyncLocalStorage.
- Allow returning responses from the
- defd46c: Update @miniflare/* from 2.14.0 to 2.14.1
- 6e55835: Update vitest from 0.34.2 to 0.34.3
- caf5b81: Update typescript from 5.1.6 to 5.2.2
- bf27739: Update @miniflare/cache from 2.14.0 to 2.14.1
- e8b1e07: Update eslint from 8.47.0 to 8.48.0
- 600fa5f: Update @types/source-map-support from 0.5.6 to 0.5.7
- 1a2e508: When the port provided is not available, use the next available port instead of a random one.
- 189af3d: Update eslint-config-prettier from 8.10.0 to 9.0.0
- 9683ef6: Update @shopify/eslint-plugin from 42.1.0 to 43.0.0
- 907b6f2: Add the nonce found in response headers to the auto-reload script.
- c8fa291: move typescript to devDependencies
- 21481d0: Update inquirer from 9.2.9 to 9.2.10
- 9eba0a6: Update eslint from 8.46.0 to 8.47.0
- 9da7e5c: Update prettier from 3.0.1 to 3.0.2
- 86c1273: Update vitest from 0.34.1 to 0.34.2
- 8ac4d8f: Avoid server crash on unhandled promises.
- e174b07: Update vitest from 0.33.0 to 0.34.1
- ba984f0: Update eslint-config-prettier from 8.9.0 to 8.10.0
- 9e3e87b: Update prettier from 3.0.0 to 3.0.1
- 151daa6: Add a new
script
option as an alternative toworkerFile
. This option is used to pass the worker code directly instead of a file path. Thereload
methods also supportsscript
to manually reload the worker code. ExposeMiniOxygenOptions
type. - c23dcbe: Expose the internal
createMiniOxygen
function to create a MiniOxygen instance without starting a server. The functionstartServer
has not changed.
- 4ab2a98: Update eslint-config-prettier from 8.8.0 to 8.9.0
- d9cb363: Update inquirer from 9.2.8 to 9.2.9
- d86b580: Update eslint from 8.45.0 to 8.46.0
- 33dc296: - Mini Oxygen can no longer be used in a standalone fashion
- It is now built as ESM module
- Support for the JSON based configuration file is dropped and as such the
oxygen-gen-config
command no longer exists - The
preview
function has been renamed tostartServer
startServer
is now a named export
- Add reload method that sets new env vars and reloads Miniflare.
- 8572625: Add compatability date to match production version of Oxygen
- Change minioxygen's events route to avoid conflicts with actual routes. (PR)
- Dependency updates
- Re add hooks that were accidently removed. (PR)
- Added ability to set oxygen headers along with default values for them (PR)
- Allows mini-oxygen to proxy requests to a HTTP proxy server. (PR)
- 0530ad2: Downgrade get-port to a non esm version
-
c6b07bd: The
ui
object is deprecated in favor of a singlelog
function. The deprecated object had one accepted method,say
, that handled logging, so this change simplifies the interface.The
ui.say
was a relic from the first version of the Hydrogen CLI package (now removed in favor of the Shopify CLI) and we no longer need to abide by the restrictions imposed by that dependent package.
- b7a00c2: - Enables streams constructor compatibility.
- Upgrades Miniflare dependencies to 2.8.2.