Comments (10)
Well, entryComponents
are still required in ViewEngine apps. They are not required in Ivy apps. The default engine for v9 is Ivy and your apps at http://sdk.uniodigital.com.br is indeed an Ivy app (hence it doesn't indeed require entryComponents
).
I don't know how you create the StackBlitz project (maybe through their API?), but it seems to create a ViewEngine app, which requires entryComponents
. StackBlitz has a checkbox in the "Settings" panel, where you can turn Ivy on. When I turned Ivy on in StackBlitz, I got the error: ngcc failed to run on @unio/[email protected].
So, this seems to be somehow related to StackBlitz's setup. Maybe this is due to the format that StackBlitz uses. IIRC, it tries to use CommonJS/UMD (i.e. the main
property in each dependency's package.json
). By default, Angular CLI apps use es2015. So, maybe ngcc can successfully process our library's es2015
format, but not its main
format.
You can try running the following command locally and see if you get any errors:
./node_modules/.bin/ngcc --create-ivy-entry-points --first-only --properties main module --target @unio/components
from ngcc-validation.
Ok, I'll forward it to them. Thank you very much for your help :)
from ngcc-validation.
@eestein, you cannot push directly to repositories that you don't have write access to. You need to fork this repository, create a new branch with your work (e.g. adding your library) and then create a pull request on this repo.
Let us know if you run into any problems.
Also, not sure what validation you are referring to or what this has to do with your library working with StackBlitz.
I am closing this issues, since it is not actionable on our part, but feel free to continue the discussion below.
from ngcc-validation.
@gkalpak thanks.
Whenever I try to use my library on stackblitz I get an error after they run ngcc
on it. After much research and not finding the problem (the library runs fine on 2 angular 9 projects running in production - it also worked fine on stackblitz while on angular 8) I read this article https://indepth.dev/the-angular-ivy-guide-for-library-authors/ which mentioned this:
The Angular compatibility compiler can require some changes to our libraries. If we want to verify that our library works with ngcc, we should at it to the Angular Ivy library compatibility validation project by the Angular team.
Hence why I'm here. Is this not the case? Isn't the problem my library not being added to this repo?
Thank you
from ngcc-validation.
As mentioned by the article, adding the library to this project can be done to verify that it works with ngcc (or rather that it continues to work as we release new versions). But in no way is this mandatory for the library to work with ngcc.
This repo is just a giant Angular CLI workspace with hundreds of apps that are processed by ngcc (via ng build
among other methods) to verify that ngcc (the Angular Compatibility Compiler) does not unexpectedly breaks an library.
If you want to make your library work with ngcc (and thus with Ivy), you don't need this repo. You can just create a simple Angular CLI app that uses your library, attempt to build that app (which will run ngcc implicitly), see what breaks and fix it.
from ngcc-validation.
That's the thing... I did that and it works nicely with the apps I created. No errors. I pulled the ngcc-validation project, added my lib and it's working there as well. Maybe you can shed some light here?
To confirm, as I mentioned, I pulled the project, added my lib and ran ng build mylib
and it built:
There were some errors, but only on a @alfresco
lib:
Do you think maybe you could point me in the right direction here? This project was the closest I got to "understanding" the problem.
Thanks.
from ngcc-validation.
Can you show an example of it failing on StackBlitz? Maybe it is a StackBlitz issue.
from ngcc-validation.
@gkalpak sure, if you click here http://sdk.uniodigital.com.br/#/components/notification/examples and click on the first StackBlitz button you'll see what I mean. It works nicely on the page above, if you click on "Notificar" button, but if you try to open it on StackBlitz, then you get the error:
ERROR
Error: No component factory found for NotificationContainerComponent. Did you add it to @NgModule.entryComponents?
Which is not required anymore for v9. And, again, it works :/
Thanks for the help.
from ngcc-validation.
@gkalpak thank you for your time, I appreciate it! I'll dig further into StackBlitz' setup, but regarding the command, no errors:
EDIT: Also, I forgot to tell you, if you go to here http://sdk.uniodigital.com.br/#/components/button/examples and click on the first StackBlitz again it's going to work. It is the same library, but now it's not using a dynamically created component. From your explanation, since it didn't throw any errors using that command, it seems to be a problem on StackBlitz, right?
from ngcc-validation.
Yeah, it sounds like a StackBlitz-specific problem. Maybe you could report it to them.
from ngcc-validation.
Related Issues (20)
- Transform to workspaces HOT 2
- Remove __ngcc_lock_file__ before run compiler HOT 1
- @ionic/angular HOT 7
- ci: Renovate auto-closes PRs for dependencies targeting GitHub commits HOT 2
- ionic-angular HOT 4
- Add ngrx HOT 2
- [NGXS]: @ngxs/router-plugin not working with Ivy HOT 1
- ng2-file-upload: false positive HOT 12
- Error: '.' is not recognized as an internal or external command (when running npm run add-project) HOT 2
- [@momentum-ui/angular] Got: 'ERROR in Cannot read property 'visit' of undefined' HOT 5
- mobx-angular broken by removed Renderer HOT 2
- ng2-completer broken from removed Renderer HOT 2
- ng2-material-dropdown broken from removed Renderer HOT 1
- ngx-chips broken from removed Renderer HOT 1
- Failure tracking summary HOT 2
- ngcc ivy cdk/accordion compile error HOT 3
- @nebular/theme: runtime error HOT 1
- Dependency Dashboard
- Why build only NGXS (store, hmr) without router, logger, etc plugin? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngcc-validation.