-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
test(ivy): create todo app in ivy #22921
Conversation
7199883
to
f1680b6
Compare
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.
LGTM
- `bundle.min.js`: Is what the site would serve to their users. It has gone | ||
through rollup, build-optimizer, and uglify with tree shaking. | ||
- `bundle.min_debug.js`: Is what the developer would like to see when debugging | ||
the application. It has also done through full pipeline of rollup, build-optimizer, |
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.
done -> gone
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.
fixed
@@ -370,7 +370,8 @@ export declare const HostListener: HostListenerDecorator; | |||
|
|||
/** @experimental */ | |||
export declare function inject<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: undefined, flags?: InjectFlags): T; | |||
export declare function inject<T>(token: Type<T> | InjectionToken<T>, notFoundValue: T | null, flags?: InjectFlags): T | null; | |||
export declare function inject<T>(token: Type<T> | InjectionToken<T>, notFoundValue: T, flags?: InjectFlags): T; |
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.
This change is needed to otherwise inject(Foo, new Foo())
's type is Foo|null
which is not correct.
@@ -762,7 +751,7 @@ export function createFactory( | |||
unsupported('value dependencies'); | |||
} | |||
if (dependency.isHost) { | |||
unsupported('host dependencies'); | |||
// unsupported('host dependencies'); |
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.
why ? add a comment ?
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.
Opps, reverted
@@ -599,17 +599,6 @@ class TemplateDefinitionBuilder implements TemplateAstVisitor, LocalResolver { | |||
this._bindingMode, directive.sourceSpan, R3.elementProperty, o.literal(nodeIndex), | |||
o.literal(input.templateName), o.importExpr(R3.bind).callFn([convertedBinding])); | |||
} | |||
|
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.
Should those changes be part of a different commit describing the rationale for the change ?
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.
broken to separate commits
# path, to disambiguate from other workspaces. | ||
# Here, the rule implementation is looking in an execroot where the layout | ||
# has an "external" directory for external dependencies. | ||
# This should probably start with "angular/" and let the rule deal with it. |
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.
# TODO: Remove once #22913 lands
?
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.
#22913 is unrelated to this.
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.
Well... that comes from you: #22654 (comment)
What did you mean then ?
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.
resolved offline
{text: 'Demonstrate Components', done: false}, | ||
{text: 'Demonstrate Structural Directives', done: true}, | ||
{text: 'Demonstrate NgModules', done: false}, | ||
{text: 'Demonstrate zoneless changed detection', done: false}, |
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.
typo "change"
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.
fixed
// The reason for the guard is that template executes creation and binding together | ||
// but NgForOf expects creation and binding separate. | ||
template: ` | ||
<div [class.done]="todo && todo.done"> |
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.
todo?.done
?
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.
I intentionally left it in this ugly state because it is a hack which should be removed once we fix it in ivy runtime.
` | ||
}) | ||
export class TodoComponent { | ||
static DEFAULT_TODO: ToDo = {text: '', done: false}; |
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.
remove ? (AppState.DEFAULT_TODO
)
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.
removed
|
||
// TODO(misko): Injection is broken because the compiler generates incorrect code. | ||
constructor(/**appState: AppState*/) { | ||
// TODO(misko): remove once injection is working. |
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.
duplicate TODO ?
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.
fixed
Hi @mhevery! This PR has merge conflicts due to recent upstream merges. |
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.
lgtm for api changes
but I'm surprised to see that we now have ivy_ng_module - fragmenting the build system like this seem like a bad idea. did you consult this with @alexeagle ?
@IgorMinar Yes it is a bad idea. 🙂 It is internal only build rule/hack until we have proper rule https://github.com/angular/angular/blob/master/packages/compiler/design/separate_compilation.md#ng_module-output-bazel and yes this was discussed with @alexeagle @alxhub and @chuckjaz |
6afcc32
to
65cf7d1
Compare
Hi @mhevery! This PR has merge conflicts due to recent upstream merges. |
2209b3d
to
4e0511c
Compare
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.
LGTM
$r3$.ɵE(0, 'ul', null, null, $c1$); | ||
$r3$.ɵC(2, $c2$, MyComponent_IfDirective_Template_2); | ||
$r3$.ɵE(0, 'ul', null, $c1$); | ||
$r3$.ɵC(2, MyComponent_IfDirective_Template_2, null, $c2$); |
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.
Since IfDirective
is not determined at this stage any more, how could it still remains in the template function name? Same for MyComponent_ForOfDirective_Template_1
below.
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.
You are right it should not be in the function name. We currently are still using old backend for the compiler which still has this information. The new compiler pipeline ngtsc
will not and so when we switch over we will not be able to generate the string. Since the function name is there just to aid in debugging, i am going to leave it for now since it will get fixe automatically when we switch over to ngtsc
.
@@ -400,7 +400,8 @@ function resetApplicationState() { | |||
* @param context to pass into the template. | |||
* @param providedRendererFactory renderer factory to use | |||
* @param host The host element node to use | |||
* @param defs Any directive or pipe defs that should be used for matching | |||
* @param directives Any directive defs that should be used for matching | |||
* @param pipes Any pipe defs that should be used for matching |
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.
Any directive defs
-> Any directive types
according to the change? (Should any
be combined with plural?)
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.
Removed the word any
. Yes it is deys not types. We pass types to defineComponent
which in turn converts them to defs. Because going from Type to Defs is megamorphic we want to do it as early as possible and than have all of the runtime be defs only.
Hi @mhevery! This PR has merge conflicts due to recent upstream merges. |
84d3459
to
1e725ac
Compare
Hi @mhevery! This PR has merge conflicts due to recent upstream merges. |
Remove `containerRefreshStart` and `containerRefreshEnd` instruction from the output. Generate directives as a list in `componentDef` rather than inline into instructions. This is consistent in making selector resolution runtime so that translation of templates can follow locality.
1e725ac
to
248e8a0
Compare
Remove `containerRefreshStart` and `containerRefreshEnd` instruction from the output. Generate directives as a list in `componentDef` rather than inline into instructions. This is consistent in making selector resolution runtime so that translation of templates can follow locality. PR Close #22921
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. |
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?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information