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

V4 #2592

Merged
merged 74 commits into from
Nov 27, 2020
Merged

V4 #2592

merged 74 commits into from
Nov 27, 2020

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented May 10, 2020

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

Breaking Changes

  • Drop Node@6,8 so the minimum version is Node@10
  • hot enabled by default
  • The default transportMode is switched from sockjs to ws
  • Remove hotOnly and hot accepts boolean and only
  • Remove before, after, and setup and add onBeforeSetupMiddleware and onAfterSetupMiddleware
  • Remove key, cert, pfx, pfx-passphrase, and requestCert from CLI and webapck.config.js
  • Remove inline and iframe/live mode
  • Remove lazy and filename
  • Remove features
  • Delete some internal options variables, so please use this.options.xxx
  • The log, logLevel, logTime, noInfo, quiet, reporter and warn options were removed in favor of built-in webpack logger, please use https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel to enable and set up logging output
  • the hot value prefers the CLI --hot flag over the configuration hot option - it is a fix
  • rename clientOptions to client
  • Remove fs, index, mimeTypes, publicPath, serverSideRender, and writeToDisk in favor of dev option for any webpack-dev-middleware configuration
  • Upgrade webpack-dev-middleware to v4, which includes many breaking options changes
  • Remove stats option and color CLI flag in favor of webpack stats option
  • Remove socket option
  • Remove contentBase, contentBasePublicPath, serveIndex, staticOptions, watchContentBase, watchOptions in favor of static
  • Minor createConfig util API changes
  • disableHostCheck and allowedHosts removed in favor of firewall
  • Yes, the client uses the port of the current location (location.port, equivalent to sockPort: 'location'), by default. To get existing behavior, set the client.port with the port you'd like to set to, e.g.:
  • Added setupExitSignals option. Takes a boolean and if true (default on CLI), the server will close and exit the process on SIGINT and SIGTERM
  • server.listen() will find free port if this.options.port is not set and port argument is not passed
  • Print a warning if options.port and port passed as an argument is different
  • Added CLI calling webpack serve.
  • server.listen() now returns a Promise, which will resolve to server.listeningApp, after finding the free port.
  • bin/options.js is removed.
  • profile (--profile) option is removed, to print profile data, set progress: 'profile' (--progress profile).
  • progress (--progress) option is moved to client, set client: {progress: true} (--client-progress).
  • Yes, the client uses the hostname of the current location (location.hostname), by default. To get existing behavior, set the client.host with the hostname you'd like to set to, e.g.: const server = new Server(compiler, { client: { host: hostname, } }); server.listen(port, hostname);
  • sockHost, sockPath and sockPort options were removed in favor the client option (BREAKING CHANGE: move sock options into an object #2593)
  • cacert CLI option and ca option are removed and moved to https.ca (BREAKING CHANGE(https): migrate ca, cert, pfx, key, pfx-passphrase, and requestCert to https object #2564)

Fixes

fix(client): use location protocol on ipv6 any (::) host (#2868)

For Bugs and Features; did you add new tests?

Yep

Motivation / Use-Case

We decided to release a new version as V4.

Breaking Changes

Yep

Additional Info

DON'T USE SQUASH AND MERGE

knagaitsev and others added 12 commits May 8, 2020 18:20
* chore(deps): upgrade chokidar

* chore(deps): switch to promise method without async for close

* chore(ci): remove node v6

* chore(deps): fix issue of closing watchers before middleware

* chore(deps): upgrade chokidar to v3.4.0
* chore(deps): upgrade deps

* style: run prettier

* test: update

* ci: remove Node@8

* test(cli): add windows support

* chore(deps): downgrade puppeteer

* chore(deps): downgrade some deps

* fix(hot): enable hot option as default (#2546)

BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }`

* fix: remove lazy and filename options (#2544)

BREAKING CHANGE: `lazy` and `filename` options was removed
BREAKING CHANGE: switch default transportMode to ws
BREAKING CHANGE: the `client` now in `default` directory
BREAKING CHANGE: the `setup` was removed, `before` and `after` options were renamed to `onBeforeSetupMiddleware` and `onAfterSetupMiddleware`
@hiroppy
Copy link
Member Author

hiroppy commented May 10, 2020

Lint CI will fail because BREAKING CHANGE prefix doesn't recognize.

@codecov
Copy link

codecov bot commented May 10, 2020

Codecov Report

Merging #2592 (47a0fe1) into master (4ab1f21) will decrease coverage by 1.31%.
The diff coverage is 95.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2592      +/-   ##
==========================================
- Coverage   93.77%   92.45%   -1.32%     
==========================================
  Files          34       38       +4     
  Lines        1333     1246      -87     
  Branches      381      324      -57     
==========================================
- Hits         1250     1152      -98     
- Misses         81       89       +8     
- Partials        2        5       +3     
Impacted Files Coverage Δ
client-src/clients/BaseClient.js 72.72% <ø> (ø)
client-src/default/socket.js 59.09% <ø> (ø)
lib/utils/getSocketServerImplementation.js 90.47% <ø> (ø)
lib/servers/WebsocketServer.js 94.11% <50.00%> (ø)
client-src/clients/SockJSClient.js 61.36% <80.00%> (+1.36%) ⬆️
client-src/clients/WebsocketClient.js 58.13% <80.00%> (+0.63%) ⬆️
lib/utils/status.js 88.23% <80.00%> (-3.07%) ⬇️
lib/servers/SockJSServer.js 94.11% <83.33%> (+0.36%) ⬆️
lib/utils/setupExitSignals.js 92.85% <90.90%> (-7.15%) ⬇️
client-src/default/index.js 92.47% <92.85%> (+0.25%) ⬆️
... and 31 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 4ab1f21...47a0fe1. Read the comment docs.

@knagaitsev
Copy link
Collaborator

@hiroppy #2593

knagaitsev and others added 13 commits May 12, 2020 13:32
BREAKING CHANGE: `sockHost`, `sockPath` and `sockPort` options were removed in favor the `clientOptions` option
BREAKING CHANGE: only for Node.js API, all options are now in `devServer.options`
BREAKING CHANGE: the `features` option was removed
BREAKING CHANGE: `log`, `logLevel`, `logTime`, `noInfo`, `quiet`, `reporter` and `warn` options were removed in favor built-in webpack logger, please use https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel for enable and setup logging output
BREAKING CHANGE: the `hot` value prefers from CLI over the configuration
@alexander-akait
Copy link
Member

@gandhiamarnadh hope this week

@alexander-akait
Copy link
Member

/cc @hiroppy I think time to merge this to master and do beta release, we will move other client options in the next beta (beta.2/beta.3/etc)

@hiroppy
Copy link
Member Author

hiroppy commented Nov 27, 2020

@alexander-akait Yes! GoGo! Can you write the changelog including the migration guide to the release page?

@alexander-akait
Copy link
Member

@hiroppy yep, I will do it today 👍

@ylemkimon
Copy link
Contributor

ylemkimon commented Nov 27, 2020

Two missing breaking changes:

  • rename clientOptions to client

@alexander-akait
Copy link
Member

@ylemkimon thanks, I will check every PR to when write CHANGELOG to make sure we haven't missed anything

@alexander-akait
Copy link
Member

Time to release webpack-dev-server@4-beta.0, WIP on CHANGELOG

@alexander-akait alexander-akait merged commit b0161e9 into master Nov 27, 2020
@ylemkimon
Copy link
Contributor

I think this should have been merged via a merge commit or rebase merging.

@alexander-akait
Copy link
Member

@ylemkimon yes, you are right here, but we have very dirtly commit history here, so I prefer to squash it, we will avoid it in future

@alexander-akait
Copy link
Member

Found strange thing with our client, we loaded not bundled client, WIP on this

@alexander-akait
Copy link
Member

Yes we have a bug, not easy to fix, so I am doing release and try to fix it tomorrow, we should use index.bundle.js from client/default/

@alexander-akait
Copy link
Member

alexander-akait commented Nov 27, 2020

Also found bug we write stats in process.stderr in webpack-dev-middleware, but we should use process.stdout

@alexander-akait
Copy link
Member

@ylemkimon https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0, maybe you can help us more?
Found bugs:

@ylemkimon
Copy link
Contributor

@alexander-akait I've tested the beta in one of my projects and it works nicely. Thank you for the great work! I currently don't have much time but will try.

we write stats in process.stderr in webpack-dev-middleware, but we should use process.stdout

Doesn't dev-server and middleware use webpack's InfrastructureLogger?

@alexander-akait
Copy link
Member

Doesn't dev-server and middleware use webpack's InfrastructureLogger?

yes, but for stats, we should not use logger, because logger always use stderr (diagnostic)

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.