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 order of occurrence order plugin #7721

Merged
merged 1 commit into from
Jul 15, 2018
Merged

fix order of occurrence order plugin #7721

merged 1 commit into from
Jul 15, 2018

Conversation

sokra
Copy link
Member

@sokra sokra commented Jul 13, 2018

remove enforced additional occurrence order plugin from test cases
make test cases more independent of module/chunk order/ids

The OccurrenceOrderPlugin should keep original order when occurrence count is equal, but instead it used the inverted order. This is now fixed.

Also the duplicate OccurrenceOrderPlugin in the StatsTestCases was removed.

What kind of change does this PR introduce?
bugfix, test update

Did you add tests for your changes?
existing tests

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
nothing

remove enforced additional occurrence order plugin from test cases
make test cases more independent of module/chunk order/ids
@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@@ -124,7 +124,7 @@ class OccurrenceOrderPlugin {
if (aOccurs < bOccurs) return 1;
const orgA = originalOrder.get(a);
const orgB = originalOrder.get(b);
return orgB - orgA;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this sort algorithm is used multiple times. Maybe it could be extracted and shared across the other plugins.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I look into refactoring this for webpack 5.

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.

None yet

3 participants