Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add output.hotUpdateMainFilename & output.hotUpdateChunkFilename #3188

Merged
merged 1 commit into from
May 17, 2023

Conversation

underfin
Copy link
Collaborator

@underfin underfin commented May 17, 2023

Related issue (if exists)

close #2169

Summary

馃 Generated by Copilot at 2a725d3

This pull request adds support for configuring the filenames of hot update chunks and the main bundle in the rspack compiler and runtime. It introduces new output options hotUpdateChunkFilename and hotUpdateMainFilename in the core, binding options, and rspack packages, and uses them to generate the hot update filenames dynamically. It also updates the tests, fixtures, and documentation to reflect the new feature.

Walkthrough

馃 Generated by Copilot at 2a725d3

  • Add output.hotUpdateMainFilename and output.hotUpdateChunkFilename options to the rspack core package and document the patch version bump (link)
  • Add two new fields hot_update_main_filename and hot_update_chunk_filename to the Output struct and the RawOutput struct in the core and binding options crates, respectively (link, link, link)
  • Add a new field id to the PathData struct in the core and node binding crates to store the chunk id for the hot update chunk filename template (link, link, link, link)
  • Modify the get_path method of the Output struct to replace the [id], [hash], and [fullhash] placeholders with the corresponding values from the options, the module, or the compilation (link, link)
  • Modify the emit_asset calls in the hmr module of the core crate to use the get_path method to generate the hot update chunk filename and the hot update main filename based on the output options, the chunk data, the runtime spec, and the old hash (link, link)
  • Modify the initialization of the hot_update_main_content_by_runtime map in the hmr module of the core crate to use a new constructor for the HotUpdateContent struct that takes a runtime spec as an argument and stores it in the struct (link)
  • Add a condition to the basic_runtime_requirements module of the plugin runtime crate to check if the output options contain a hash placeholder in the hot update filename templates and add the RuntimeGlobals::GET_FULL_HASH requirement if so (link)
  • Modify the GetMainFilenameRuntimeModule struct and the get_main_filename module of the plugin runtime crate to add two new fields global and filename that store the runtime global and the filename template and use the get_path method to generate the hot update main filename at runtime and replace the placeholders (link, link)
  • Modify the GetChunkUpdateFilenameRuntimeModule struct and the get_chunk_update_filename module of the plugin runtime crate to add a new field chunk that stores the chunk ukey and use the get_path method to generate the hot update chunk filename at runtime and replace the placeholders (link, link, link)
  • Delete the get_chunk_update_filename.js and get_update_manifest_filename.js files from the plugin runtime crate as they are no longer needed after using the get_path method (link, link)
  • Add the hot_update_chunk_filename and hot_update_main_filename fields to the output options in the rspack package.json file, the config adapter, normalization, defaults, schema, and types modules, and the test fixtures and config of the rspack and loader sass packages (link, link, link, link, link, link, link, link, link, link, link, link)

@github-actions github-actions bot added release: feature team The issue/pr is created by the member of Rspack. labels May 17, 2023
@underfin underfin added this pull request to the merge queue May 17, 2023
Merged via the queue into main with commit ab318de May 17, 2023
14 checks passed
@underfin underfin deleted the hotUpdateMainFilename branch May 17, 2023 11:36
@github-actions github-actions bot mentioned this pull request May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report]: HMR module log circular printing
2 participants