Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

This Angular DS Template Doesn't Work with Ivy @angular - 9.0.0-rc6 #1

Open
mappmechanic opened this issue Jan 6, 2020 · 17 comments
Open

Comments

@mappmechanic
Copy link

This Angular DS Template Doesn't Work with Ivy @angular - 9.0.0-rc6

When I try to compile using Ivy, it gives me weird errors about NgModule meta info etc.

@psamusev
Copy link

psamusev commented Mar 4, 2020

Are there any updates on it?

@mappmechanic
Copy link
Author

Actually, I tried to update all package json versions myself and it seemed to work.

@psamusev
Copy link

psamusev commented Mar 6, 2020

I found this in the Ionic repo - https://github.com/ionic-team/ionic/blob/master/core/stencil.config.ts#L92. Seems new way of declaring angular targets

@psamusev
Copy link

psamusev commented Mar 6, 2020

@mappmechanic did you make only package.json update? Can you please share your package.json here?

@rsurjano
Copy link

could you provide us @mappmechanic more details plz

@MMT-LD
Copy link

MMT-LD commented Aug 24, 2020

@rsurjano So the fix for me (not sure if its the correct fix) - was to set in angular.json "aot": false

@mappmechanic
Copy link
Author

It is not the correct fix, we should never set 'aot' to false without any purpose or else our bundle size will shoot up as the JIT compiler will be bundled in our dist files.

@mappmechanic
Copy link
Author

@rsurjano @psamusev Please update the packages of each dependency given in package json, example for all the angular dependencies based on your latest angular project. Then it will work automatically with some minor tweaks. As the changes I have done our in an enterprise github instance, I cannot share that code.

@MMT-LD
Copy link

MMT-LD commented Aug 27, 2020

@mappmechanic Yeah, sorry i meant for my project which is just a POC and for the short term until the packages were updated. I probably should have been more clear with my comment and use case 😉 What tweaks were required other then bumping the versions?

@ZuBB
Copy link

ZuBB commented Sep 23, 2020

Hello everyone!

I think I faced with same issue. I walked through all comments here and here is my summary:

  • its true that bindings cooked by this template cant be smoothly consumed in final app;
  • I looked into @psamusev's comment and it seems irrelevant to me (sorry @psamusev :( );
  • I tried to google and found that there 2 advices on those error message we get play with aot and ivy-related flags in configs. I checked and turning off aot in angular.json does the trick. I guess you know what downsides it brings. But..

Hope ionic team/@jthoms1 will spare some time and update this template and corresponding docs for angular v10+.

upd/edit: would be nice if someone can confirm my findings

@nikbabchenko
Copy link

@ZuBB , @jthoms1 any updates on this?

@ZuBB
Copy link

ZuBB commented Oct 21, 2020

@nikbabchenko nothing new from my side. angular version of our example app is considered 2nd level priority..

@nikbabchenko
Copy link

@ZuBB, cool!
will check on the weekend if it works for me.

@eXXeption
Copy link

eXXeption commented Nov 6, 2020

As I stumbled upon the ivy issue too, I want to share my workaround

TL;DR: Just use a angular library as the wrapper project.

  1. Create new angular project with angular 10 via angular cli
  2. Create a library in this project
  3. Copy the proxy file, utils and module into the library and remove all other components/services which were generated
  4. Adjust public-api to export module and proxy file
  5. Build and publish the library

For me atleast this seems to be working fine. Angular detects the components as valid ivy components, autocompletion in WebStorm works.
Checked with webpack bundle analyzer and only the used components are build in the bundle, seems like treeshaking is working fine too.

@pranav-js
Copy link

@eXXeption urgent help, please. If I create a library in this project, is there a way to consume the library in that project (in which u created library) without publishing anywhere?. TIA.

@eXXeption
Copy link

@eXXeption urgent help, please. If I create a library in this project, is there a way to consume the library in that project (in which u created library) without publishing anywhere?. TIA.

tsconfig -> path mappings do the trick

@pranav-js
Copy link

pranav-js commented Dec 24, 2021

@eXXeption urgent help, please. If I create a library in this project, is there a way to consume the library in that project (in which u created library) without publishing anywhere?. TIA.

tsconfig -> path mappings do the trick

could you please post sample code :( sorry for it. but I am clueless, working with stencil and angular mono repo like structure for first time.

update: Got it👍 thanks a lot

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

No branches or pull requests

8 participants