angular / closure-demo

MIT License
115 stars 27 forks source link

Hot code reload during development #14

Closed benbro closed 6 years ago

benbro commented 6 years ago

Is there a setup for hot code reload similar to the webpack setup or do I need to re-compile each time I make a change?

Are there plans to sync the angular version in this demo with the latest release?

Are there examples for adding third-party npm modules? Is it possible to add static files like CSS and images?

Is this setup recommended for production or is it just a prof of concept?

MarkPieszak commented 6 years ago

I believe this is more of a proof of concept at this moment @benbro

alexeagle commented 6 years ago

It's actually not even wise to do hot code reload - closure compiler is a production bundler and too slow to run in development mode. We do have plans to externalize our development server, see https://github.com/bazelbuild/rules_typescript/issues/19

https://github.com/angular/angular/tree/master/integration/hello_world__closure is the always-up-to-date example because it's run in the Angular CI. I could sync this repo again, I'll certainly do that for Angular 5.0.0.

Third-party libraries with Closure Compiler is a tricky problem, not specific to Angular. Usage varies among libraries. I hope we'll find more time to help with this, something like https://github.com/alexeagle/angular-closure-compatibility to give examples for each library, or get the Closure Compiler team to prioritize this more.

Google apps run with closure compiler in production. This repo demonstrates a supported use of Angular, so yes, we recommend it for production.

benbro commented 6 years ago

Thank you for your answer.

Do I need to run something like webpack-dev-server for dev and closure-compiler for production or will your development server replace the need for webpack-dev-server?

alexeagle commented 6 years ago

This repo doesn't demonstrate anything useful for development mode - you'd still need some devserver like webpack, or possibly check out https://github.com/alexeagle/angular-bazel-example for a Bazel devserver