-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Preserve Cloudflare miniflare instance across dev server config restarts #16059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d24cb4a
fix: preserve viteServer.restart wrapper chain for Cloudflare adapter
matthewp e22c943
add changeset
matthewp 6bb9625
fix: use Vite in-place restart for config changes to preserve Cloudfl…
matthewp b0c19c0
use vite.resolveConfig to get a proper ResolvedConfig instead of patc…
matthewp d399579
fix watcher listener accumulation, null-check hot.send, move restartI…
matthewp c9c2182
fix port drift on restart by passing current httpServer port to creat…
matthewp 7b1ae33
remove non-actionable CSP dev warning
matthewp 509528a
Merge branch 'main' into cloudflare-miniflare-restart-fix
matthewp 983df9d
merge main, fix restart tests to use static fixture dir
matthewp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'astro': patch | ||
| --- | ||
|
|
||
| Fixes `Expected 'miniflare' to be defined` errors and 404 responses in dev mode when using the Cloudflare adapter and the config file changes. Instead of creating a brand new Vite server on config changes, Astro now performs a Vite in-place restart, allowing the Cloudflare adapter to reuse its existing miniflare instance across restarts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we lost this, not sure if we want to keep it or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do this intentionally, I thought it was duplicated of the Shiki one but can see that it's not. Doesn't this just always add a warning for all CSP users in dev? @ematipico Can we remove this? Better for docs I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. First, this isn't the only logging we have. There are two instances.
Second, the configuration gets re evaluated at the restart, hence we need to show the logging again.
We already document the limitations. I don't have strong opinions about the logging.
If you want to remove it, you must remove the other logging too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Shiki logging? I think that one makes sense to keep because using Shiki with CSP isn't supported. The user can fix this by not using Shiki.
But in this case the user can't "fix" anything, it's just a warning that they shouldn't expect CSP to work. So there's nothing they can do to get rid of the warning (other than disabling CSP!)
Make sense?