ionic-team / stencil-ds-angular-template

This is an example repo of building plugins.
MIT License
13 stars 9 forks source link

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

Open mappmechanic opened 4 years ago

mappmechanic commented 4 years ago

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 commented 4 years ago

Are there any updates on it?

mappmechanic commented 4 years ago

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

psamusev commented 4 years ago

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 commented 4 years ago

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

rsurjano commented 4 years ago

could you provide us @mappmechanic more details plz

MMT-LD commented 4 years ago

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

mappmechanic commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

Hello everyone!

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

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 commented 4 years ago

@ZuBB , @jthoms1 any updates on this?

ZuBB commented 4 years ago

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

nikbabchenko commented 4 years ago

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

eXXeption commented 4 years ago

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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

@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