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

fix(hot): enable hot option as default #2546

Merged
merged 5 commits into from Apr 28, 2020

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented Apr 28, 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?

Updated.

Motivation / Use-Case

The hot option is as default from now on.

Breaking Changes

yes

Additional Info

@codecov
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #2546 into feature/upgrade-deps will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                  Coverage Diff                  @@
##           feature/upgrade-deps    #2546   +/-   ##
=====================================================
  Coverage                 93.40%   93.40%           
=====================================================
  Files                        34       34           
  Lines                      1334     1335    +1     
  Branches                    380      381    +1     
=====================================================
+ Hits                       1246     1247    +1     
  Misses                       85       85           
  Partials                      3        3           
Impacted Files Coverage Δ
lib/utils/createConfig.js 96.39% <ø> (-0.07%) ⬇️
lib/Server.js 96.39% <100.00%> (+0.02%) ⬆️
lib/utils/addEntries.js 100.00% <100.00%> (ø)
lib/utils/updateCompiler.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 023c194...1ce649c. Read the comment docs.

lib/Server.js Outdated

if (this.hot) {
this.options.hot = true;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do not use this.options.hot only (avoid using this.hot)?

Copy link
Member Author

@hiroppy hiroppy Apr 28, 2020

Choose a reason for hiding this comment

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

addEntries checks this.options.hot so we need to add true when this.hot is true. So you want to delete hotOnly(or this.hot) or hotOnly should be added true as well?

Copy link
Member

Choose a reason for hiding this comment

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

Can we rewrite code on using this.options.hot only. What do you think about - this.options.hot: boolean | "only"?

Copy link
Member Author

@hiroppy hiroppy Apr 28, 2020

Choose a reason for hiding this comment

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

ok, understood. so we need to rewrite this line(

if (this.hot) {
). I'll update this.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally - avoid using this.[propertyFromOptions] in favor this.options.[property] in all code, but we can do it in the separate PR

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, I'll work on this on Next branch.

Copy link
Member

Choose a reason for hiding this comment

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

Please remove this.hot in this PR in favor this.options.hot

@@ -86,7 +97,6 @@ class Server {
this.contentBaseWatchers = [];

// TODO this.<property> is deprecated (remove them in next major release.) in favor this.options.<property>
Copy link
Member

Choose a reason for hiding this comment

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

Remove TODO

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? this task hasn't been completed.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, yes, let's keep it

@hiroppy
Copy link
Member Author

hiroppy commented Apr 28, 2020

I've deleted hotOnly option but CI will fail because e2e/client.js is broking now. I need to investigate it.

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.

Good job! One note, but we can keep it as is to avoid misleading

@@ -15,7 +15,7 @@ const status = {
currentHash: '',
};
const options = {
hot: false,
hot: true,
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 should not change it, because it breaks hot: false logic, we run .hot() when hot enabled, but if we use hot: false we doesn't run .hot() and default value now is true, so it can break logic for hot: false

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, I fixed it. The CI's error was because of this.

@hiroppy hiroppy changed the title fix(hot): enable hot option as a default fix(hot): enable hot option as default Apr 28, 2020
@hiroppy hiroppy force-pushed the feature/enable-hot-option branch 2 times, most recently from d313992 to 5bf0372 Compare April 28, 2020 15:18
const swap = res[0];
res[0] = res[1];
res[1] = swap;
}
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 need it?

Copy link
Member Author

@hiroppy hiroppy Apr 28, 2020

Choose a reason for hiding this comment

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

It was deleted. just for my debugging to resolve the CI issue. The reason is #2546 (comment).

@hiroppy
Copy link
Member Author

hiroppy commented Apr 28, 2020

TransportMode.test.js is really flaky. The order of snapshot often is not fine between v5 and v4.

Understood this thing. This error has already existed before. In this time, we had changed the default value from false to true so we were able to notice it.

@hiroppy hiroppy force-pushed the feature/enable-hot-option branch 2 times, most recently from 754d081 to ba99d38 Compare April 28, 2020 16:29
@@ -14,18 +14,21 @@ describe('transportMode client', () => {
{
title: 'sockjs',
options: {
hot: false,
Copy link
Member Author

@hiroppy hiroppy Apr 28, 2020

Choose a reason for hiding this comment

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

This test has been set the value as false from before.(currently, we set the default value as true so we need to add this option to here)

@hiroppy
Copy link
Member Author

hiroppy commented Apr 28, 2020

@evilebottnawi CI is green, please review again.

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.

Good job, thanks!

@alexander-akait alexander-akait merged commit 5e183c0 into feature/upgrade-deps Apr 28, 2020
@alexander-akait alexander-akait deleted the feature/enable-hot-option branch April 28, 2020 17:10
@alexander-akait
Copy link
Member

Oh, we merge it into feature/upgrade-deps 😞

alexander-akait pushed a commit that referenced this pull request Apr 29, 2020
* chore(deps): upgrade deps

* style: run prettier

* test: update

* ci: remove Node@8

* test(cli): add windows support

* chore(deps): downgrade puppeteer

* chore(deps): downgrade some deps

* fix(hot): enable hot option as default (#2546)

BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }`

* fix: remove lazy and filename options (#2544)

BREAKING CHANGE: `lazy` and `filename` options was removed
alexander-akait pushed a commit that referenced this pull request May 8, 2020
* chore(deps): upgrade deps

* style: run prettier

* test: update

* ci: remove Node@8

* test(cli): add windows support

* chore(deps): downgrade puppeteer

* chore(deps): downgrade some deps

* fix(hot): enable hot option as default (#2546)

BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }`

* fix: remove lazy and filename options (#2544)

BREAKING CHANGE: `lazy` and `filename` options was removed
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

2 participants