Skip to content

Commit a37ec6c

Browse files
authored
Upgrade MiniOxygen to Miniflare v4 (#2997)
## PR Summary: Upgrade to Miniflare v4 ### Why This PR upgrades the Hydrogen CLI from Miniflare v3 to v4, addressing compatibility issues and improving the development experience. The upgrade was necessary to stay current with Cloudflare's latest tooling and resolve potential security vulnerabilities in older dependencies. ### What Changed **Core Updates:** - Upgraded Miniflare from v3 to v4 across the codebase - Updated related Cloudflare dependencies to maintain compatibility - Refactored the development server implementation to work with Miniflare v4's new API **Test Improvements:** - Fixed flaky test timing issues by replacing fixed delays with proper async polling - Corrected test cleanup patterns to prevent temporary directory accumulation - Improved test reliability and execution speed **Key Benefits:** - Better compatibility with modern Cloudflare Workers features - Improved development server stability - Faster test execution (removed unnecessary 10-second delays) - Cleaner test isolation with proper resource cleanup This is a maintenance update that ensures Hydrogen stays compatible with the latest Cloudflare ecosystem while improving developer experience through more reliable tests.
1 parent 1755eb6 commit a37ec6c

34 files changed

Lines changed: 578 additions & 10652 deletions

.changeset/cows-in-space.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@shopify/mini-oxygen": minor
3+
"@shopify/create-hydrogen": patch
4+
"@shopify/hydrogen-react": patch
5+
"@shopify/cli-hydrogen": patch
6+
"skeleton": patch
7+
---
8+
9+
Upgrade Miniflare from v2 to v4 in mini-oxygen package.
10+
11+
- Internal MiniOxygen API has been refactored to work with Miniflare v4's new architecture.
12+
- Simplified MiniOxygen class - no longer extends MiniflareCore.
13+
- Updated global fetch handling to use Miniflare v4's `outboundService` API.
14+
- Fixed test infrastructure to use project-relative temporary directories.
15+
- Added support for Oxygen compatibility parameters (`compatibilityDate`, `compatibilityFlags`).
16+
- Removed dependency on multiple `@miniflare/*` packages in favor of the consolidated `miniflare` package.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,5 @@ admin.schema.json
141141
business-platform.schema.json
142142

143143
examples/**/*.generated.d.ts
144+
145+
examples/express/build

0 commit comments

Comments
 (0)