-
-
Notifications
You must be signed in to change notification settings - Fork 198
fix(fileCodeBlock): should support hmr #2423
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
Conversation
✅ Deploy Preview for rspress ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 adds Hot Module Replacement (HMR) support for file code blocks by enabling dependency tracking when external files are imported into markdown/MDX content. This ensures that changes to imported files trigger rebuilds during development.
- Added
addDependencyparameter to the file code block processing pipeline - Modified the remark plugin to track file dependencies for HMR
- Updated the MDX loader to pass the dependency tracking function through the processing chain
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/node/mdx/remarkPlugins/fileCodeBlock.ts | Added dependency tracking when reading external files for code blocks |
| packages/core/src/node/mdx/processor.ts | Updated compile function to accept and pass through addDependency parameter |
| packages/core/src/node/mdx/options.ts | Modified createMDXOptions to accept and forward addDependency to remark plugins |
| packages/core/src/node/mdx/loader.ts | Added addDependency from loader context to the compile options |

Summary
fix(fileCodeBlock): should support hmr
Related Issue
Checklist