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

chore: 馃 refactor before resolve #3036

Merged
merged 5 commits into from
May 6, 2023
Merged

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented May 6, 2023

Related issue (if exists)

Summary

馃 Generated by Copilot at 5eaae0f

This pull request improves the performance and flexibility of the NormalModuleFactory and ContextModuleFactory classes by reducing unnecessary cloning and allowing plugins to abort or customize module resolution. It changes the signatures and implementations of some hooks and methods in rspack_core and node_binding crates, and adds a new hook in rspack package.

Walkthrough

馃 Generated by Copilot at 5eaae0f

  • Reduce memory allocation and cloning by using references and lifetimes for NormalModuleBeforeResolveArgs (link, link, link, link, link)
  • Add afterResolve hook to NormalModuleFactory in TypeScript to allow plugins to modify or reject resolved modules (link, link)
  • Return MissingModule if before_resolve hook returns false in Rust to prevent the resolution of certain modules (link, link, link)

@changeset-bot
Copy link

changeset-bot bot commented May 6, 2023

鈿狅笍 No Changeset found

Latest commit: 1aed812

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label May 6, 2023
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review May 6, 2023 10:09
@IWANABETHATGUY IWANABETHATGUY added this pull request to the merge queue May 6, 2023
Merged via the queue into main with commit 7e10306 May 6, 2023
10 checks passed
@IWANABETHATGUY IWANABETHATGUY deleted the refactor/before_resolve branch May 6, 2023 10:46
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.

None yet

2 participants