Urigo / angular-meteor

Angular and Meteor - The perfect stack

Home Page:https://www.angular-meteor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Meteor Universal w/ AOT questions

bouchepat opened this issue · comments

Hi,

I'm planning on adding angular universal as per example MeteorCLI/universal and have few questions:

  • How to run the example with AOT on Windows (AOT=1 meteor), I tried:

    set AOT=1 meteor
    
    set AOT=1
    meteor
    
  • The doc mentions:

    If you want to disable Universal in Development, you can do Meteor.isProduction check before onPageLoad

    Where is onPageLoad?

  • Has anyone run into some issues while deploying such app in production?

  • Once the app is deployed, does it run automatically with AOT?

Thank you.

  • You need to define env variable AOT to enable AOT in development mode.
  • onPageLoad is part of server-render package of Meteor. You can check Meteor docs about it.
  • What kind of issues you have in production?
  • It compiles your app with AOT compiler of Angular by default.
    You can check our examples about it;
    https://github.com/Urigo/angular-meteor/tree/master/examples/MeteorCLI

Thanks @ardatan for the quick response. Currently our website is running meteor 1.7.0.1 deployed on a Linux server, I'm using the angular compiler package similar to the bare example. Although I don't have any major problems, I would like to improve the loading time (between 2 and 3 s initial load, mostly spent in evaluating scripts) and to provide support or better support for older browsers and mobile devices (my boss's iPhone 5 won't load our website). I'm also using Prerender for SEO, paying service.
I think angular universal and server side rendering should solve these problems.

Before I make any changes to our large project I wanted to make sure I understand well the concept of server side rendering. I did started with the example provided in the repo, but was not able to set the AOT env variable on the command line on my windows development machine as per instructions (maybe setting it in the code might be easier).

I asked the question "Has anyone run into issues while deploying such app in production?", because I've had issues when deploying our website in the past (no Galaxi deployment), especially when upgrading Meteor and was wondering if there are some common pitfalls that I could avoid or maybe if anyone had some suggestions.

Since this is my company website, I must be very mindful of performance, SEO or any other issues...

Thanks

Hello.
I have a question. How can we add SSR using Angular Universal in this Angular CLI + Meteor project?
When I used the Angular Universal guide, I encountered errors like.

ERROR in node_modules/meteor-rxjs/dist/ObservableCursor.d.ts:19:30 - error TS2503: Cannot find namespace 'Mongo'.

Thank you!