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

feat: enable compress by default #3303

Merged
merged 3 commits into from May 17, 2021
Merged

feat: enable compress by default #3303

merged 3 commits into from May 17, 2021

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented May 17, 2021

  • 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?

Yes

Motivation / Use-Case

Enable compress by default

Breaking Changes

Maybe

Additional Info

No

@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #3303 (50f200a) into master (88468b6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3303   +/-   ##
=======================================
  Coverage   95.55%   95.56%           
=======================================
  Files          34       34           
  Lines        1260     1262    +2     
  Branches      357      358    +1     
=======================================
+ Hits         1204     1206    +2     
  Misses         52       52           
  Partials        4        4           
Impacted Files Coverage Δ
lib/utils/normalizeOptions.js 100.00% <100.00%> (ø)

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 88468b6...50f200a. Read the comment docs.

@alexander-akait
Copy link
Member

hm, do you think it should be true by default?

@snitin315
Copy link
Member Author

Yes, I also see it in TODO https://github.com/webpack/webpack-dev-server/projects/1#card-19879364

Copy link
Member

@anshumanv anshumanv left a comment

Choose a reason for hiding this comment

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

need update docs

To run this example, run this command in your console or terminal:

```console
npm run webpack-dev-server -- --open --no-compress
Copy link
Member

Choose a reason for hiding this comment

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

we run webpack serve right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it is script

"webpack-dev-server": "node examples/run-example.js",

Copy link
Member

Choose a reason for hiding this comment

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

looks good then

Copy link
Member

Choose a reason for hiding this comment

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

Let's change it to npx webpack serve in future PRs

Copy link
Member

Choose a reason for hiding this comment

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

will take care

@snitin315 snitin315 merged commit 4d251b5 into master May 17, 2021
@snitin315 snitin315 deleted the enable-compress branch May 17, 2021 13:17
@Den-dp
Copy link

Den-dp commented May 20, 2021

@snitin315 I thought that reading (and writing) the content served in the memory - is the fastest thing that can be possible.

And adding compression for the in-memory server will only lead to more CPU usage, and may slow down a feedback loop for the developer (longer refresh time).

In theory, after this change, we will pay more CPU load for in-memory content compression, and un-compression (by Express and the browser). 🤔

@alexander-akait
Copy link
Member

@Den-dp yes, but in other case HMR and live reloading will be faster because you will get compressed sources, we collect feedback and maybe revisit it, but I think it is better to have fast development env

@Den-dp
Copy link

Den-dp commented Aug 13, 2021

@alexander-akait looks like @sokra also hit a similar problem with enabling compression by default webpack/webpack#13962

@alexander-akait
Copy link
Member

it is another problem

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.

None yet

4 participants