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(server): add liveReload option to enable/disable live reloading #1889

Merged
merged 9 commits into from May 16, 2019

Conversation

EslamHiko
Copy link
Member

  • 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

fix this pr : #1812

Breaking Changes

no

Additional Info

I hope everything works fine this time.

@codecov
Copy link

codecov bot commented May 16, 2019

Codecov Report

Merging #1889 into master will decrease coverage by 3.24%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1889      +/-   ##
==========================================
- Coverage   91.27%   88.03%   -3.25%     
==========================================
  Files          14       14              
  Lines         814      819       +5     
  Branches      257      260       +3     
==========================================
- Hits          743      721      -22     
- Misses         67       84      +17     
- Partials        4       14      +10
Impacted Files Coverage Δ
lib/utils/createConfig.js 92.59% <50%> (-0.81%) ⬇️
lib/Server.js 85.96% <60%> (-5.57%) ⬇️

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 1c2beff...ed88fa7. 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.

One note, my mistake, and we can merge

fs.writeFileSync(nestedFile, 'Heyo', 'utf8');
}, 1000);
});
});
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 move this test to own test file LiveReload.test.js

lib/Server.js Outdated
@@ -95,6 +95,7 @@ class Server {
this.hot = this.options.hot || this.options.hotOnly;
this.headers = this.options.headers;
this.progress = this.options.progress;
this.liveReload = this.options.liveReload;
Copy link
Member

Choose a reason for hiding this comment

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

Don't add here new options, you can see

// TODO this.<property> is deprecated (remove them in next major release.) in favor this.options.<property>
use this.options.liveReload everywhere

lib/Server.js Outdated
@@ -719,6 +720,10 @@ class Server {
this.sockWrite([connection], 'hot');
}

if (this.liveReload !== false) {
Copy link
Member

Choose a reason for hiding this comment

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

As written above please use this.options.liveReload

lib/Server.js Outdated
});

// disabling refreshing on changing the content
if (this.liveReload !== false) {
Copy link
Member

Choose a reason for hiding this comment

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

As written above please use this.options.liveReload

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.

Found new problem, we already fix it in other PR, looks you lose code

@EslamHiko
Copy link
Member Author

@evilebottnawi is this problem has something to do with the snapshots?

@alexander-akait
Copy link
Member

@EslamHiko should not

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, i think we need refactor tests, but let's do it in next PR

@alexander-akait
Copy link
Member

/cc @hiroppy feel free to merge

Copy link
Member

@hiroppy hiroppy left a comment

Choose a reason for hiding this comment

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

lgtm, I wait for CI.

@hiroppy hiroppy merged commit fc4fe32 into webpack:master May 16, 2019
@hiroppy
Copy link
Member

hiroppy commented May 16, 2019

Thanks

@kaiyoma
Copy link

kaiyoma commented May 22, 2019

Thanks so much for doing this! I just tested out the new version and everything works as I expect.

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