Support for Angular Universal


#1

Is support for server-side-rendering / angular-universal on the roadmap?
Right now the Ionic framework is tightly coupled with the DOMrenderer (it loads dom.js where it expects a window object).
This causes problems when I want to use angular-universal to render a page using node.


#2

I want to see this!
can ionic2 live with express and angular-universal.


#3

It is something that we’re looking into.

It does introduce some question on where it fits in with cordova apps, but it’s seems like something we need to get to work with PWA.

Expect to see some more info as time goes on!


#4

thanks for answer!
Someday , try to implement .


#5

First off, @max you guys are doing terrific work taking care of issues promptly and properly! Thanks.

I’m just curious have y’all made any progress on incorporating Universal?

Best!


#6

With so many changes in RC0, do you know if it still has DOM dependencies that are an issue with Angular Universal? Thinking about giving this a try and just wondering if there any updates on future Universal support for PWA. Thanks


#7

I’m currently looking into this. I would appreciate if anyone has looked into this might point me to an example repo outside the universal starter.


#8

Looks like universal is not possible atm. Looks like hammer.ts uses window atm. Going to play and see what workarounds I can try and make.


#9

Really interested to see if there’s a solution here. Just speculating but I wonder

  1. even though hammer.ts uses window, what happens when running NG Universal (because it contains mocks for objects like the window according to https://github.com/angular/universal/issues/282), and

  2. if using server-side DOM implementation like https://www.npmjs.com/package/jsdom might be part of a workaround or if better to wait for direction / support from Ionic team

It’s hard to say how Ionic would handle the run-time transition from server to client, and what browser-side calls might need to be re-made after everything is loaded. Good luck on the R+D!


#10

Thanks for giving me these references. I haven’t looked into universal too much since I hit those setbacks but will take a better look to see whats up. I’ve been hoping that lazy loading and possibly the closure compiler can bring the package size down enough to make a difference for me short term for performance. Also looking into prerender.io for seo and google crawler capabilities.


#11

Looks like there is work being done to handle it in this issue. https://github.com/angular/universal/issues/534


#12

HI Alex, have you tried Angular Universal with Ionic2. We are trying but not getting it working. Its not even building (considering our poor knowledge on javascript based frameworks). Is there any starter project for Ionic2 with universal. It would be a great help!