Why ionic serve got so slow after RC0?

its really irritating…ionic serve is working fine but whenever I are making any changes in any file its take a lot of time to reflect it in the browser. Previously upto beta 11 it used to show results immediately, but after RC0 i have to refresh browser like 2-3 time and sometimes even have to end the ionic serve command and again start it.
Is it happening only in my system…any solution?

1 Like

Same here: when editing a template, it takes 174s to recompile and “serve” it to browser: almost 3 minutes to wait for a small change in a template ??? Really ???

Additionally, if you modify 2 ts files in your app and save them simultaneously, it seems that the recompile process happens 2 times!

for me templateupdate is near to 13-14 seconds . whereas in beta11 it was ver very less.
@iignatov any way to decrease the templateUpdate time?

Same here, i think gulp tasks where much more simpler and faster. When i change some .ts file, the task for scss should not fire i think… i was using beta 11 too and really think that i’ll continuing to dev in it.

problem is that the whole building step is executed again and again… so rollupjs + tree shaking + ngc for compression and so on.

Maybe there should be an option for the cli, to only use rollupjs without the whole minification uglification and so on.

Simple create executable sources.

If you want to minifize and so on --> this should be in another task like ionic build dev or something like that.

Slow build became a real problem.

And also time after time, I’ve got this error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Please, bring Webpack back. It’s the best building solution nowadays!

2 Likes

So just to chime in a bit on this and add some notes as to why we went with rollup and why some of the changes are not as fast as before.

Rollup

So went with rollup for a few reasons. Primarily because it creates the smallest bundle possible. The same code that gets generated by webpack is much larger than what is generated by rollup. We want to be shipping the smallest bundle possible, something that webpack is lacking in when compared to rollup.

Rollup is also future facing. By default it expects to be fed ES2015 modules. While this might not mean anything to you as devs, for us it’s important. It’s using standards that are part of the language (as opposed to CommonJS). But if you need commonJS support, it’s easy to add a section of namedExports in a custom rollup.config.js. We’re working on documentation for this to make sure it is super clear what you need to do and whats going on underneath.

Serve changes

It’s true. Serve and live-reload take longer than they did compared to beta 11’s build setup. But it’s also important to understand whats going on underneath.

In Beta11’s build we would do the following.

  • Transpile/Bundle your TS -> ES5
  • Compiler your sass
  • copy/move your templates.

Thats it. It wasn’t an overly sophisticated setup, but it worked. With RC0, and the update to Angular 2 final, we got a chance to expand this and take advantage of the new tools that allow us to ship a smaller bundle. In the RC0 build process, we’re have the following setup.

  • Transpiling source code to ES5 JavaScript
  • Ahead of Time (AoT) template compiling
  • Just in Time (JiT) template compiling
  • Bundling modules for faster runtime execution
  • Treeshaking unused components and dead-code removal
  • Generating CSS from bundled component Sass files
  • Autoprefixing vendor CSS prefixes
  • Minifying JavaScript files
  • Compressing CSS files
  • Copying src static assets to www
  • Linting source files
  • Watching source files for live-reloading

The most important part here is the AoT compilation, which will convert your html over to a TS Class, so we can have a much faster app start up. All things people have been asking about for quite some time.

Now we’re working on improving the build process to make sure we’re doing it as fast as possible. It’s important to know that we are aware of the build process weak points. We are iterating fast and shipping improvements quickly.

One of these improvements will be a faster dev build, so it wont do things like AoT, tree shaking and minification during ionic serve , like @bengtler has mentioned.

So… Long story short :smile:

We’re aware and are fixing things to be faster

9 Likes

Thanks a lot for the info sir :sunny:
waiting eagerly for the update :grin:

the same problem!
try to use explorer it make it little faster

@mhartington

i am a simple developer… i see a good explanation of a topic… i like

Thanks for the explanation!

greets

1 Like