Fix HMR for action files during development#16932
Conversation
🦋 Changeset detectedLatest commit: 3a5bc27 The changes in this PR will be included in the next version bump. This PR includes changesets to release 398 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will improve performance by 37.93%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | Rendering: streaming [false], .md file |
1.7 ms | 1.2 ms | +37.93% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fkatsuhiro:fix/actions-hmr-invalidate (3a5bc27) with main (dc45246)1
Footnotes
ematipico
left a comment
There was a problem hiding this comment.
The clearing of the actions is correct, but it shouldn't happen in prroduction
| /** | ||
| * Clears the cached actions so they are re-resolved on the next request. | ||
| * Called via HMR when action files change. | ||
| */ | ||
| clearActions(): void { | ||
| this.pipeline.clearActions(); | ||
| } |
There was a problem hiding this comment.
This something that shouldn't happen in production. Clearing actions in production is incorrect.
There was a problem hiding this comment.
I understood. That's make sense. Let me update it. Thank you.
There was a problem hiding this comment.
I've updated this.
Moved clearActions() from Pipeline to NonRunnablePipeline and RunnablePipeline to ensure it isn't used in the production environment.
8f52610 to
052731d
Compare
dbbbc4e to
4cfc87d
Compare
4cfc87d to
3a5bc27
Compare
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`7.0.2` → `7.0.3`](https://renovatebot.com/diffs/npm/astro/7.0.2/7.0.3) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v7.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#703) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.2...astro@7.0.3) ##### Patch Changes - [#​17189](withastro/astro#17189) [`24d2c9e`](withastro/astro@24d2c9e) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where an error thrown inside one route's `getStaticPaths()` would prevent other valid routes from being matched in dev mode - [#​16932](withastro/astro#16932) [`8f4a3db`](withastro/astro@8f4a3db) Thanks [@​fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes HMR for action files during development. Editing files in `src/actions/` now takes effect on the next request without requiring a dev server restart. - [#​17087](withastro/astro#17087) [`fb0ab02`](withastro/astro@fb0ab02) Thanks [@​jp-knj](https://github.com/jp-knj)! - Fixes localized custom error pages in i18n projects so routes like `/pt/404` are used for missing localized pages and return the correct status code </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMzQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI0Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This PR fix ci error which cause type error from #16929
-------- Following content is cloned from #16929 --------
Changes
clearActions()method to dev-specific pipelines (RunnablePipeline and NonRunnablePipeline) to reset the cached resolved actions, matching the existingclearMiddleware()pattern while ensuring production paths remain completely untouched.Testing
Docs
Closes #16913