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

Angular Meteor Universal w/ AOT questions #1963

Open
bouchepat opened this issue Feb 18, 2019 · 3 comments
Open

Angular Meteor Universal w/ AOT questions #1963

bouchepat opened this issue Feb 18, 2019 · 3 comments
Labels

Comments

@bouchepat
Copy link

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.

@ardatan
Copy link
Collaborator

ardatan commented Feb 19, 2019

  • 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

@bouchepat
Copy link
Author

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

@Muhammad-Zaryaab-Shahbaz

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!

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

No branches or pull requests

3 participants