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: support contextModuleFactory beforeResolve hook #6420

Merged
merged 14 commits into from May 10, 2024

Conversation

SyMind
Copy link
Member

@SyMind SyMind commented Apr 30, 2024

Summary

Close #6373

We should implement the following hooks:

  1. ContextModuleFactory.beforeResolve
  2. ContextModuleFactory.afterResolve

Implementing all the parameters supported by the hooks is very challenging, so for this iteration, we will only implement the following parameters:

type ContextModuleFactoryBeforeResolveResult =
	| false
	| {
			context: string;
			request?: string;
	  };
type ContextModuleFactoryAfterResolveResult =
	| false
	| {
			resource: string;
			context: string;
			request: string;
			regExp?: RegExp;
			// TODO: Dependencies are not fully supported yet; this is a placeholder to prevent errors in moment-locales-webpack-plugin.
			dependencies: Array<any>;
	  };

Checklist

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

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Apr 30, 2024
Copy link

netlify bot commented Apr 30, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 9ea9ff3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/663dafdd41791c0008a29491

@SyMind SyMind force-pushed the moment-locales-webpack-plugin branch from 7ea5bec to c693c7a Compare May 9, 2024 09:35
@SyMind SyMind marked this pull request as ready for review May 9, 2024 13:16
@SyMind SyMind force-pushed the moment-locales-webpack-plugin branch from 0d3cfe2 to 390745f Compare May 9, 2024 13:24
@SyMind
Copy link
Member Author

SyMind commented May 10, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented May 10, 2024

📝 Benchmark detail: Open

Name Base (2024-05-10 73c31ab) Current Change
10000_development-mode + exec 2.71 s ± 21 ms 2.73 s ± 26 ms +0.59 %
10000_development-mode_hmr + exec 697 ms ± 5.2 ms 701 ms ± 3.5 ms +0.63 %
10000_production-mode + exec 2.51 s ± 26 ms 2.52 s ± 37 ms +0.40 %
arco-pro_development-mode + exec 2.52 s ± 81 ms 2.49 s ± 70 ms -1.39 %
arco-pro_development-mode_hmr + exec 430 ms ± 2.2 ms 426 ms ± 1.5 ms -0.86 %
arco-pro_development-mode_hmr_intercept-plugin + exec 440 ms ± 1.7 ms 435 ms ± 2.4 ms -1.07 %
arco-pro_development-mode_intercept-plugin + exec 3.33 s ± 46 ms 3.31 s ± 80 ms -0.55 %
arco-pro_production-mode + exec 4 s ± 92 ms 3.99 s ± 54 ms -0.32 %
arco-pro_production-mode_intercept-plugin + exec 4.89 s ± 74 ms 4.83 s ± 79 ms -1.22 %
threejs_development-mode_10x + exec 1.99 s ± 16 ms 1.99 s ± 19 ms +0.21 %
threejs_development-mode_10x_hmr + exec 768 ms ± 12 ms 767 ms ± 8.2 ms -0.18 %
threejs_production-mode_10x + exec 5.2 s ± 21 ms 5.18 s ± 27 ms -0.34 %

@SyMind SyMind changed the title feat: support contextModuleFactory afterResolve hook feat: support contextModuleFactory beforeResolve hook May 10, 2024
@SyMind SyMind requested a review from ahabhgk May 10, 2024 05:24
@SyMind
Copy link
Member Author

SyMind commented May 10, 2024

!eco-ci

@rspack-bot
Copy link

rspack-bot commented May 10, 2024

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
nx ✅ success
rspress ✅ success
rsbuild ✅ success
compat ✅ success
examples ✅ success

@SyMind SyMind merged commit 7e15f68 into web-infra-dev:main May 10, 2024
29 checks passed
@SyMind SyMind deleted the moment-locales-webpack-plugin branch May 10, 2024 07:59
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support moment-locales-webpack-plugin
3 participants