Aurelia CLI应用程序包自动更新速度缓慢 [英] Aurelia CLI app-bundle automatic update gets slow

查看:131
本文介绍了Aurelia CLI应用程序包自动更新速度缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我读过的在文档中,Aurelia CLI始终捆绑文件。通过运行au run-watch命令,Aurelia监听文件更改并自动重新创建app-bundle.js。从控制台输出示例:

pre $ 启动'readProjectConfiguration'...
完成'readProjectConfiguration'
开始' processMarkup'...
启动'processCSS'...
启动'configureEnvironment'...
完成'configureEnvironment'
启动'buildJavaScript'...
完成'processCSS'
完成'processMarkup'
完成'buildJavaScript'
启动'writeBundles'...
跟踪视图/引用...
编写应用程序包.js ...
完成'writeBundles'
开始'重新加载'...
完成'重新加载'

这很酷,但在我的情况下会导致糟糕的开发者体验。当我在早上上班时,我所做的任何更改都可以在app.bundle中更新,但工作一段时间后,buildJavaScript过程(请参阅控制台输出)需要花费更长时间才能完成,工作甚至高达30-40秒!对于我来说,作为一名开发人员,不得不测试很多小的变化,这是非常痛苦的。



我试着(并且仍然这样做)不时地停止 au run -watch命令并重新执行它,最初它会好一些,但过了一段时间问题又出现了。



我的问题是:有没有解决方法,或者有一种方法来加速或直接从源文件而不是捆绑版本,或者其他解决方案?这可能是由于Aurelia本身存在内存泄漏吗?



更新:



每隔一段时间变得非常缓慢,实际上崩溃了。
这就是我从控制台得到的今天(和其他几次):

  ====详细信息= =============================================== 

[1]:_tickCallback(aka _tickDomainCallback)[internal / process / next_tick.js:〜108] [pc = 000000C928AFCE81](this = 000003B0DF48BE31<地图为0000012166110B71的过程){...

致命错误:CALL_AND_RETRY_LAST分配失败 - JavaScript堆内存不足


解决方案

这是一个迟到的答案,但为了将来的参考,我认为必须指出,自从最近的Aurelia CLI发布以来,这个问题已经得到解决。



性能问题以及一些主要的稳定性问题已在 GitHub#293: buildTypeScript中的错误:一个项目不能同时在两个编译中使用

这意味着如果您将Aurelia CLI更新为 v0.30或更高版本,您将体验到更好的性能和稳定性。

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

解决方案

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.

这篇关于Aurelia CLI应用程序包自动更新速度缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆