webpack-cli icon indicating copy to clipboard operation
webpack-cli copied to clipboard

feat: next

Open snitin315 opened this issue 2 years ago • 3 comments

What kind of change does this PR introduce?

Breaking changes.

Did you add tests for your changes? Yes.

If relevant, did you update the documentation? Yes.

Summary

Prepare for the next major release.

Does this PR introduce a breaking change? Yes.

Other information

  • [x] drop node v10, v12
  • [x] drop webpack v4
  • [x] drop webpack-dev-server v3
  • [x] remove --prefetch
  • [x] remove --hot
  • [x] remove migrate command
  • [ ] update all deps to the latest
  • [x] --entry require --entry-reset before (need add test(s)) https://github.com/webpack/webpack-cli/pull/3372
  • [x] --target require --target-reset before (need add test(s)) https://github.com/webpack/webpack-cli/pull/3347
  • [x] refactor build tests - avoid using scripts/prepareSuite.js and put all deps in top package.json + rename tests https://github.com/webpack/webpack-cli/pull/3409
  • [ ] node-env should be renamed?
  • [ ] simplify logic for getBuiltInOptions and remove extra map/reduce/etc and avoid using builtInOptionsCache
  • [ ] make stable CLI API for public usage
  • [ ] avoid unnecessary process.exit()
  • [ ] resolve TODOs wherever possible.
  • [x] remove the webpack version in favor of webpack info (https://github.com/webpack/webpack-cli/pull/3370)

snitin315 avatar Jun 06 '22 04:06 snitin315

Let's keep it open untill all the breaking changes are merged to the next branch.

snitin315 avatar Jun 06 '22 16:06 snitin315

Codecov Report

Merging #3279 (9caa048) into master (81471b9) will increase coverage by 6.13%. The diff coverage is 87.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3279      +/-   ##
==========================================
+ Coverage   85.17%   91.30%   +6.13%     
==========================================
  Files          23       22       -1     
  Lines        1733     1588     -145     
  Branches      519      447      -72     
==========================================
- Hits         1476     1450      -26     
+ Misses        257      138     -119     
Impacted Files Coverage Δ
...s/generators/init-template/default/package.json.js 100.00% <ø> (ø)
packages/webpack-cli/src/plugins/CLIPlugin.ts 100.00% <ø> (+1.47%) :arrow_up:
packages/serve/src/index.ts 78.94% <59.45%> (+17.86%) :arrow_up:
packages/webpack-cli/src/webpack-cli.ts 92.70% <96.42%> (+1.19%) :arrow_up:
packages/configtest/src/index.ts 96.00% <100.00%> (+3.40%) :arrow_up:
packages/generators/src/addon-generator.ts 92.98% <100.00%> (+0.25%) :arrow_up:
packages/generators/src/handlers/default.ts 98.76% <100.00%> (+43.20%) :arrow_up:
packages/generators/src/init-generator.ts 85.29% <100.00%> (-7.21%) :arrow_down:
packages/info/src/index.ts 100.00% <100.00%> (ø)
... and 8 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 81471b9...9caa048. Read the comment docs.

codecov[bot] avatar Jun 11 '22 03:06 codecov[bot]

Any status update on this?

@rishabh3112 I've added a the task list in the PR description.

snitin315 avatar Aug 09 '22 04:08 snitin315

@snitin315 Some things can be postponed, like:

- simplify logic for getBuiltInOptions and remove extra map/reduce/etc and avoid using builtInOptionsCache
- avoid unnecessary process.exit()
- resolve TODOs wherever possible.
- resolve TODOs wherever possible.

We should look at code, if we will not have breaking change, we can postpone it and solve late, I think we should do release soon, because we need to drop nodev12 for webpack-dev-server too

Maybe we can collect them here and decide it

alexander-akait avatar Oct 17 '22 12:10 alexander-akait

@alexander-akait yes, I feel the tasks left won't be breaking changes. We are mostly done with all the breaking changes.

node-env should be renamed?

Was any issue raised for this? Do you have any other name in mind? I feel node-env name is ok.

snitin315 avatar Oct 17 '22 12:10 snitin315

hm, give me time to undestand why do we even need this

alexander-akait avatar Oct 17 '22 12:10 alexander-akait

@alexander-akait This was requested from users in https://github.com/webpack/webpack-cli/issues/2362

snitin315 avatar Oct 17 '22 12:10 snitin315

@snitin315 Oh, I wanted to rename node-env, because it is confising, many developers using node-env think that it will change process.env.NODE_ENV inside webpack.config.js, but it only change process.env.NODE_ENV in code, that is why I think we need another name for this. What do you think?

alexander-akait avatar Oct 17 '22 12:10 alexander-akait

@alexander-akait In that case it makes sense to update the name, we can also mention this explicitly in docs.

How about --runtime-node-env?

snitin315 avatar Oct 17 '22 12:10 snitin315

What about --define-node-env? Ideally will be great to have something like --define:process.env.NODE_ENV='production', so developer can add more things, but not sure our args parser can do it, need to test

alexander-akait avatar Oct 17 '22 13:10 alexander-akait

--define:process.env.NODE_ENV

How about --define-process-node-env/--define-process-env-node-env

snitin315 avatar Oct 17 '22 13:10 snitin315

--define-process-env-node-env looks good for me, in future we can implement --define-* supporing for more options

alexander-akait avatar Oct 17 '22 13:10 alexander-akait

@snitin315 Regarding

update all deps to the latest

What is left?

alexander-akait avatar Oct 19 '22 18:10 alexander-akait

@snitin315 Regarding

update all deps to the latest

What is left?

@alexander-akait Only updating commander.js to v9 is left.

snitin315 avatar Oct 22 '22 01:10 snitin315

@snitin315 Great, feel free to ask help if you will have problems with it

alexander-akait avatar Oct 22 '22 01:10 alexander-akait

[ ] make stable CLI API for public usage

@alexander-akait What do we want to change in the API?

snitin315 avatar Oct 28 '22 03:10 snitin315

@snitin315 Can you show me where you take this task? I need context to remeber it :smile:

alexander-akait avatar Oct 28 '22 11:10 alexander-akait

@alexander-akait This was in old next https://github.com/webpack/webpack-cli/pull/2879

snitin315 avatar Oct 28 '22 12:10 snitin315

@snitin315 Got it, I mean we should add tests cases where developer programatically run WebppackCLI and can run build/serve/etc commands without problems

alexander-akait avatar Oct 28 '22 12:10 alexander-akait

Maybe we can postpone it too then.

snitin315 avatar Oct 28 '22 12:10 snitin315

@snitin315 Yeah, I think soo, anything else we need to finish before merge and release? Maybe ESM?

alexander-akait avatar Oct 28 '22 12:10 alexander-akait

Yes. Only ESM is left.

snitin315 avatar Oct 28 '22 12:10 snitin315

Great, thank you

alexander-akait avatar Oct 28 '22 12:10 alexander-akait

@alexander-akait I feel we can merge this after CI is green. We should do Rebase and Merge to preserve commit history.

Screenshot 2022-11-08 at 8 41 24 AM

snitin315 avatar Nov 08 '22 03:11 snitin315

@snitin315 Yeah, we should not lose changelog generation :+1:

alexander-akait avatar Nov 08 '22 16:11 alexander-akait

@alexander-akait We can release it now 👍🏻

snitin315 avatar Nov 10 '22 04:11 snitin315

@alexander-akait I feel we can merge 👍🏻

snitin315 avatar Nov 15 '22 00:11 snitin315