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

fix: bad module order and missing modules when optimizing side effect free modules #18302

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kosciolek
Copy link

@kosciolek kosciolek commented Apr 8, 2024

What kind of change does this PR introduce?

Fix

Did you add tests for your changes?

A temporary failed case so far

I made this test under a temp name, I'll tidy it up, give it a proper name and move it to a proper location once I figure out what exactly is the issue.

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

Nothing


fixes #7094 (hopefully, since this issue evolved over time and covers multiple problems)

Copy link

linux-foundation-easycla bot commented Apr 8, 2024

CLA Not Signed

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@alexander-akait
Copy link
Member

Thank you, I see the problem, let's try a fix from #7094 (comment) and look at our tests

@kosciolek
Copy link
Author

kosciolek commented Apr 10, 2024

I removed the block that handles imports (HarmonyImportSpecifierDependency) in optimizeIncomingConnections. The block that handles exports (HarmonyExportImportedSpecifierDependency) is still there.

14 test cases in Test / basic seem to fail:

● StatsTestCases › should print correct stats for concat-and-sideeffects
● StatsTestCases › should print correct stats for scope-hoisting-multi
● StatsTestCases › should print correct stats for side-effects-issue-7428
● StatsTestCases › should print correct stats for side-effects-optimization
● StatsTestCases › should print correct stats for side-effects-simple-unused
● TestCases › normal › optimize › side-effects-all-chain-unused › exported tests › should not evaluate a chain of modules
● TestCases › normal › optimize › side-effects-immediate-unused › exported tests › should not evaluate an immediate module
● TestCases › normal › optimize › side-effects-root-unused › exported tests › should evaluate all modules
● TestCases › normal › optimize › side-effects-transitive-unused › exported tests › should not evaluate a reexporting transitive module
● TestCases › normal › side-effects › dynamic-reexports › dynamic-reexports should load the compiled tests
● ConfigTestCases › concatenate-modules › side-effects › exported tests › should import side-effect-free modules in deterministic order (usage order)
● ConfigTestCases › side-effects › side-effects-unsorted-modules › exported tests › should not contain side-effect-free modules
● ConfigTestCases › side-effects › type-reexports › exported tests › should skip over module
● ConfigTestCases › side-effects › type-reexports › exported tests › should skip over module

@alexander-akait
Copy link
Member

Yeah, I see it, need to investigate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS Order Differs Between Development & Production Modes when Treeshaking.
3 participants