Git Product home page Git Product logo

Comments (10)

gkalpak avatar gkalpak commented on May 29, 2024 1

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.

eestein avatar eestein commented on May 29, 2024 1

Ok, I'll forward it to them. Thank you very much for your help :)

from ngcc-validation.

gkalpak avatar gkalpak commented on May 29, 2024

@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.

eestein avatar eestein commented on May 29, 2024

@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.

gkalpak avatar gkalpak commented on May 29, 2024

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.

eestein avatar eestein commented on May 29, 2024

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:
Screen Shot 2020-06-25 at 11 04 30
Screen Shot 2020-06-25 at 11 03 51

There were some errors, but only on a @alfresco lib:
Screen Shot 2020-06-25 at 11 05 17

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.

gkalpak avatar gkalpak commented on May 29, 2024

Can you show an example of it failing on StackBlitz? Maybe it is a StackBlitz issue.

from ngcc-validation.

eestein avatar eestein commented on May 29, 2024

@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.

eestein avatar eestein commented on May 29, 2024

@gkalpak thank you for your time, I appreciate it! I'll dig further into StackBlitz' setup, but regarding the command, no errors:

Screen Shot 2020-06-25 at 16 55 56

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.

gkalpak avatar gkalpak commented on May 29, 2024

Yeah, it sounds like a StackBlitz-specific problem. Maybe you could report it to them.

from ngcc-validation.

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.