Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(index): stricter check for shouldExtract !== wasExtracted #605

Merged

Conversation

kostasmanionis
Copy link
Contributor

@kostasmanionis kostasmanionis commented Aug 16, 2017

Tried this on a few projects that been having this issue and it works

Issues


Fixes #604

@jsf-clabot
Copy link

jsf-clabot commented Aug 16, 2017

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Can we add test for this?

@codecov
Copy link

codecov bot commented Aug 16, 2017

Codecov Report

Merging #605 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #605   +/-   ##
=======================================
  Coverage   87.41%   87.41%           
=======================================
  Files           7        7           
  Lines         302      302           
  Branches       68       68           
=======================================
  Hits          264      264           
  Misses         36       36           
  Partials        2        2
Impacted Files Coverage Δ
src/index.js 89.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a660f3...3730b83. Read the comment docs.

@kostasmanionis
Copy link
Contributor Author

I would love to add some tests, though I'm not really sure how to approach it 🤔 I would need to setup a webpack compiler, then trigger a rebuild and somehow check if the ids are correct... Or is there a simpler way?

@alexander-akait
Copy link
Member

@kostasmanionis we have example of tests in https://github.com/webpack-contrib/extract-text-webpack-plugin/tree/master/test, without tests this PR most likely will not be accepted.

@michael-ciniawsky michael-ciniawsky changed the title Be more strict with shouldExtract and wasExtracted check fix(index): stricter check for shouldExtract !== wasExtracted Aug 16, 2017
Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

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

@kostasmanionis Where/When does this currently fail?

@kostasmanionis
Copy link
Contributor Author

@michael-ciniawsky there's some info and a reproducible use case in #604

I'm not yet sure how to test the rebuild functionality 🤔 If anyone has any suggestions, let me know

@michael-ciniawsky
Copy link
Member

@kostasmanionis Yep, sry I missed it :). hmm... current tests are passing and the change is minimal, async CSS chunks are a known problem with ExtractTextPlugin, I also don't know how to test for rebuilds tbh. Maybe add a comment above the check in case this f** up some other usecases and needs to be reverted :)

@kostasmanionis
Copy link
Contributor Author

@michael-ciniawsky tried to add a useful comment there, looks good?

@alexander-akait
Copy link
Member

alexander-akait commented Aug 17, 2017

@kostasmanionis How difficult to implement the test? If your create minimum test repo we can help with this, thanks!

@kostasmanionis
Copy link
Contributor Author

@evilebottnawi there's a reproducible repo https://github.com/kostasmanionis/extract-text-plugin-rebuild-bug

I'm thinking I would need to trigger a webpack rebuild to test this specific use case, since the problem does not occur on the initial build. Then I would need to check if all of the module ids are correct 🤔

@alexander-akait
Copy link
Member

@kostasmanionis thanks, in near future i can investigate this - how we can implement test for this

@alexander-akait
Copy link
Member

@kostasmanionis good work, your solution fix issue, but without tests we can change behavior (our just refactor code) in future and get regression 😞 Need search how we can implement tests.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Seems it is difficult to test this 😞 Let's merge this, comment is enough. Maybe in future we found way to tests this. Thanks!

@kostasmanionis
Copy link
Contributor Author

Thanks for finding time to look at it!

I have a few ideas on how to test it 🤔 Gonna try playing with a bit when I have some time, seems like a good opportunity to get a little bit more familiar with webpack internals.

Any idea when this fix could get published?

@alexander-akait
Copy link
Member

@kostasmanionis in the near future 👍

@alexander-akait
Copy link
Member

@d3viant0ne need third approved 👍

@michael-ciniawsky michael-ciniawsky added this to the 3.0.1 milestone Aug 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants