Commit Graph

399 Commits

Author SHA1 Message Date
Victor Berchet 188ff848d2 fix(ivy): `pureFunctionV` takes an array of values ()
PR Close 
2018-05-25 13:46:50 -04:00
Victor Berchet 4f36340de7 feat(ivy): add support for short-circuiting ()
Short-circuitable expressions (using ternary & binary operators) could not use
the regular binding mechanism as it relies on the bindings being checked every
single time - the index is incremented as part of checking the bindings.

Then for pure function kind of bindings we use a different mechanism with a
fixed index. As such short circuiting a binding check does not mess with the
expected binding index.

Note that all pure function bindings are handled the same wether or not they
actually are short-circuitable. This allows to keep the compiler and compiled
code simple - and there is no runtime perf cost anyway.

PR Close 
2018-05-25 13:46:50 -04:00
Kara Erickson 609e6b9787 refactor(ivy): move child from LNode to TNode ()
PR Close 
2018-05-25 13:41:00 -04:00
Kara Erickson 68bf8c36c6 refactor(ivy): move type from LNode to TNode ()
PR Close 
2018-05-25 13:40:59 -04:00
Kara Erickson 8216657681 refactor(ivy): add tNodes for view nodes and hosts ()
PR Close 
2018-05-25 13:40:59 -04:00
Miško Hevery 373fa78d7f fix: merge collision ()
PR Close 
2018-05-22 14:49:38 -04:00
Alex Rickabaugh 919f42fea1 feat(ivy): first steps towards JIT compilation ()
This commit adds a mechanism by which the @angular/core annotations
for @Component, @Injectable, and @NgModule become decorators which,
when executed at runtime, trigger just-in-time compilation of their
associated types. The activation of these decorators is configured
by the ivy_switch mechanism, ensuring that the Ivy JIT engine does
not get included in Angular bundles unless specifically requested.

PR Close 
2018-05-21 19:13:50 -04:00
Kara Erickson 6e7d071c6b fix(ivy): move next property to TNode ()
PR Close 
2018-05-21 16:09:12 -04:00
Alex Eagle 017d67cdf8 test: switch to ts_web_test_suite ()
Unit tests now run on Firefox too

PR Close 
2018-05-15 11:40:56 -07:00
Matias Niemelä 816bc8af17 feat(ivy): support injectable sanitization service ()
PR Close 
2018-05-11 16:43:43 -04:00
swseverance fe3679a356 style: remove empty comments ()
PR Close 
2018-05-10 15:48:13 -07:00
Alex Rickabaugh fc034270ce fix(core): call ngOnDestroy on all services that have it ()
Previously, ngOnDestroy was only called on services which were statically
determined to have ngOnDestroy methods. In some cases, such as with services
instantiated via factory functions, it's not statically known that the service
has an ngOnDestroy method.

This commit changes the runtime to look for ngOnDestroy when instantiating
all DI tokens, and to call the method if it's present.

Fixes 
Fixes 
Fixes 

PR Close 
2018-05-08 13:55:29 -07:00
Matias Niemelä 65211f46cf fix(animations): retain state styling for nodes that are moved around ()
PR Close 
2018-05-02 16:58:46 -07:00
Matias Niemelä da9ff255dd fix(animations): properly clean up queried element styles in safari/edge ()
Prior to this patch, if an element is queried and animated for 0 seconds
(just a style() call and nothing else) then the styles applied would not
be properly cleaned up due to their camelCased nature.

PR Close 
2018-05-02 16:58:24 -07:00
Kara Erickson c5cfc3a1b6 fix(ivy): only generate TViews once per embedded template ()
PR Close 
2018-05-01 10:27:40 -07:00
Misko Hevery b76f5a6a7d perf(ivy): add performance counters in ngDevMode ()
PR Close 
2018-05-01 10:27:40 -07:00
Vikram Subramanian 0c6dc45c85 fix(core): avoid eager providers re-initialization ()
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.

PR Close 
2018-04-27 07:16:12 -07:00
Igor Minar 5b96078624 Revert "refactor(core): tree-shake application_module providers ()"
This reverts commit eb031c6ff1.

The change is breaking targets in g3 see cl/194336387.
2018-04-26 14:08:13 -07:00
Marc Laval 1a44a0b4a8 feat(ivy): support lifecycle hooks of ViewContainerRef ()
PR Close 
2018-04-25 19:02:00 -07:00
Matias Niemelä eb031c6ff1 refactor(core): tree-shake application_module providers ()
PR Close 
2018-04-25 15:51:51 -07:00
Alex Eagle b4c252bcc5 build: serve ivy todo app with real http-server ()
PR Close 
2018-04-25 15:51:18 -07:00
Kara Erickson db77d8dc92 feat(ivy): support injection flags at runtime ()
PR Close 
2018-04-25 13:26:58 -07:00
Pawel Kozlowski b1d03fe70b fix(ivy): properly destroy view trees where root is an embedded view without children ()
The bug fixed here steams from the fact that we are traversing too far up
in the views tree hierarchy in the destroyViewTree function.

The logic in destroyViewTree is off if we start removal at an embedded view
without any child views. For such a case we should just clean up (cleanUpView)
this one view without paying attention to next / parent views.

PR Close 
2018-04-24 11:15:16 -07:00
Victor Berchet 6761a64522 refactor(compiler): remove a dependency from the IVY AST to the template AST ()
PR Close 
2018-04-20 17:23:02 -07:00
Victor Berchet 9757347e71 feat(ivy): add an IVY local the compiler which avoids analyzeModule ()
closes 

Based on a spike by @chukjaz

PR Close 
2018-04-19 16:32:09 -07:00
Victor Berchet 1d1e75ee2b Revert "fix(compiler): Pretty print object instead of [Object object] ()" ()
This reverts commit 8555a3a3cd.

Reverted because of https://github.com/angular/angular/issues/23440

PR Close 
2018-04-19 14:51:58 -07:00
Matias Niemelä acf6781ccc test(core): add a symbols test for renderer2 code ()
PR Close 
2018-04-18 14:49:29 -07:00
Kara Erickson 5a1ddee88c refactor(ivy): speed up bound text nodes ()
PR Close 
2018-04-17 13:49:19 -07:00
Misko Hevery b64a276d4b refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private () ()
Ivy definition looks something like this:

```
class MyService {
  static ngInjectableDef = defineInjectable({
    …
  });
}
```

Here the argument to `defineInjectable` is well known public contract which needs
to be honored in backward compatible way between versions. The type of the
return value of `defineInjectable` on the other hand is private and can change
shape drastically between versions without effecting backwards compatibility of
libraries publish to NPM. To our users it is effectively an opaque token.
For this reson why declare the return value of `defineInjectable` as `never`.

PR Close 
2018-04-14 20:40:14 -07:00
Igor Minar 674c3def31 revert: refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private ()
This reverts commit 2c09b707ce.
2018-04-13 23:02:29 -07:00
Miško Hevery 2c09b707ce refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private ()
Ivy definition looks something like this:

```
class MyService {
  static ngInjectableDef = defineInjectable({
    …
  });
}
```

Here the argument to `defineInjectable` is well known public contract which needs
to be honored in backward compatible way between versions. The type of the
return value of `defineInjectable` on the other hand is private and can change
shape drastically between versions without effecting backwards compatibility of
libraries publish to NPM. To our users it is effectively an `OpaqueToken`.

By prefixing the type with `ɵ` we are communicating the the outside world that
the value is not public API and is subject to change without backward compatibility.

PR Close 
2018-04-13 16:20:25 -07:00
Misko Hevery f4017ce5e3 fix(ivy): Update Todo app to take advantage of optional injector ()
PR Close 
2018-04-13 14:29:52 -07:00
Misko Hevery da31db757b feat(ivy): support injection even if no injector present ()
- 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 
2018-04-13 14:29:52 -07:00
Misko Hevery 6f213a74f2 feat(ivy): support generation of flags for directive injection ()
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 
- compiler now generates flags for injection.

Compiler portion of 
Prep for 

PR Close 
2018-04-13 14:29:52 -07:00
Marc Laval e7ef02722d fix(ivy): local directives and pipes should be applied to TemplateRef ()
PR Close 
2018-04-13 13:31:19 -07:00
Victor Berchet d5e7f60f04 refactor(ivy): misc ()
PR Close 
2018-04-13 13:19:17 -07:00
Rafael 639d52fe71 refactor: ensure all 'TODO's are consistent ()
PR Close 
2018-04-13 13:11:01 -07:00
Marc Laval 2bb783824e fix(ivy): support ViewContainerRef on nodes projected into an embedded view ()
PR Close 
2018-04-13 00:20:32 -07:00
Joey Perrott b551f844e4 feat(platform-browser): add token marking which the type of animation module nearest in the injector tree ()
PR Close 
2018-04-12 23:17:38 -07:00
Kara Erickson 0d516f1658 fix(ivy): update compiler to generate separate creation mode and update mode blocks ()
PR Close 
2018-04-11 15:30:39 -07:00
Kara Erickson de3ca56769 fix(ivy): support separate creation mode and update mode execution in runtime ()
PR Close 
2018-04-11 15:30:39 -07:00
Marc Laval c973830d9a refactor(ivy): clean projection support ()
PR Close 
2018-04-10 13:16:01 -07:00
Miško Hevery f1db789450 test(ivy): update todo app to http://todomvc.com ()
PR Close 
2018-04-10 13:14:20 -07:00
Miško Hevery 3fb4e190a8 fix(ivy): correctly bind to component context ()
When compiling templates the compiler would often bind to
closest context rather than the component context.

The only time one should be binding to the cont component is
in explicit cases where the inner template declares local variable.

PR Close 
2018-04-10 13:14:20 -07:00
Miško Hevery 4f7fac0e03 test(ivy): cleanup todo test app ()
PR Close 
2018-04-10 13:14:20 -07:00
Miško Hevery 720031b5f6 docs(ivy): update outstanding work for todo ()
PR Close 
2018-04-10 13:14:20 -07:00
Marc Laval bb3f0e5ed2 feat(ivy): support projection of ViewContainerRef ()
PR Close 
2018-04-09 16:07:42 -07:00
Marc Laval f4c56f4931 feat(ivy): implement some of the ViewContainerRef API ()
PR Close 
2018-04-09 15:17:19 -07:00
Kara Erickson 628303d2cb fix(ivy): instantiate dirs in correct order ()
PR Close 
2018-04-05 14:50:00 -07:00
Pawel Kozlowski d80e9304c6 fix(ivy): properly find RNode ()
As we no longer create native (RNode) comment nodes for containers,
we need to execute logic for finding a next sibiling node with RNode
when inserting a view.

The mentioned logic need to be updated for the case of dynamically
created containers (LContainerNode). Indeed, we need to be able to
descend into dynamically inserted views while looking for a RNode.
To achieve this we need to have a pointer from a host LNode to a
dynamically created LContainerNode).

PR Close 
2018-04-05 14:47:50 -07:00