Skip to content

Improve webpack 4 support (afterEmit issue)#128

Closed
andriijas wants to merge 1 commit into
shellscape:masterfrom
andriijas:master
Closed

Improve webpack 4 support (afterEmit issue)#128
andriijas wants to merge 1 commit into
shellscape:masterfrom
andriijas:master

Conversation

@andriijas
Copy link
Copy Markdown
Contributor

No description provided.

@mastilver
Copy link
Copy Markdown
Contributor

@radum
Copy link
Copy Markdown

radum commented Feb 27, 2018

@andriijas You should remove Node 4 from Travis also. Node.js 4 is no longer supported. Source Code was upgraded to a higher ecmascript version.

@mastilver
Copy link
Copy Markdown
Contributor

Yeah, good point! node@4 will be deprecated in April, so it's pretty safe to do it now

@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 27, 2018

Codecov Report

Merging #128 into master will decrease coverage by 2.74%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
- Coverage   94.89%   92.15%   -2.75%     
==========================================
  Files           2        2              
  Lines          98      102       +4     
==========================================
+ Hits           93       94       +1     
- Misses          5        8       +3
Impacted Files Coverage Δ
lib/plugin.js 92.07% <84.61%> (-2.77%) ⬇️

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 052970e...1935847. Read the comment docs.

@andriijas
Copy link
Copy Markdown
Contributor Author

andriijas commented Feb 28, 2018

Call for help. 😱😱😱

I went through 💍 and 🔥 to get the tests working properly on all versions of webpack and extract text plugin and current status is that tests are running/failing randomly.

Check https://travis-ci.org/danethurber/webpack-manifest-plugin/builds/347232114

    TypeError: used is not a function

and sometimes

    SyntaxError: Unexpected end of JSON input

There is something Im not getting right with the async resolving but I cant figure it out. Please advise.

@mastilver
Copy link
Copy Markdown
Contributor

mastilver commented Feb 28, 2018

Don't worry about SyntaxError: Unexpected end of JSON input it's just a racing condition issue (which we will be able to get rid once we stop supporting webpack < 3)

TypeError: used is not a function is a known issue mafintosh/mutexify#7, just leave the current version for mutexify. I'm getting rid of it anyway in #107 so you are good :)

@andriijas
Copy link
Copy Markdown
Contributor Author

@mastilver okay cool. then the bigger question is whatever compiler.hooks.webpackManifestPluginAfterEmit should use a sync or async API

check 65f826d

I will squash the commits and force push when you have decided, dont want that ugly console.log in the history.

@mastilver
Copy link
Copy Markdown
Contributor

I think we want it sync for the future (So we won't need the lock system) but I could be wrong

I'm sorry, I just merged something and there is some merge conflicts now... :/

@andriijas
Copy link
Copy Markdown
Contributor Author

@mastilver rebased.

@gauravtiwari gauravtiwari mentioned this pull request Mar 3, 2018
8 tasks
Comment thread lib/plugin.js
compiler.hooks.emit.tap('ManifestPlugin', emit);
} else {
compiler.plugin('compilation', function (compilation) {
compiler.plugin('compilation', compilation => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't this also be compiler.hooks.compilation.tap('ManifestPlugin', compilation) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nah thats the legacy for webpack <=3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah, ok.

@andriijas
Copy link
Copy Markdown
Contributor Author

@mastilver anything i need to adjust? would be so thankful for a new release!

@mastilver
Copy link
Copy Markdown
Contributor

We need to figure out where the memory leak come from, I did some tweaking but I was unsuccessful... :/

@radum
Copy link
Copy Markdown

radum commented Mar 12, 2018

@mastilver They are all failing when extract text is in Beta, might be that is the issue.

@simonklee
Copy link
Copy Markdown

I tried this pull request with multiple instances of extract-text-webpack-plugin. It didn't work. Looks like it simply chose the last instance of extract-text-webpack-plugin and mapped that, while the first instance's output was discarded/overwritten.

@andriijas
Copy link
Copy Markdown
Contributor Author

extract-text-webpack-plugin is now in maintainance mode for webpack 3.

Maybe we should add https://github.com/webpack-contrib/mini-css-extract-plugin for webpack 4 tests.

it will require some work though

@mastilver
Copy link
Copy Markdown
Contributor

Oh, so extract-text-webpack-plugin won't ever be released for webpack 4?

I think we should just ignore that test for now... release v2 then release v3 with just support for webpack@4 (the failing test is something that is happening very rarely)

Maybe check if we are running webpack@4, then return from the test

What do you think?

@andriijas
Copy link
Copy Markdown
Contributor Author

Sounds good👍

@rossta
Copy link
Copy Markdown

rossta commented Mar 21, 2018

@mastilver Looks like extract-text-webpack-plugin support for webpack 4 support is being addressed on webpack-contrib/extract-text-webpack-plugin#685

@montogeek
Copy link
Copy Markdown

Please take a look at https://github.com/webpack-contrib/mini-css-extract-plugin, it was build for webpack 4 as a replacement for extract-text-webpack-plugin, please note that as its name says, it is intended for CSS extraction, no any text like extract-text-webpack-plugin.

@andriijas
Copy link
Copy Markdown
Contributor Author

@rossta nope thats obsolete PR. check webpack-contrib/extract-text-webpack-plugin#749

@mastilver updated PR with some branching/if statements to detect webpack version in tests. Added test with MiniCSSExtractPlugin for webpack >=4

didnt have time for this but it had to be done 😂

@mastilver
Copy link
Copy Markdown
Contributor

@andriijas Sorry, I'm opening a new PR for this, we can take care of the refactoring later on, I just want to get it working with webpack@4 ;)

Do you mind reviewing #134

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants