5

Hi I have a web application runnig on the Aurelia CLI.

From what I’ve read in the documentation, the Aurelia CLI runs always “bundled” and never targeting directly source files. By running the “au run –watch” command, Aurelia “listens” to file changes and recreates the app-bundle.js automatically. Sample output from console:

Starting 'readProjectConfiguration'...
Finished 'readProjectConfiguration'
Starting 'processMarkup'...
Starting 'processCSS'...
Starting 'configureEnvironment'...
Finished 'configureEnvironment'
Starting 'buildJavaScript'...
Finished 'processCSS'
Finished 'processMarkup'
Finished 'buildJavaScript'
Starting 'writeBundles'...
Tracing views/references...
Writing app-bundle.js...
Finished 'writeBundles'
Starting 'reload'...
Finished 'reload'

This is cool, but in my case it leads to a poor developer experience. When I come to work in the morning, any change I make is readily updated in the app.bundle, but after working for some time, the “buildJavaScript” process (see console output) takes always longer to finish, after a few hours of work even up to 30-40 seconds! For me, working as a developer and having to test many small changes, this is extremely painful.

I tried (and still do) from time to time to stop the “au run –watch” command and re-execute it again, and initially it gets a bit better, but after some time the problem is there again.

My question would be: is there a workaround for that, or some way to speed this up or to have it served directly from the source files and not the bundled version, or maybe some other solution? Could this be due to a memory leak in Aurelia itself?

UPDATE:

Every once in a while it gets so slow that it actually crashes. This is what I got today (and other few times) from the console:

==== Details ================================================

[1]: _tickCallback(aka _tickDomainCallback) [internal/process/next_tick.js:~108] [pc=000000C928AFCE81](this=000003B0DF48BE31 <a process with map 0000012166110B71>) {...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Mirko Lugano
  • 975
  • 1
  • 11
  • 26
  • 3
    I have noticed the same. This is not related to `aurelia-cli` only, same "slowing" performance happens in `jspm` based application when using `gulp watch` directly, which is eventually what `aurelia-cli` uses. So, maybe you could add `gulp` and `gulp-watch` tags to the question. Would love to find out if there's some way to fix/improve this... – Miroslav Popovic Nov 29 '16 at 14:56
  • 1
    thanx for the hint, I have added the tags. – Mirko Lugano Nov 29 '16 at 15:27

1 Answers1

0

This is a late answer, but for future reference I think it's important to point out that since the more recent Aurelia CLI releases this problem has been fixed.

The performance issue, together with some major stability issues, have thoroughly discussed in GitHub #293: Error in buildTypeScript: A project cannot be used in two compilations at the same time.

Which means that if you update the Aurelia CLI to v0.30 or higher, you'll experience a significantly better performance and stability.

Juliën
  • 9,047
  • 7
  • 49
  • 80
  • 1
    I have updated aurelia-cli to 0.31.3 and all other npm packages to their latest versions, it has gotten better but after a while it still gets slow (maybe not as slow as before, but still annoying). I still have to stop and restart the "watch" from time to time. – Mirko Lugano Oct 25 '17 at 09:11