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

feat(webpack-plugin): upgrade to Webpack 5 #2225

Merged
merged 21 commits into from
May 21, 2021
Merged

feat(webpack-plugin): upgrade to Webpack 5 #2225

merged 21 commits into from
May 21, 2021

Conversation

YvanGuidoin
Copy link
Contributor

@YvanGuidoin YvanGuidoin commented Apr 12, 2021

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Move from webpack-dev-middleware/webpack-hot-middleware/custom express server to webpack-dev-server
That also bumps the minimal node version to 12

Two points to note:

  • This is built on webpack-dev-server 4.x beta release, as there is many breaking changes, I didn't wanted to do code that will be deprecated in a few weeks/months
  • There is still some type issues as webpack-dev-server doesn't provide its own typings up to date

Fixes #2208.

@YvanGuidoin YvanGuidoin mentioned this pull request Apr 12, 2021
7 tasks
@YvanGuidoin YvanGuidoin changed the title WIP - Webpack dev server for webpack-plugin WIP - Webpack dev server and webpack 5 for webpack-plugin Apr 12, 2021
@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #2225 (04864d4) into master (4dc66df) will increase coverage by 0.18%.
The diff coverage is 63.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2225      +/-   ##
==========================================
+ Coverage   72.95%   73.14%   +0.18%     
==========================================
  Files          75       74       -1     
  Lines        2248     2193      -55     
  Branches      425      413      -12     
==========================================
- Hits         1640     1604      -36     
+ Misses        448      418      -30     
- Partials      160      171      +11     
Impacted Files Coverage Δ
packages/plugin/webpack/src/WebpackPlugin.ts 58.79% <61.53%> (+23.98%) ⬆️
...es/plugin/webpack/src/util/ElectronForgeLogging.ts 62.06% <62.06%> (ø)
packages/plugin/webpack/src/WebpackConfig.ts 97.59% <100.00%> (-0.03%) ⬇️
...ypescript-webpack/src/TypeScriptWebpackTemplate.ts 20.68% <0.00%> (-79.32%) ⬇️
packages/template/webpack/src/WebpackTemplate.ts 24.00% <0.00%> (-76.00%) ⬇️
...ages/template/typescript/src/TypeScriptTemplate.ts 30.00% <0.00%> (-70.00%) ⬇️
packages/publisher/base/src/Publisher.ts 12.50% <0.00%> (-50.00%) ⬇️
packages/utils/async-ora/src/ora-handler.ts 63.33% <0.00%> (-26.67%) ⬇️
packages/utils/test-utils/src/index.ts 60.71% <0.00%> (-25.01%) ⬇️
packages/template/base/src/BaseTemplate.ts 75.55% <0.00%> (-22.23%) ⬇️
... and 9 more

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 4dc66df...04864d4. Read the comment docs.

Yvan Guidoin added 3 commits April 12, 2021 16:45
Remove express/webpack-hot-middleware/webpack-dev-middleware for a simple webpack-dev-server
Provide a build indicator on webpack runs using hooks and async ora
@YvanGuidoin YvanGuidoin changed the title WIP - Webpack dev server and webpack 5 for webpack-plugin Webpack dev server and webpack 5 for webpack-plugin Apr 13, 2021
@Eli-Black-Work Eli-Black-Work mentioned this pull request Apr 26, 2021
3 tasks
@malept malept changed the title Webpack dev server and webpack 5 for webpack-plugin feat(webpack-plugin): upgrade to Webpack 5 May 18, 2021
Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

Thanks for your patience on the review and thank you for the PR! I still need to test this locally but I have some suggestions on the code itself.

packages/plugin/webpack/package.json Show resolved Hide resolved
packages/plugin/webpack/src/WebpackConfig.ts Outdated Show resolved Hide resolved
packages/plugin/webpack/src/WebpackConfig.ts Outdated Show resolved Hide resolved
packages/plugin/webpack/src/WebpackPlugin.ts Outdated Show resolved Hide resolved
packages/plugin/webpack/src/WebpackPlugin.ts Outdated Show resolved Hide resolved
packages/plugin/webpack/test/WebpackConfig_spec.ts Outdated Show resolved Hide resolved
packages/plugin/webpack/test/once_spec.ts Outdated Show resolved Hide resolved
typings/webpack-dev-server/index.d.ts Show resolved Hide resolved
typings/webpack-dev-server/index.d.ts Outdated Show resolved Hide resolved
typings/webpack-dev-server/index.d.ts Outdated Show resolved Hide resolved
Yvan Guidoin and others added 3 commits May 19, 2021 09:40
For some reason the tests keep failing with the following error:

```
  1) Uncaught error outside test suite:
     Uncaught Workerpool Worker terminated Unexpectedly
    exitCode: `0`
    signalCode: `null`
    workerpool.script: `electron-forge/node_modules/mocha/lib/nodejs/worker.js`
    spawnArgs: `electron-forge/node_modules/mocha/lib/nodejs/worker.js`
    spawnfile: `/usr/bin/node`
    stdout: `null`
    stderr: `null`
```
Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

I did some smoketests and it seems fine, I guess I'll find out how many new issues folks create 😬

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.

Webpack 5 support
2 participants