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

[heft-webpack5-plugin] Upgrade to webpack-dev-server 4.x #2872

Conversation

bartvandenende-wm
Copy link
Contributor

Summary

This PR updates webpack-dev-server from 3.x to version 4.x to which brings official webpack 5.x support.

Details

impact

There are several breaking changes when migrating to webpack-dev-server 4.x, a full migration guide is available below:
https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md

Minimum supported Node.js version is `12.13.0`.
Minimum supported webpack version is `4.37.0`  (but we so recommend using 5 version).
Minimum compatible webpack-cli version is `4.7.0`.

To reduce the change impact this update has only been applied for the heft-webpack5-plugin plugin, though per above could in theory also be ported to heft-webpack4-plugin.

background

The usage of webpack-dev-server 3.x was 'mostly' compatible with webpack 5.x , but there where a number of open issues that only have only been addressed in webpack-dev-server 4.x.

It has been a longer recommendation from the webpack-dev-server team to use the 4.x beta or RC builds, though due to lack of type declarations these could not be used. As of last week the official 4.0 version has been published including the types.

what does it fix

An example of an issue that is resolved is with this upgrade is the support of HMR for projects that targeted ES5 codebase: #2818

code change

  • updated heft-webpack5-plugin package.json to update webpack-dev-server and the types
  • updated common-versions.json to support multiple version of webpack-dev-server
  • resolved breaking type changes as part of the upgrade in heft-webpack5-plugin

How it was tested

Running rush install and rush rebuild to re-run all existing tests.

@ghost
Copy link

ghost commented Aug 24, 2021

CLA assistant check
All CLA requirements met.

@iclanton iclanton added this to In Progress in Bug Triage Aug 24, 2021
cachedAssets: false,
colors: supportsColor
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Overall this LGTM.

@iclanton we good with this config change?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah seems fine.

Copy link
Member

@iclanton iclanton left a comment

Choose a reason for hiding this comment

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

Approved with suggestions.

…wm-webpack-dev-update_2021-08-24-16-18.json

Co-authored-by: Ian Clanton-Thuon <[email protected]>
@octogonz octogonz merged commit f81534a into microsoft:master Aug 28, 2021
Bug Triage automation moved this from In Progress to Closed Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Bug Triage
  
Closed
Development

Successfully merging this pull request may close these issues.

None yet

3 participants