feat(ivy): support generation of flags for directive injection#23345
feat(ivy): support generation of flags for directive injection#23345mhevery wants to merge 4 commits intoangular:masterfrom
Conversation
kara
left a comment
There was a problem hiding this comment.
Looks good to me, except for the fdescribe
There was a problem hiding this comment.
Did you mean to remove this? Looks like it's still used in this file.
There was a problem hiding this comment.
Working on two things in one PR, reverted
520e435 to
644e714
Compare
|
You can preview 4d6700a at https://pr23345-4d6700a.ngbuilds.io/. |
7b8bcef to
8fd7d95
Compare
There was a problem hiding this comment.
const flags = moveThatLogicFurtherDown(dependency); ?
There was a problem hiding this comment.
rename template to factory or injectxxxyyy ? (comment, var name and expect)
(I'm also ok with removing this comment)
Use $r3$ instead of IDENT for consistency with other tests ?
|
You can preview 7b8bcef at https://pr23345-7b8bcef.ngbuilds.io/. |
|
You can preview 8fd7d95 at https://pr23345-8fd7d95.ngbuilds.io/. |
|
You can preview c75e17f at https://pr23345-c75e17f.ngbuilds.io/. |
|
You can preview 49cb591 at https://pr23345-49cb591.ngbuilds.io/. |
There was a problem hiding this comment.
constructor(public todoStore: TodoStore) {} should work now
|
You can preview 493ab9b at https://pr23345-493ab9b.ngbuilds.io/. |
kara
left a comment
There was a problem hiding this comment.
A few small typos, otherwise looks good to me
019b4c1 to
e2a3a2f
Compare
|
You can preview 091c9e1 at https://pr23345-091c9e1.ngbuilds.io/. |
|
You can preview 019b4c1 at https://pr23345-019b4c1.ngbuilds.io/. |
|
You can preview e2a3a2f at https://pr23345-e2a3a2f.ngbuilds.io/. |
There was a problem hiding this comment.
do we want to be able to provide undefined by using a special value (ie {}) instead ?
There was a problem hiding this comment.
I was thinking about it, and decided that it is not worth the complexity. We can always added later.
There was a problem hiding this comment.
Why would compilation result lives in source code? Shouldn't it using @Injectable() decorator?
There was a problem hiding this comment.
Few reasons:
1.) we currently don't compile core with ivy so the decorator does not get lowered.
2.) There is a circular dependency between the compiler and core which makes it hard for the compiler to compile tho core. Rather than solving that, we have opted for hand coding it.
There was a problem hiding this comment.
This comment should probably be in the source code
|
You can preview 27674e3 at https://pr23345-27674e3.ngbuilds.io/. |
|
You can preview 685546e at https://pr23345-685546e.ngbuilds.io/. |
|
this PR changes the API surface. @mhevery let's discuss tomorrow before merging this. |
|
Discussed with @IgorMinar and we agreed to merge. |
|
we agreed because the api is wrong and needs to be corrected before the release. |
This change changes: - compiler uses `directiveInject` instead of `inject` for `Directive`s - unifies the flags in `di` as well as `render3` - changes the signature of `directiveInject` to match `inject` In prep for angular#23330 - compiler now generates flags for injection. Compiler portion of angular#23342 Prep for angular#23330
- Remove default injection value from `inject` / `directiveInject` since it is not possible to set using annotations. - Module `Injector` is stored on `LView` instead of `LInjector` data structure because it can change only at `LView` level. (More efficient) - Add `ngInjectableDef` to `IterableDiffers` so that existing tests can pass as well as enable `IterableDiffers` to be injectable without `Injector`
- Remove default injection value from `inject` / `directiveInject` since it is not possible to set using annotations. - Module `Injector` is stored on `LView` instead of `LInjector` data structure because it can change only at `LView` level. (More efficient) - Add `ngInjectableDef` to `IterableDiffers` so that existing tests can pass as well as enable `IterableDiffers` to be injectable without `Injector` PR Close #23345
|
|
||
| export declare const enum InjectFlags { | ||
| Default = 0, | ||
| SkipSelf = 1, |
There was a problem hiding this comment.
Why change the order? It's a bitmask anyway o:
|
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. |
This change changes:
directiveInjectinstead ofinjectforDirectivesdias well asrender3directiveInjectto matchinjectIn prep forinjectanddirectiveInjectneed bridging when used withComponent.provides#23330Compiler portion of #23342
Prep for #23330
feat(ivy): support injection even if no injector present
inject/directiveInjectsinceit is not possible to set using annotations.
Injectoris stored onLViewinstead ofLInjectordatastructure because it can change only at
LViewlevel. (More efficient)ngInjectableDeftoIterableDiffersso that existing tests canpass as well as enable
IterableDiffersto be injectable withoutInjector