Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: standalone pipes and legacy external modules support in angular 19 #10826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KernelFolla
Copy link

this PR solves two things:

  1. angular standalone components in external legacy modules ( Add ngx-translate coverage in e2e #10752 )
  2. standalone pipes

I've tested the following code in my project without issues but I'm not confident on how to run and fix tests with karma and e2e

I hope this PR somehow contributes towards the definitive solution for supporting Angular 19🙏

@Martinspire
Copy link

Tests seem to fail, any idea on that?

@vzakharov-rxnt
Copy link

This 100% fixed all the relevant issues in my project. It's an enterprise class frontend app with probably 500k LOC of frontend code, legacy AJS + A19 hybrid. We should merge your PR ASAP.

@sumegha26
Copy link

any updates on this ?

@kheos31
Copy link

kheos31 commented Jan 31, 2025

Hello, do you find a way to correct the failing tests @KernelFolla ? Thanks for your contribution anyway, hoping it will be merged ASAP regarding of issues linked.

@KernelFolla
Copy link
Author

Hello, do you find a way to correct the failing tests @KernelFolla ? Thanks for your contribution anyway, hoping it will be merged ASAP regarding of issues linked.

can I say I don't know how to do it? :) anyway I'll try this weekend, any suggestions and help are welcome.

@sumegha26
Copy link

sumegha26 commented Jan 31, 2025

Any plans to merge this change ?

@kheos31
Copy link

kheos31 commented Feb 3, 2025

Hello, do you find a way to correct the failing tests @KernelFolla ? Thanks for your contribution anyway, hoping it will be merged ASAP regarding of issues linked.

can I say I don't know how to do it? :) anyway I'll try this weekend, any suggestions and help are welcome.

Yes you can! 🤣 I'm not used to work with NgMocks source code and I think @satanTime or maybe an usual contributor could help on it. As I read in your changed code and in the original code, I think there is a missing concept in isStandalone function.

There is no way currently for this function to know the using context of an entity (component, directive, pipe). Without this information, how NgMocks could know if an entity is standalone or not? If this function could know if the dependency tree entity to mock is declared by a Module, we could deduce that is not a standalone component. It could be summed up as :

if (isEntityDeclaredInModule) {    // <--- treatment for component/directive/pipe declared into module, concept currently absent
    return false;
} else {
   // do your current modified isStandalone treatment
}

Maybe i'm wrong but as NgMocks knows the full entity dependency tree, I think you could find this information and add it to the isStandalone function (or call the isStandalone function just in "else" case).

Good luck @KernelFolla 😉

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

Successfully merging this pull request may close these issues.

5 participants