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

Allow live-reload to be disabled from command line. #510

Merged
merged 1 commit into from
Apr 29, 2014

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Apr 29, 2014

Fixes #509.

@twokul
Copy link
Contributor

twokul commented Apr 29, 2014

@rjackson mind adding tests?

@twokul
Copy link
Contributor

twokul commented Apr 29, 2014

LGTM otherwise

@tomdale
Copy link
Contributor

tomdale commented Apr 29, 2014

In the interests of brevity and symmetry with other CLI tools, should the flag be --no-livereload instead of --disable-live-reload?

@@ -9,6 +9,10 @@ exports.start = function(options) {
var leek = this.leek;
var ui = this.ui;

if (options.disableLiveReload) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

return Promise.reject() for consistency

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, good catch

Copy link
Member Author

Choose a reason for hiding this comment

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

Since we are calling Promise.all in the server command, returning Promise.reject would kill the expressServer (since Promise.all will return as soon as the first promise rejects).

I will use Promise.resolve as this isn't a failure case (since the user opted out).

@MajorBreakfast
Copy link
Contributor

@twokul I don't think that adding a test is necessary since we're planning to drop LiveReload in favor of a script that gets injected into the page. (No browser plugin needed)

@twokul
Copy link
Contributor

twokul commented Apr 29, 2014

@MajorBreakfast when is it going to happen? if it's gonna be a part of 0.0.25, I'm ok with not adding tests, otherwise we probably should ;)

@MajorBreakfast
Copy link
Contributor

@twokul Dunno. How would the test for this look like? It's probably a lot longer than the if statement that implements this functionality...

@rwjblue
Copy link
Member Author

rwjblue commented Apr 29, 2014

Updated to use --live-reload as the flag (and using ember server --live-reload=false would disable live reloading).

@rwjblue
Copy link
Member Author

rwjblue commented Apr 29, 2014

Now with tests.

@@ -9,6 +9,10 @@ exports.start = function(options) {
var leek = this.leek;
var ui = this.ui;

if (!options.liveReload) {
return Promise.resolve('live-reload is disabled');
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks exotic. But if it makes @twokul happy...

Enabled: resolves to undefined
Disabled: resolves to a String ^^' yah...

rwjblue added a commit that referenced this pull request Apr 29, 2014
Allow live-reload to be disabled from command line.
@rwjblue rwjblue merged commit 9ee939c into ember-cli:master Apr 29, 2014
@rwjblue rwjblue deleted the allow-disabling-live-reload branch April 29, 2014 15:09
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.

Document how to disable LiveReload
4 participants