Skip to content

Conversation

@elevatebart
Copy link
Collaborator

@elevatebart elevatebart commented Sep 23, 2018

After seeing the following warning a great enough number of times, I decided to tackle the issue.

(node:13435) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

Three object were still using the webpack 3 way:

  • StyleguidistOptionsPlugin, but I guess you already worked on that
  • bin/styleguidist.js that was hooking directly onto webpack
  • [email protected] that is incompatible with webpack 4.

I therefore upgraded the latest and fixed both the other files. The warning is gone.

Enjoy

@elevatebart elevatebart self-assigned this Sep 23, 2018
@elevatebart elevatebart requested a review from sapegin September 23, 2018 00:03
@codecov-io
Copy link

codecov-io commented Sep 23, 2018

Codecov Report

Merging #1148 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
scripts/utils/StyleguidistOptionsPlugin.js 100% <100%> (ø) ⬆️

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

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

Cool! This is very nice! Couple of minor comments.

@sapegin sapegin mentioned this pull request Sep 23, 2018
4 tasks
@elevatebart
Copy link
Collaborator Author

elevatebart commented Oct 7, 2018

Hello @sapegin I finally found the time to run those webpack 3 tests. Even if the tests seem to pass, when testing manually I have a big old error in webpack-dev-server...

Cannot destructure property `compile` of 'undefined' or 'null'.

the faulty line obviously being:

const { compile, invalid, done } = compiler.hooks;

I wonder if I could load multiple versions of the dev server and call them depending on the version of webpack.

I will recreate this PR on the next branch in order to probably drop webpack 3 support in 8.

@elevatebart elevatebart force-pushed the Fix--remove-webpack-4-deprecation-warning branch from 576dd3a to 314ae6f Compare October 7, 2018 11:05
@elevatebart
Copy link
Collaborator Author

I removed the update of webpack-dev-server and left the other fixes.
This is a first step towards compatibility, since we should not drop webpack 3 in the middle of a minor version.

Tested with webpack 3 & webpack 4.
Webpack3, purrs like a kitten.
Webpack4, still has the warning but works.

sapegin pushed a commit that referenced this pull request Oct 23, 2018
## Breaking changes

### Drop webpack 3 support

Webpack 3 is no longer supported, webpack 4 is the minimum required version.

As a side effect you shouldn’t see any webpack warnings when you run Styleguidist.

We’ve also replaced no longer maintainer uglify-es with Terser to minify production JavaScript bundle.

* #1175, #1178 by @derz
* #1165 by @elevatebart
* #1148 by @elevatebart
* #915, #1023 by @stepancar
* #1180 by @AndreyGladkov
@sapegin
Copy link
Member

sapegin commented Jan 17, 2019

I believe this was either merged manually of fixed by another pull request. Thanks for the contribution!

@sapegin sapegin closed this Jan 17, 2019
@sapegin sapegin deleted the Fix--remove-webpack-4-deprecation-warning branch January 17, 2019 10:03
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.

4 participants