Skip to content

chore(dev-app): prevent multiple reloads per file change #1762

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

Merged
merged 1 commit into from
Nov 9, 2016

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 7, 2016

Prevents the local dev app from reloading 5-6 times whenever a file changes. Adds a filter that only watches for the bundle (which also contains all of the CSS and HTML), theme changes and changes to the demo apps.

Fixes #1681.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 7, 2016
@jelbourn
Copy link
Member

jelbourn commented Nov 7, 2016

R: @hansl

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

1 nit on typing. Good work!

@@ -187,7 +187,7 @@ export function vendorTask() {


/** Create a task that serves the dist folder. */
export function serverTask(liveReload = true,
export function serverTask(liveReload: boolean | { enable: boolean, filter: Function } = true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Function => (filename: string, callback: (boolean) => void)

@crisbeto crisbeto force-pushed the 1681/devapp-reloads branch from 311d2bd to f7d400b Compare November 8, 2016 20:47
@crisbeto
Copy link
Member Author

crisbeto commented Nov 8, 2016

Updated @hansl.

export type livereloadOptions = boolean | {
enable: boolean,
filter: (filename: string, callback: (isAllowed: boolean) => void) => void;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Semicolon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you referring to the comma after enable or adding a semicolon after the export? If it's the latter, none of the other exports use a semicolon.

export function serverTask(liveReload = true,
streamCallback: (stream: NodeJS.ReadWriteStream) => void = null) {
export function serverTask(liveReload: livereloadOptions = true,
streamCallback: (stream: NodeJS.ReadWriteStream) => void = null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Left align with liveReload above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Prevents the local dev app from reloading 5-6 times whenever a file changes. Adds a filter that only watches for the bundle (which also contains all of the CSS and HTML), theme changes and changes to the demo apps.

Fixes angular#1681.
@crisbeto crisbeto force-pushed the 1681/devapp-reloads branch from f7d400b to 5227bc3 Compare November 8, 2016 21:29
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

LGTM

@hansl hansl added action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 8, 2016
@jelbourn jelbourn merged commit 51667d7 into angular:master Nov 9, 2016
rolandjitsu pushed a commit to rolandjitsu/material2 that referenced this pull request Nov 10, 2016
Prevents the local dev app from reloading 5-6 times whenever a file changes. Adds a filter that only watches for the bundle (which also contains all of the CSS and HTML), theme changes and changes to the demo apps.

Fixes angular#1681.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local dev setup triggering multiple reloads
4 participants