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: backward compatible flags for dev server #2652

Merged
merged 2 commits into from
Apr 24, 2021

Conversation

anshumanv
Copy link
Member

What kind of change does this PR introduce?
fix/feat/refactor?

Did you add tests for your changes?
tested manually, no way to test rn

If relevant, did you update the documentation?
no need I think

Summary
we're migrating all flags to a single format, core/cli built in/server flags so this is to handle backward compatibility with dev server flags in migration to new format, once this is released we can go ahead with the migration

Ref webpack/webpack-dev-server#3213

Does this PR introduce a breaking change?
no

Other information

@anshumanv anshumanv requested a review from a team as a code owner April 21, 2021 19:06
@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #2652 (1449e1e) into master (a56761e) will decrease coverage by 0.18%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2652      +/-   ##
==========================================
- Coverage   95.70%   95.52%   -0.19%     
==========================================
  Files          30       30              
  Lines        1491     1498       +7     
  Branches      429      430       +1     
==========================================
+ Hits         1427     1431       +4     
- Misses         64       67       +3     
Impacted Files Coverage Δ
packages/serve/src/index.ts 90.62% <66.66%> (-4.12%) ⬇️

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 a56761e...1449e1e. Read the comment docs.

@anshumanv
Copy link
Member Author

I don't know how to cover this in tests..

@snitin315
Copy link
Member

snitin315 commented Apr 23, 2021

I don't know how to cover this in tests.

We can test after a new release of webpack-dev-server with the new format, or test in dev-server after the new webpack-cli release.

snitin315
snitin315 previously approved these changes Apr 23, 2021
Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM

@snitin315 snitin315 changed the title feat: backward compatible flags for dev server refactor: backward compatible flags for dev server Apr 23, 2021
evenstensberg
evenstensberg previously approved these changes Apr 23, 2021
Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

lgtm

// new flag format
// { flag1: {}, flag2: {} }
return Object.values(flags);
})();
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 we can simplify it, I will finish 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Left it because it would be easier to simplify after - #2626, as both configs will be objects so easy merge

@alexander-akait
Copy link
Member

Small refactor


// New options format
// { flag1: {}, flag2: {} }
return Object.keys(options).map((key) => {
Copy link
Member

Choose a reason for hiding this comment

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

We will avoid it after switch on object options (part of perf)

Copy link
Member Author

Choose a reason for hiding this comment

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

yep thanks

@alexander-akait alexander-akait merged commit 895c009 into master Apr 24, 2021
@alexander-akait alexander-akait deleted the server-flags branch April 24, 2021 17:22
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.

5 participants