-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Speed-up the development build #1432
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
Labels
Comments
In this case, the clean and livereload can be notified only if something that matters changes. Good. |
PR coming today. |
mgechev
added a commit
that referenced
this issue
Oct 9, 2016
In dev executes tasks only when a specific file type has changed. Fix #1432.
mgechev
added a commit
that referenced
this issue
Oct 9, 2016
In dev executes tasks only when a specific file type has changed. Fix #1432.
mgechev
added a commit
that referenced
this issue
Oct 9, 2016
In dev executes tasks only when a specific file type has changed. Fix #1432.
mgechev
added a commit
that referenced
this issue
Oct 9, 2016
In dev executes tasks only when a specific file type has changed. Fix #1432.
mgechev
added a commit
that referenced
this issue
Oct 10, 2016
In dev executes tasks only when a specific file type has changed. Fix #1432.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Recently, while using the seed, I had to create a task which execution takes 5s. It is for svg sprite creation and compression but it was triggered on any file change. This is a lot for dev build since it blocks everything else, so the livereload cannot refresh the browser until the execution of the slowest task completes. I thought what we can do and with the current stateless task management (which is great but a bit limiting) there was no right way to approach.
Proposal
I was thinking that we can have a global state, which is mutated by
utils/seed/watch.ts
. So for instance:Later in the individual tasks, based on the file type we can check if any of the changed files requires their activation and can be skipped otherwise. For instance:
We can extend this even further by exporting not only a single function but a task object which processes only tasks of given type and/or has any other activation preconditions:
By default given task will be executed in all cases.
In order to keep the code DRYier, it'll be best to move the filtering logic in the task runner in
tasks_tools.ts
.Basically it'll be a type of a chain of responsibility with inversion of control, because the tasks are not the ones which decide if the rest of the tasks in the chain should be executed.
The text was updated successfully, but these errors were encountered: