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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose added/removed compilation.*_dependencies to js side #7522

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Aug 9, 2024

Summary

Currently we can only get all of *_dependencies in both js and rust compilation which will make HMR renew watcher very slow. #7490

This PR will

  1. Add a new struct incremental_info to collect files added and removed during rebuild.
  2. Update compilation.*_dependencies in rust side to expose all file, added file, removed file.
struct Compilation {
  pub fn file_dependencies(
      &self,
    ) -> (
      // all files
      impl Iterator<Item = &PathBuf>,
      // added file
      impl Iterator<Item = &PathBuf>,
      // removed file
      impl Iterator<Item = &PathBuf>,
    ) { ... }
}
  1. Merge node binding get_*_dependencies method to dependenciesDTO. And you can access them by
// include added file in make stage and FileDependencies added by plugin
compilation.#inner.dependencies().addedFileDependencies
// only include removed file in make stage
compilation.#inner.dependencies().removedFileDependencies

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Aug 9, 2024
Copy link

netlify bot commented Aug 9, 2024

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 7e7de1a
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66b624487c16a900073f55da
😎 Deploy Preview https://deploy-preview-7522--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jerrykingxyz jerrykingxyz requested a review from SyMind August 9, 2024 14:33
@jerrykingxyz jerrykingxyz enabled auto-merge (squash) August 9, 2024 14:35
@jerrykingxyz jerrykingxyz merged commit 3867fe0 into main Aug 9, 2024
34 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/dependencies branch August 9, 2024 16:30
@escaton
Copy link
Contributor

escaton commented Aug 12, 2024

Wow, that was fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants