Code Monkey home page Code Monkey logo

Comments (4)

pmcochrane avatar pmcochrane commented on June 1, 2024

Is there any particular area you think you need to optimise? Compiling with aot changes the html until it is unrecognisable so I don’t know what you are targeting

from angular-meteor.

bouchepat avatar bouchepat commented on June 1, 2024

Once the app is build and deployed (not in development), all the HTML templates are imported as-is, see screenshot below:

image

This is how I build the meteor/angular app:

meteor build ../output --architecture os.linux.x86_64

and I deploy on a linux server.

Am I missing something?

Thanks.

EDIT:
Also to add, as per @ardatan comment in ##1895 AOT is the default in production, so I'm assuming AOT is also the default for built and deployed app. Right?

I did further testing on a staging server around AOT on the app running in development:

  • Setting AOT=1 there is no .html files downloaded but instead dynamic-import fetch is used.
  • Setting AOT=0 (or not adding it entirely) all the templates are downloaded .html (as-is) (same as the screenshot above).

The tests here seems fine to me, but I'm questioning AOT on a build/deployed app.

Meteor version: 1.8.2
Angular versions: 8.2.14
Angular compiler version: 0.3.4

Thanks

from angular-meteor.

pmcochrane avatar pmcochrane commented on June 1, 2024

I don't think you are building with AOT. Try this for your build command:

AOT=1 meteor build ../output --architecture os.linux.x86_64

Look in the build folder and you should not find any html files as they should all have been compiled by AOT to ngfactory.js files. They are unreadable by humans but browsers can read them much faster than having to compile angular for each component. The benefit is you angular app is much faster to load.

I'm pretty sure the compiler mentions that it does AOT stuff when it is turned on and it takes a lot longer than a normal build because of this. I can't remember as I'm using a modified version of the compiler with extra logging turned on.

from angular-meteor.

bouchepat avatar bouchepat commented on June 1, 2024

Looks like it did solve my problem. Thanks a lot.

I looked again here https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-compilers and it does mention that AOT mode is enabled by default as opposed to Three-shaking mode. Anyways I'm glad it's fixed.

from angular-meteor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.