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

refactor!: the minimum supported webpack version is v5.0.0 #3342

Merged
merged 5 commits into from Jul 27, 2022

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Jul 19, 2022

What kind of change does this PR introduce?
Breaking change.

Did you add tests for your changes?
Already present.

If relevant, did you update the documentation?
No

Summary

The minimum supported webpack version is v5.0.0.

Does this PR introduce a breaking change?

BREAKING CHANGE:

  • webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
  • Reset flags like --target-reset, --entry-reset flags are required to be used before using original flags like --target, --entry.

Other information
No

@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #3342 (4ee108e) into next (cae10a8) will decrease coverage by 0.13%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #3342      +/-   ##
==========================================
- Coverage   93.06%   92.92%   -0.14%     
==========================================
  Files          22       22              
  Lines        1686     1669      -17     
  Branches      491      479      -12     
==========================================
- Hits         1569     1551      -18     
- Misses        117      118       +1     
Impacted Files Coverage Δ
packages/webpack-cli/src/webpack-cli.ts 95.17% <94.44%> (-0.18%) ⬇️

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 cae10a8...4ee108e. 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.

Let's separete this PR on parts to avoid regressions:

  1. Remove old options
  2. Remove workaround for webpack v4

Or verca vice

@snitin315
Copy link
Member Author

@alexander-akait I've created #3346 to remove workarounds, I'll update this PR to remove old options.

BREAKING CHANGE: webpack-cli no longer supports webpck v4, the minimum supported version is webpack v5.0.0
@snitin315 snitin315 force-pushed the refactor/rm-webpack-4-support branch from 52f2913 to 63a9f59 Compare July 25, 2022 11:20
@snitin315 snitin315 marked this pull request as ready for review July 25, 2022 11:23
@snitin315 snitin315 requested a review from a team as a code owner July 25, 2022 11:23
@snitin315 snitin315 force-pushed the refactor/rm-webpack-4-support branch from 63a9f59 to 9d1f8c1 Compare July 25, 2022 11:31
@snitin315
Copy link
Member Author

@alexander-akait Done

@@ -239,15 +239,17 @@ describe("core flags", () => {
expect(stdout).toContain(`devtool: 'source-map'`);
});

it("should allow string value devtool option using alias", async () => {
// TODO: Enable alias with webpack 5
it.skip("should allow string value devtool option using alias", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Why skip?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have alias property coming from webpack.

https://github.com/webpack/webpack/blob/8f87b50dc7ac24eb5c91fd0d55a22e34e252863c/test/__snapshots__/Cli.basictest.js.snap#L416

We had defined alias for only few config options which we had for webpack 4 which we removed in this PR.

--no-target Negative 'target' option.
-w, --watch Watch for files changes.
Copy link
Member

Choose a reason for hiding this comment

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

I think keeping short -w/-d and etc make sense, they are very popular, let's keep them, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we can add alias support for some popular flags devtool (-d), target (-t), --output-path (-o), --watch (-w)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally, we should add this in the webpack schema itself.
Or we can write logic to generate an alias property for each option in webpack-cli.
Or add some workaround logic to support alias for some popular options only (coming from webpack core).

Copy link
Member

Choose a reason for hiding this comment

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

Or we can write logic to generate an alias property for each option in webpack-cli.

I think so, it was my original idea, so we will support all options using short names, we can do it separatly

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Let's add them separately. In the meantime should I update the PR to keep the popular ones?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's keep popular options here, some of them we can kept for better compatibility

Copy link
Member Author

Choose a reason for hiding this comment

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

@snitin315 snitin315 force-pushed the refactor/rm-webpack-4-support branch from 9d2973d to dc5dc9b Compare July 27, 2022 03:25
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.

Looks good

@snitin315 snitin315 merged commit fc293ee into next Jul 27, 2022
16 of 17 checks passed
@snitin315 snitin315 deleted the refactor/rm-webpack-4-support branch July 27, 2022 09:25
snitin315 added a commit that referenced this pull request Sep 10, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Sep 17, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Sep 24, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Sep 24, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Oct 8, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Oct 22, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Nov 6, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
snitin315 added a commit that referenced this pull request Nov 8, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
alexander-akait pushed a commit that referenced this pull request Nov 15, 2022
BREAKING CHANGE: webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants