Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.2k
feat: warn when modules are automatically converted to strict mode#19628
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
3ru commentedJun 25, 2025
I'm not sure if this matches the original intent of the TODO, so I'd appreciate your review and guidance. |
codspeed-hqbot commentedJun 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#19628 willdegrade performances by 30.97%Comparing Summary
Benchmarks breakdown
|
bca8a2b to5318930Compare3ru commentedJul 18, 2025
@alexander-akait
as discussed in 17121. |
alexander-akait commentedJul 22, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@3ru This is a slightly different task, we need to check if a module can be converted to |
3ru commentedAug 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@alexander-akait Should we add this warning feature via a plugin, or are we building it directly into the core? |
- Add WarnStrictModeModulesPlugin to detect modules converted to strict mode- Track modules with explicit 'use strict' to avoid false warnings- Plugin is opt-in to avoid breaking existing builds
5318930 toea2182aCompare698d6f4 toe516bc5Comparee516bc5 tobcfb3d8Comparealexander-akait commentedAug 11, 2025
@3ru Great job, honestly automatic transformation would be useful, but it take the time, so right now I think we can -
|
75bb77c to8d749b7Comparebf82e5f toc17eb5eCompare3ru commentedAug 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ |
c17eb5e to584c818Compare584c818 to23fb6a5CompareResolved conflicts in:- declarations/WebpackOptions.d.ts: Kept strictModeChecks property and added extensibility with [k: string]: any- schemas/WebpackOptions.check.js: Regenerated with yarn fix:special
3ru commentedSep 3, 2025
I'll resolve the conflicts after review, since we keep running into them. |
Uh oh!
There was an error while loading.Please reload this page.
This PR introduces strict-mode compatibility diagnostics to help developers safely migrate modules that will be executed in strict mode and/or emitted as ESM.
Rel#17121
What kind of change does this PR introduce?
StrictCompatibilityPluginparser.isVariableDefinedfor exact scope checksDetection (ECMA-262 Annex C)
Strictness-sensitive patterns are classified into:
Note: Some of these are rejected by Acorn in strict mode before plugin hooks (they appear as Module parse failed), which is expected and relied upon.
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
Might be good to write docs?