Skip to content

Commit

Permalink
Use Workerd for local development (#1184)
Browse files Browse the repository at this point in the history
* Apply multiple log replacers instead of only the first match

* Basic workerd integration

* Cleanup logs

* Add Oxygen headers to request

* Setup basic inspector connection

* Full parity with MiniOxygen logging

* Fix MiniOxygen entry worker

* Fix log replacer

* Only serve known assets

* Find nearest free port

* Find port for inspector

* Use waitUntil for logger. Minor refactor

* Restore integrity in package-lock for turbo and ast-grep

* Update miniflare

* Do not show undefined cause in errors

* Move workerd logic

* Restore MiniOxygen v1

* Restore logs for MiniOxygen

* Fix port after merge

* Move mini-oxygen v2 logic

* Unify API

* Toggle between node and worker with a CLI flag

* Use Oxygen headers in Node

* Fix package-lock for turbo and ast-grep

* Fix package-lock for typescript

* Use mime lookup from cli-kit

* Extract oxygen headers logic

* Add notice about debug-network support

* Rename native-unstable flag to worker-unstable

* Filter out non-actionable warnings and errors

* Stream files

* Load remote env vars in preview command

* Avoid cloning requests

* Use sets to find asset matches

* Update Miniflare version

* Changesets

* Hide the unsupported debug-network line for worker runtime

* Update Miniflare version to drop subdependencies
  • Loading branch information
frandiox committed Sep 20, 2023
1 parent 3eea40d commit e62a4db
Show file tree
Hide file tree
Showing 17 changed files with 2,955 additions and 1,959 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-weeks-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/cli-hydrogen': patch
---

Adjust behavior of `h2 preview` command around environment variables to be more consistent with `h2 dev` command.
5 changes: 5 additions & 0 deletions .changeset/silver-bikes-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

The `error.cause` property throw from the Storefront client is now stringified.
5 changes: 5 additions & 0 deletions .changeset/warm-terms-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/cli-hydrogen': minor
---

Add `--worker-unstable` flag to `h2 dev` and `h2 preview` commands. This flag enables the use of the new experimental worker runtime for local development, which is closer to Oxygen production than the current Node.js sandbox. Please report any issues you encounter with this flag.
Loading

0 comments on commit e62a4db

Please sign in to comment.