Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #3

Open
lbialy opened this issue Dec 11, 2016 · 6 comments
Open

Updates #3

lbialy opened this issue Dec 11, 2016 · 6 comments

Comments

@lbialy
Copy link
Owner

lbialy commented Dec 11, 2016

Hey guys, I've been tracking progress being made in Angular 2, angular-cli and Webpack 2 communities in some of my free time, because of few things I'd like to incorporate into this seed:

  • Ahead of time (AoT) compilation of components - this should be handled by build pipeline too, but it's mutually exclusive with usage of any css preprocessors like the sass loader for angular templates I've been using. Last time I checked AoT compiler was unable to include other apps into it's compilation step and work on Webpack2 loader that would process AoT-compiled components or wrap AoT compilation and handle preprocessing of stylesheets before AoT was in very early stages.
  • Angular-cli + Webpack 2 integration is going forward and that's pretty nice. I am looking for a way to integrate play's SBT build to allow for cli commands that would be:
    a) executing Play as real backend for Angular2 app in development
    b) running webpack2 server that could mock backend with mock services
    Of course current state that allows for integration testing with ng2 app being tested with protractor using real Play backend has to stay. In my opinion such integration would allow for very nice and developer experience.
  • Webpack 2 is currently struggling with tree-shaking for typescript-generated code. This is actually a pretty big deal for a build system - I want to do whatever I can to provide a sensible platform for production builds and current sizes of generated packages, even after minification and gzip, are not satisfying. I even looked at the possibility of replacing webpack2 with rollup in regards of tree-shaking, but that would brake a lot of stuff and would cost a lot of time to get right (only to have to scrap it all down when rollup changes things).
  • And last but not least: Server-side rendering for Angular 2. I'm deeply interested in integration of Angular-Universal-compatible SSR library with this seed. This is not a priority, more of a long-term target. As far as I've been able to tell there were some attempts at doing this with embedded V8 in Java, so it's not completely impossible. I might steal borrow some code from those attempts, wrap them in some nice async scala interface and release that as a separate jar available optionally for this seed.

I'd like to update this seed before the new year with:

  • current ng-cli, angular2 and webpack2 versions
  • cli+sbt integration with option of running dev with mocked or play backend
  • got a Mac, Linux and Windows now, so I'll make this seed work on all platforms

Tree-shaking, AoT and SSR will have to wait for upstream I'm afraid. I'll have some free time between Christmas and New Year's Eve and I'm scheduling some time for this then.

Cheers!

This was referenced Dec 11, 2016
@lbialy
Copy link
Owner Author

lbialy commented Dec 11, 2016

Related issues and tools:

Issues:
webpack/webpack#2899 - webpack - tree shaking with typescript
angular/angular-cli#2901 - angular-cli - tree shaking with webpack2
angular/universal#280 - angular 2 universal - JVM support with J2V8 example

Tools:
https://www.npmjs.com/package/@ngtools/webpack - AoT compilation for WebPack, ng-cli team say they also support css preprocessors out of the box, whether this works with AoTPlugin remains to be found.

I'll be updating this post with more documentation and planned build pipeline arch.

@zcourts
Copy link

zcourts commented Dec 29, 2016

Will there be an upgrade path from the current seed to the updated version? I'm starting a new project but if updating will be tricky I could probably wait until the changes are in.

@lbialy
Copy link
Owner Author

lbialy commented Jan 4, 2017

Hey, sorry for delay. It won't be trivial due to migration to completely ng-cli based angular app management, but I'll try to provide upgrade path (I have one project using this seed and I will have to upgrade it too). I'll try to deliver on friday or saturday - 6th or 7th of january. You can take a look at these instructions to see the scope of change. Also some of the sbt-related files have to change from what I've seen till now.

@radha89
Copy link

radha89 commented Jan 23, 2017

Any idea when we can expect the upgrade?

Thanks!

@lbialy
Copy link
Owner Author

lbialy commented Feb 5, 2017

Updated to newest Angular 2 and Angular-CLI. Build system was refactored to use Angular-CLI only. I don't have precise migration path from old seed to this version - no time sadly :( - but I will try to add it ASAP.

Tree-shaking is still borked and not much progress have been achieved between Webpack and Uglifyjs teams.

Angular-universal on JVM is pretty far from stable for now, SSR with Java/Scala backend is not possible for now.

To do:

  • run on windows and linux (tested on mac only for now), Windows will probably explode :(

@lbialy
Copy link
Owner Author

lbialy commented Mar 5, 2017

Updated to Angular ^2.4.0 and Angular CLI 1.0.0.rc.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants