Aurelia CLI app-bundle 自动更新变慢 [英] Aurelia CLI app-bundle automatic update gets slow

查看:13
本文介绍了Aurelia CLI app-bundle 自动更新变慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在 Aurelia CLI 上运行了一个 Web 应用程序.

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

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

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'

这很酷,但在我的情况下,它会导致开发人员体验不佳.当我早上上班时,我所做的任何更改都会在 app.bundle 中轻松更新,但是在工作一段时间后,buildJavaScript"过程(请参阅控制台输出)总是需要更长的时间才能完成,经过几个小时工作时间甚至长达 30-40 秒!对我来说,作为一名开发人员,必须测试许多小改动,这非常痛苦.

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.

我尝试(并且仍然这样做)不时停止au run –watch"命令并再次重新执行它,最初它会好一些,但一段时间后问题又出现了.

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.

我的问题是:是否有解决方法,或者有什么方法可以加快速度,或者直接从源文件而不是捆绑版本提供服务,或者其他解决方案?这可能是由于 Aurelia 本身的内存泄漏造成的吗?

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?

更新:

每隔一段时间它就会变得如此缓慢以至于它实际上崩溃了.这是我今天(以及其他几次)从控制台得到的:

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

推荐答案

这是一个较晚的答案,但为了将来的参考,我认为重要的是要指出,由于最近的 Aurelia CLI 版本已经修复了这个问题.

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.

性能问题,连同一些主要的稳定性问题,在 GitHub #293 中进行了深入讨论:buildTypeScript 中的错误:一个项目不能同时在两个编译中使用.

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.

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

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 app-bundle 自动更新变慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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