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

BREAKING CHANGE: remove CLI default flag values for webpack-cli serve #2659

Merged
merged 11 commits into from
Aug 22, 2020

Conversation

knagaitsev
Copy link
Collaborator

@knagaitsev knagaitsev commented Jun 24, 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

For Bugs and Features; did you add new tests?

Not yet

Motivation / Use-Case

We do not want default values for webpack-cli serve flags, because this makes it much easier to merge CLI flags with the user's devServer options in their webpack config

Breaking Changes

  • Minor createConfig util API changes

Additional Info

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Merging #2659 into v4 will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v4    #2659      +/-   ##
==========================================
+ Coverage   92.88%   92.89%   +0.01%     
==========================================
  Files          37       37              
  Lines        1293     1295       +2     
  Branches      344      345       +1     
==========================================
+ Hits         1201     1203       +2     
  Misses         88       88              
  Partials        4        4              
Impacted Files Coverage Δ
client-src/default/utils/log.js 100.00% <ø> (ø)
lib/utils/createConfig.js 95.58% <100.00%> (+0.13%) ⬆️

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 86140c5...accce0f. Read the comment docs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Need fix CI

@knagaitsev
Copy link
Collaborator Author

I just realized that the default behavior I added in normalizeOptions was already added recently:

@knagaitsev knagaitsev force-pushed the fix/cli-default-flags branch from 9c25995 to 9c1a225 Compare June 26, 2020 04:20
@alexander-akait
Copy link
Member

/cc @hiroppy

@alexander-akait
Copy link
Member

@Loonride Looks something broken on CI

@knagaitsev knagaitsev force-pushed the fix/cli-default-flags branch from 5d0c8b6 to 996c7cf Compare August 20, 2020 20:38
@knagaitsev
Copy link
Collaborator Author

knagaitsev commented Aug 20, 2020

I thought some slight refactoring on the current CLI flags (options.js) would be good to do here as well, since they are not necessary. There should be no breaking changes related to this besides slight util API changes like with createConfig. The 3 options for which I removed default CLI values are:

  • host - the default of localhost is now set in createConfig
  • client-logging - the default of info was already being set on the client side here:
    setLogLevel(defaultLevel);
  • liveReload - the default of true was already being set in normalizeOptions, so this default is already applied for both CLI and API

bin/cli-flags.js Outdated
name: 'name',
type: String,
describe: 'Name of webpack config to get devServer config from',
},
Copy link
Member

Choose a reason for hiding this comment

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

Why we have it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why we have it here?

@evilebottnawi We need it for this: webpack/webpack-cli#1649 (comment). Unless we want to add this flag on the webpack-cli side, but I think it is easiest to keep it uniform with other CLI flags

Copy link
Member

Choose a reason for hiding this comment

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

It is already added on webpack-cli side

Copy link
Collaborator Author

@knagaitsev knagaitsev Aug 21, 2020

Choose a reason for hiding this comment

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

It is already added on webpack-cli side

Do you know where to find it on webpack-cli side? I can't seem to find it

Edit: never mind, I think I found the PR

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yes 👍

@knagaitsev knagaitsev changed the title [WIP] Remove CLI default flag values for webpack-cli serve Remove CLI default flag values for webpack-cli serve Aug 21, 2020
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

/cc @hiroppy

@hiroppy hiroppy changed the title Remove CLI default flag values for webpack-cli serve BREAKING CHANGE: remove CLI default flag values for webpack-cli serve Aug 22, 2020
@hiroppy hiroppy merged commit 289a98f into webpack:v4 Aug 22, 2020
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.

3 participants