feat(ivy): Add AOT handling for bare classes with Input and Output de…#25367
feat(ivy): Add AOT handling for bare classes with Input and Output de…#25367benlesh wants to merge 3 commits into
Conversation
f793dfe to
093ce73
Compare
|
You can preview 093ce73 at https://pr25367-093ce73.ngbuilds.io/. |
There was a problem hiding this comment.
Should we really break here, wouldn't that mean any remaining inputs/outputs won't be collected?
There was a problem hiding this comment.
Oops, thanks, that was left over from a previous pass. Adding an additional test as well.
There was a problem hiding this comment.
We should test their imported module is angular core.
There was a problem hiding this comment.
How about HostBinding/HostListener? Shouldn't they be included in the base definition just as well?
There was a problem hiding this comment.
That work is separate.
093ce73 to
1d6e431
Compare
|
You can preview 1d6e431 at https://pr25367-1d6e431.ngbuilds.io/. |
|
You can preview 7c7a5dd at https://pr25367-7c7a5dd.ngbuilds.io/. |
7c7a5dd to
ea4c153
Compare
|
You can preview ea4c153 at https://pr25367-ea4c153.ngbuilds.io/. |
ea4c153 to
2f18bb5
Compare
|
You can preview 2f18bb5 at https://pr25367-2f18bb5.ngbuilds.io/. |
2f18bb5 to
462358c
Compare
|
You can preview 462358c at https://pr25367-462358c.ngbuilds.io/. |
|
Possibly fix this as well? |
There was a problem hiding this comment.
Import should not be deep. It can be added to the ../../ngtsc/annotations import above.
There was a problem hiding this comment.
Can you convince the auto-formatter to format this in a more readable way?
There was a problem hiding this comment.
I believe this field should become match: M.
There was a problem hiding this comment.
"let that DecoratorHandler handle this."
There was a problem hiding this comment.
Don't cast it to a string, check if it is a string and throw if it isn't.
There was a problem hiding this comment.
Rename decorator to metadata - it should also be of type M.
There was a problem hiding this comment.
expect(result.source).not.toContain('ngBaseDef')
|
Nice work, this looks generally good. Just a few comments to address and then I'll approve it. |
|
You can preview c9015dc at https://pr25367-c9015dc.ngbuilds.io/. |
c9015dc to
70b1b83
Compare
|
You can preview 70b1b83 at https://pr25367-70b1b83.ngbuilds.io/. |
| /** | ||
| * Used to get the minified alias of ngBaseDef | ||
| */ | ||
| const NG_BASE_DEF = Object.keys({ngBaseDef: true})[0]; |
There was a problem hiding this comment.
Why not const NG_BASE_DEF = 'ngBaseDef' directly?
There was a problem hiding this comment.
@alan-agius4 For Closure Compiler, which may minify the ngBaseDef property to something else. Literal strings however won't be affected by this minification step, so it is actually used as a property here for it to undergo the same minification procedure.
In other parts of the code base a function getClosureSafeProperty is used for the same purpose. That makes this more explicit, but I actually like what @benlesh has done here as it's much shorter.
There was a problem hiding this comment.
@JoostK, I see, interesting :) Thanks for the explanation.
70b1b83 to
0abdcbd
Compare
|
You can preview 0abdcbd at https://pr25367-0abdcbd.ngbuilds.io/. |
|
You can preview f1cbae0 at https://pr25367-f1cbae0.ngbuilds.io/. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |


…corators
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, ivy does not handle inheritance properly via AOt in situations where a base class has
@Inputor@Outputproperties, but no@Componentor@Directivedecorator on the class.Issue Number: N/A
What is the new behavior?
The AOT compiler will add
ngBaseDefstatic property, but only when appropriate.Does this PR introduce a breaking change?
Other information
Related to #25129