Closed JamesHenry closed 2 years ago
@JamesHenry Thank you so much for the excellent write up. I was able to reproduce the issue and have turned on partial Ivy compilation. There should now be a new 6.0.1 version published to NPM that includes Ivy support. Please let me know if that doesn't resolve your issue.
Once again, many kudos to you for your reproduction steps and explanation.
@mwootendev Sorry for the delay in coming back to you - I can confirm that the ivy update resolved the issue as hoped 👍 Thanks for providing that
Hi @mwootendev, thanks for the helpful library, I have just started helping a client migrate to Angular 13 and this package is proving to be the sticking point. They use jest (like the reporters of your two existing issues do) and I believe all of the issues can be solved by publishing an Ivy distribution per the latest guidance, full info below.
Describe the bug
I believe both of the open issues #48 and #49 are symptoms of the same point - the absence of an Ivy distribution of this library for use with Angular 13+ is problematic.
If you attempt to use this library with jest you will run into #49 if you do not run
ngcc
properly, and then #48 once you do.I see you currently have
"enableIvy": false
- is there a particular reason for this?One of the key parts of the guide for publishing Angular libraries (https://angular.io/guide/creating-libraries) is:
The
compilationMode
option should replace theenableIvy
one entirely AFAIK.All users currently see this when using the library as a result of the above:
Reproduction
If you want to trivially reproduce the two issues above you can create an Nx workspace with the Angular preset (because it wires up a working jest + Angular setup out of the box):
E.g.
And then install:
And update
app.component.ts
At this stage you will be able to reproduce #49 by running the tests (assuming ngcc hasn't yet run)
Then run:
...to trigger
ngcc
At this stage you will be able to reproduce #48 by running the tests