-
-
Notifications
You must be signed in to change notification settings - Fork 190
refactor: hmr #2222
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
base: main
Are you sure you want to change the base?
refactor: hmr #2222
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: ignore print fileSize in compile config file * fix: ignore print fileSize in compile config file
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fix: delete the map file when config is 'inilne' or 'all-inline'
* feat: resolver by resolve kind (#2154) * feat: resolver by resolve kind * fix: breaking change * Version Packages (#2156) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: try fix ci linux gnu build (#2163) * fix: resolve the relative path of projects (#2161) * fix: resolve the relative path of projects * Create js-plugin-sass.md add changeset --------- Co-authored-by: brightwu <1521488775@qq.com> * Version Packages (#2164) * Version Packages * chore: remove ubuntu-20 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: brightwu <1521488775@qq.com> * fix: tree shake issue when handling cross module top level variables … (#2166) fix: tree shake issue when handling cross module top level variables writing * Version Packages (#2167) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: handle Windows long path issue in base64_decode function (#2182) * fix: handle Windows long path issue in base64_decode function - Replace unwrap() with proper error handling in base64_decode - Return safe string representation when base64 decode fails - Fixes InvalidLength panic on Windows with long file paths - Addresses issue where Farm crashes on Windows due to path length limits * fix: address CoderabbitAI feedback - use decoded bytes for UTF-8 conversion - Use decoded bytes instead of original input for UTF-8 lossy conversion - This ensures we process the actual decoded data when UTF-8 conversion fails - Addresses AI review feedback for more accurate error handling --------- Co-authored-by: q1600822305 <q1600822305@noreply.gitcode.com> * chore: resolve typo (#2185) Co-authored-by: leo.kang <leo.kang@gooseott.com> * fix(core): Add origin check to the HMR server (#2173) * Add origin check to the HMR server * Add type declarations * Update ws.ts * Add changeset * Update changeset * Fox format and use American English * Fix format * Fix format for real this time * Hopefully for the last time, fix format * Remove trailing spaces from some lines --------- Co-authored-by: ADNY <66500121+ErKeLost@users.noreply.github.com> Co-authored-by: brightwu <1521488775@qq.com> * chore: update readme (#2187) * chore: update readme * fix: lint issue * chore: test hmr host check (#2190) * chore: test hmr host check * fix: #2188 lazy compilation should respect publicPath * fix: #2176 does not work * fix: hmr origin check * fix: hmr issue * Version Packages (#2186) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: incorrect publicPath when isolating farm runtime (#2193) * fix: incorrect publicPath when isolating farm runtime * chore: lock cargo-xwin to 0.18.6 * fix: resolve extension compatible with . or direct file suffix (#2192) * fix: resolve extension compatible with . or direct file suffix * fix: resolve extension compatible with . or direct file suffix * chore: update test --------- Co-authored-by: brightwu <1521488775@qq.com> * Version Packages (#2194) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: browser mode, resolve mainFiled without import kind (#2197) * feat: browser mode, resolve mainFiled without import kind * chore: add changefile * Version Packages (#2198) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: support output.asciiOnly (#2200) * chore: support output.asciiOnly * fix: escape css unicode by padding 6 hex digits * Version Packages (#2201) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: fully support concatenate modules * chore: update test snapshot * chore: fully support mangle exports * feat: support library cjs * feat: all rust test cases passed * chore: all existing tests passed * chore: add js plugins hooks tests * fix: cjs require * chore: all existing test cases passed * fix: windows test * fix: mangle exports panic * fix: argo pro concatenate modules issue * fix: clippy issue --------- Co-authored-by: shulan <sshuang141@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: xiaoliyooo <73976311+18845778092@users.noreply.github.com> Co-authored-by: 1600822305 <161661698+1600822305@users.noreply.github.com> Co-authored-by: q1600822305 <q1600822305@noreply.gitcode.com> Co-authored-by: 小康 <leokang2828@gmail.com> Co-authored-by: leo.kang <leo.kang@gooseott.com> Co-authored-by: Radman Siddiki <61620631+R4356th@users.noreply.github.com> Co-authored-by: ADNY <66500121+ErKeLost@users.noreply.github.com> Co-authored-by: wumingliang <wumingliang.9801@bytedance.com>
* feat: upgrade swc and rkyv * fix: concatenate modules issues * chore: update test snapshots * fix: ci build * chore: update napi-rs/cli of create farm pacakge * fix: ci issues * fix: ci issues * fix: build without config file * chore: all example build success --------- Co-authored-by: wumingliang <wumingliang.9801@bytedance.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: concatenate module issues * chore: remove setup zig * chore: replace zig setup action * fix: tree shake useless ident * fix: reexport ident map are not removed when tree shaking * fix: mangle exports issue * fix: example build error --------- Co-authored-by: wumingliang <wumingliang.9801@bytedance.com>
* feat: support ast merge sourcemap generation * chore(refactor): custom moudle meta data * chore: stash code * chore: bundle adapting ast merge * feat: bundle support merge sourceMap & comment * fix: type issue * chore: stash code * feat: support dynamic input * feat: refactor runtime * chore: stash code * chore: support dynamic entries bundle * chore: support generate dynamic entry resource pots * feat: full support dynamic entry * chore: stash code * chore: stash code * chore: script entry example test passed * feat: arco pro dev available * feat: cache module metadata & cachable deserialize * feat: improve cache api * feat: write cache * feat: combine cache item to files * feat: conflict & clippy * chore: stash code * feat: stash code * feat: use matedate api for plugin * feat: improve matedata * feat: improve cache write * chore: remove not exists dependent * feat: remove unnecessary code * feat: optimize deserialize usage * chore: ci pnpm version unified version * fix: cspell & mangle_export test case fix * fix: lint --------- Co-authored-by: brightwu <1521488775@qq.com> Co-authored-by: 苏向夜 <46275354+fu050409@users.noreply.github.com> Co-authored-by: wumingliang <wumingliang.9801@bytedance.com>
* fix: windows ts test issue * fix: plugin resolvePath normalize * fix: windows example build * fix: windows example build * fix: publicPath * fix: e2e test issues * fix: tests --------- Co-authored-by: wumingliang <wumingliang.9801@bytedance.com>
fix cache restore dead lock
🦋 Changeset detectedLatest commit: 9835a25 The changes in this PR will be included in the next version bump. 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 💥 An error occurred when fetching the changed packages and changesets in this PR |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
be2db7a to
60fadbd
Compare
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.
Pull Request Overview
This PR refactors the HMR (Hot Module Replacement) system by breaking down the monolithic HmrEngine class into specialized components for better separation of concerns.
- Splits HMR functionality into coordinator, broadcaster, and error handler components
- Introduces an update queue system with priority and deduplication support
- Improves error handling and retry mechanisms for HMR operations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/server/index.ts | Reorders HMR engine initialization to occur after websocket server setup |
| packages/core/src/server/hmr/updateQueue.ts | Adds new update queue management with batching and priority support |
| packages/core/src/server/hmr/index.ts | Provides exports for the new HMR module components |
| packages/core/src/server/hmr/hmrErrorHandler.ts | Implements centralized error handling with retry logic and error history |
| packages/core/src/server/hmr/hmrCoordinator.ts | Coordinates HMR update process with queue management and compilation |
| packages/core/src/server/hmr/hmrBroadcaster.ts | Handles broadcasting update messages to WebSocket clients |
| packages/core/src/server/hmr-engine.ts | Refactored to use the new component-based architecture |
| .changeset/spicy-kings-shave.md | Adds changeset entry for the HMR refactoring |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
60fadbd to
53288f9
Compare
53288f9 to
9835a25
Compare
Description:
refactor: hmr
BREAKING CHANGE:
None
Related issue (if exists):
None