-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(a19): respecting default standalone flag since angular 19 #10583
base: master
Are you sure you want to change the base?
fix(a19): respecting default standalone flag since angular 19 #10583
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10583 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 227 227
Lines 4946 4950 +4
Branches 1148 1149 +1
=========================================
+ Hits 4946 4950 +4 ☔ View full report in Codecov by Sentry. |
I think you need to adapt the unit-tests to get green-light from CI (and approval from @satanTime ) |
6882b15
to
40ee673
Compare
Hi @re-alam, thanks for the fix. Could stash all commits into one? fix(a19): respecting default standalone flag since angular 19 Thank you in advance. |
2192a71
to
52ef264
Compare
Head branch was pushed to by a user without write access
52ef264
to
aa2b371
Compare
Hi @re-alam, could you sign your commit? the easiest way is SSH signing: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
Head branch was pushed to by a user without write access
aa2b371
to
73d1c95
Compare
@satanTime Thank you for approving the change. My commit is now signed. Please feel free to merge when you're able. |
ffe193a
to
aa6ad24
Compare
Added standalone false as default for mock-render and updated isStandalone method to handle angular 19+ default standalone behavior for components.
aa6ad24
to
a310e94
Compare
@@ -4,6 +4,7 @@ import './lib/common/ng-mocks-stack'; | |||
import './lib/common/ng-mocks-global-overrides'; | |||
|
|||
export * from './lib/common/core.tokens'; | |||
export * from './lib/common/func.is-standalone'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an internal function and it shouldn't be a part of public interface.
I think the test should be done in a different way. There are some examples in tests folder which verify different behaviors of different angular versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@satanTime Thank you for your feedback. I've looked into the tests folder but couldn't find any tests that specifically cover the feature or logic related to Angular version checks. I only found some tests that skip execution based on the Angular version, like this:
if (Number.parseInt(VERSION.major, 10) < 14) {
it('needs >=a14', () => {
expect(true).toBeTruthy();
});
return;
}
However, I need to ensure code coverage for the Angular 19 version check within the isStandalone
function.
I attempted to mock the VERSION
object using spyOnProperty
, but this wasn't possible as the VERSION
object from @angular/core
isn't configurable.
Given that isStandalone
is an internal function, what do you think about moving the test file to the common folder? Please let me know if there are any other approaches I should consider.
this should be merged ASAP. |
@endlacer Some people don’t seem to understand that most libraries are maintained on a pro bono basis, without any financial compensation 😠 These developers generously dedicate their free time to create and maintain fantastic development tools that benefit us all.
|
@endlacer I understand your frustration, but this doesn't have to be blocking: take this fix, build it and temporarily include it in your bundle to import from there. That's what I'm doing for now and it works. DM me if you have questions or need any help with this. |
A bit of guidance on this would be hugely appreciated! |
sorry for being too harsh, but we got 4 applications and 2 libraries that all are now blocked bc of something that did not mean any offense! |
@TomLBarden here you go:
// eslint.config.js
export default [
{
ignores: ["**/ng-mocks/**"]
}
]; Your tests should be running now with Angular v19 😎 |
@florestankorp Thank you!
@ct-serensia I'm seeing this issue too, did you happen to find a solution for it? I'll continue to investigate this myself, too. |
this might work local, but not in a CI pipeline |
@ct-serensia That's a shame, thanks for the reply though. Looking like I might have to delay this upgrade for now. Unfortunately for us we can't accept the risk of testing against a different version of Angular than we'd be shipping with. |
ct-serensia i dont even this this would work. the angular 19 migration removes standalone: true flags from the component. when you then run tests with angular 18, the tests would think that this component is standalone-false, which it is not |
I don't see any update on this for last 2 weeks as it's being worked on, it would be very helpful to get this problem resolved, as it is stopping the complete Nx migration for all our repos. |
For the time being, we continue to declare the standalone components with |
'The global removal of the declaration is a matter of search and replace' - In case your components are standalone, but I need the flag, since its |
@florianjung79 Do you mean you set your |
The actual components. |
Added standalone false as default for mock-render and updated isStandalone method to handle angular 19+ default standalone behavior for components.