Commit Graph

997 Commits

Author SHA1 Message Date
Alex Rickabaugh 8634d0bcd8 feat(ivy): emit metadata along with all Angular types (#26860)
This commit causes a call to setClassMetadata() to be emitted for every
type being compiled by ngtsc (every Angular type). With this metadata,
the TestBed should be able to recompile these classes when overriding
decorator information.

Testing strategy: Tests in the previous commit for
generateSetClassMetadataCall() verify that the metadata as generated is
correct. This commit enables the generation for each DecoratorHandler,
and a test is added to ngtsc_spec to verify all decorated types have
metadata generated for them.

PR Close #26860
2018-10-31 19:52:36 -04:00
Alex Rickabaugh ca1e538752 feat(ivy): setClassMetadata() for assigning decorator metadata (#26860)
This commit introduces the setClassMetadata() private function, which
adds metadata to a type in a way that can be accessed via Angular's
ReflectionCapabilities. Currently, it writes to static fields as if
the metadata being added was downleveled from decorators by tsickle.

The plan is for ngtsc to emit code which calls this function, passing
metadata on to the runtime for testing purposes. Calls to this function
would then be tree-shaken away for production bundles.

Testing strategy: proper operation of this function will be an integral
part of TestBed metadata overriding. Angular core tests will fail if this
is broken.

PR Close #26860
2018-10-31 19:52:36 -04:00
Misko Hevery d042c4afe0 fix(core): Remove static dependency from @angular/core to @angular/compiler (#26734)
PR Close #26734
2018-10-31 14:15:06 -04:00
Matias Niemelä 5d740785a9 docs: fix aot typo 2018-10-30 17:37:20 -07:00
Matias Niemelä 68b2211e64 fix(ivy): ensure falsy styling is not applied during creation mode (#26793)
PR Close #26793
2018-10-30 19:41:56 -04:00
Trotyl 95743e3a64 fix(core): support computed base class in metadata inheritance (#24014)
PR Close #24014
2018-10-30 13:48:22 -04:00
Pawel Kozlowski ede65dbede fix(ivy): allow root components to inject ViewContainerRef (#26682)
PR Close #26682
2018-10-29 18:47:14 -04:00
Pawel Kozlowski 578e4c7642 fix(ivy): compile queries in JIT mode (#26816)
PR Close #26816
2018-10-29 18:46:44 -04:00
Kara Erickson 96770e5c6b fix(ivy): optional dependencies should not throw with module injector (#26763)
PR Close #26763
2018-10-29 14:12:36 -04:00
Kara Erickson 1130e48541 fix(ivy): host injection flag should not throw for embedded views (#26795)
PR Close #26795
2018-10-29 14:12:11 -04:00
Andrew Kushnir 2a869271f6 fix(ivy): move HostListeners generation to factory function (#26480)
PR Close #26480
2018-10-29 14:02:22 -04:00
Kara Erickson d52d82d744 fix(ivy): injecting optional TemplateRef on element should not throw (#26664)
PR Close #26664
2018-10-26 18:11:27 -04:00
Matias Niemelä d50d400231 build: fix formatting issue in host_binding_spec file 2018-10-26 14:33:04 -07:00
Kara Erickson 19fcfc3d00 fix(compiler): generate inputs with aliases properly (#26774)
PR Close #26774
2018-10-26 17:23:45 -04:00
Matias Niemelä c048358cf9 build: fix the golden files for hello_world_r2 2018-10-26 14:20:40 -07:00
Matias Niemelä 8171a2ab94 fix(ivy): ensure pipe declarations are populated lazily when a forward ref is detected (#26765)
PR Close #26765
2018-10-26 15:57:10 -04:00
Kara Erickson 2fd4c372d5 fix(ivy): resolve forward refs in providers (#26766)
PR Close #26766
2018-10-26 15:50:11 -04:00
Kara Erickson f76ce84ae1 fix(ivy): host bindings should work on nodes with providers (#26771)
PR Close #26771
2018-10-26 15:49:30 -04:00
Igor Minar 40bbfbf961 test(ivy): fix or disable failing ivy tests (#26735)
These tests were previously not running on CI so they have always been broken,
or got broken just recently :-(.

test(ivy): mark failing test targets with fixme-ivy-jit and fixme-ivy-local tags

PR Close #26735
2018-10-26 14:48:05 -04:00
Miško Hevery 95f852e856 build: fix comment formatting to make closure happy (#26769)
PR Close #26769
2018-10-25 19:40:36 -04:00
Kara Erickson 2c7386c961 feat(ivy): support injecting the injector (#26699)
PR Close #26699
2018-10-25 18:47:56 -04:00
Shino Kurian d5cbcef0ea fix(core): ignore comment nodes under unsafe elements (#25879)
Comment nodes that are child nodes of unsafe elements are identified as text nodes. This results in the comment node being returned as an encoded string.
Add a check to ignore such comment nodes.

PR Close #25879
2018-10-25 11:20:19 -07:00
Marc Laval b0476f308b feat(ivy): support providers and viewProviders (#25803)
PR Close #25803
2018-10-25 12:58:40 -04:00
Matias Niemelä 9dc52d9d04 feat(ivy): expose a series of debug console tools (#26705)
PR Close #26705
2018-10-24 20:30:51 -04:00
Matias Niemelä 297dc2bc02 fix(ivy): ensure `ngClass` works with [class] bindings (#26559)
PR Close #26559
2018-10-24 20:27:12 -04:00
Alex Rickabaugh bf9ab53f12 build(ivy): fix typo in build file 2018-10-24 10:07:49 -07:00
Alex Rickabaugh d99f661af7 build(ivy): properly tag the js_expected_symbol_test rules
Previously the rules were tagged ivy-only, but missing the ivy-aot tag
which would cause them to run under CI.
2018-10-24 10:04:06 -07:00
Alex Rickabaugh 5d58a31d86 fix(ivy): rename broken reflect_metadata switch file
This file was missed during the rename of the --define=compile
flag value from 'local' to 'aot. It's referenced as
reflect_metadata_${compile}.
2018-10-24 09:53:10 -07:00
Igor Minar ee0b857172 build: rename the ivy compile mode 'local' to 'aot' (#26686)
PR Close #26686
2018-10-23 14:14:49 -07:00
Igor Minar 4237c34c78 test(ivy): mark failing test targets with fixme-ivy-jit and fixme-ivy-local tags (#26471)
We are close enough to blacklist a few test targets, rather than whitelist targets to run...

Because bazel rules can be composed of other rules that don't inherit tags automatically,
I had to explicitly mark all of our ts_library and ng_module targes with "ivy-local" and
"ivy-jit" tags so that we can create a query that excludes all fixme- tagged targets even
if those targets are composed of other targets that don't inherit this tag.

This is the updated overview of ivy related bazel tags:

- ivy-only: target that builds or runs only under ivy
- fixme-ivy-jit: target that doesn't yet build or run under ivy with --compile=jit
- fixme-ivy-local: target that doesn't yet build or run under ivy with --compile=local
- no-ivy-jit: target that is not intended to build or run under ivy with --compile=jit
- no-ivy-local: target that is not intended to build or run under ivy with --compile=local

PR Close #26471
2018-10-23 08:57:42 -07:00
Pawel Kozlowski ff767dd153 fix(ivy): support ViewContainerRef ng-container children (#26646)
Issue found while running NgPlural tests with ivy

PR Close #26646
2018-10-23 08:52:30 -07:00
Anthony Ciccarello 6737e91974 docs(core): fix spelling in ComponentFactory (#26603)
PR Close #26603
2018-10-22 10:38:56 -07:00
Greg Magolan 15c2467dbd build: review comments addressed (#26488)
PR Close #26488
2018-10-19 20:59:29 -07:00
Greg Magolan 1f3331f5e6 build(bazel): use fine-grained npm deps (#26111) (#26488)
PR Close #26488
2018-10-19 20:59:29 -07:00
Pete Bacon Darwin 3903e5ebe7 docs: update core to use `@publicApi` tags (#26595)
PR Close #26595
2018-10-19 14:35:53 -07:00
Pete Bacon Darwin 24521f549c docs: convert all `@experimental` tags to `@publicApi` tags (#26595)
PR Close #26595
2018-10-19 14:35:52 -07:00
Olivier Combe 03bf0d6b41 docs(ivy): update status for i18n (#26502)
PR Close #26502
2018-10-19 11:06:25 -07:00
Alex Rickabaugh d4cee514f6 refactor(ivy): obviate the Bazel component of the ivy_switch (#26550)
Originally, the ivy_switch mechanism used Bazel genrules to conditionally
compile one TS file or another depending on whether ngc or ngtsc was the
selected compiler. This was done because we wanted to avoid importing
certain modules (and thus pulling them into the build) if Ivy was on or
off. This mechanism had a major drawback: ivy_switch became a bottleneck
in the import graph, as it both imports from many places in the codebase
and is imported by many modules in the codebase. This frequently resulted
in cyclic imports which caused issues both with TS and Closure compilation.

It turns out ngcc needs both code paths in the bundle to perform the switch
during its operation anyway, so import switching was later abandoned. This
means that there's no real reason why the ivy_switch mechanism needed to
operate at the Bazel level, and for the ivy_switch file to be a bottleneck.

This commit removes the Bazel-level ivy_switch mechanism, and introduces
an additional TypeScript transform in ngtsc (and the pass-through tsc
compiler used for testing JIT) to perform the same operation that ngcc
does, and flip the switch during ngtsc compilation. This allows the
ivy_switch file to be removed, and the individual switches to be located
directly next to their consumers in the codebase, greatly mitigating the
circular import issues and making the mechanism much easier to use.

As part of this commit, the tag for marking switched variables was changed
from __PRE_NGCC__ to __PRE_R3__, since it's no longer just ngcc which
flips these tags. Most variables were renamed from R3_* to SWITCH_* as well,
since they're referenced mostly in render2 code.

Test strategy: existing test coverage is more than sufficient - if this
didn't work correctly it would break the hello world and todo apps.

PR Close #26550
2018-10-19 09:23:05 -07:00
Pawel Kozlowski f8195e5e3d fix(ivy): stub TestBed.compileComponents implementation (#26506)
PR Close #26506
2018-10-17 13:08:14 -07:00
Andrew Kushnir 8a3fd58cad feat(ivy): i18n compiler support for i18nStart and i18nEnd instructions (#26442)
PR Close #26442
2018-10-17 11:03:52 -07:00
Matias Niemelä fa8e633be5 feat(ivy): enhance [style] and [class] bindings to be animation aware (#26096)
PR Close #26096
2018-10-16 20:39:19 -07:00
Matias Niemelä be337a2e52 refactor(ivy): move styling files around (#26096)
PR Close #26096
2018-10-16 20:39:18 -07:00
Miško Hevery 4d164b6ca4 fix(ivy): make defineComponent tree shakable by Closure Compiler (#26425)
PR Close #26425
2018-10-16 20:37:35 -07:00
Matias Niemelä 9e5d440a0b refactor(ivy): handle animation metadata normalization in the compiler (#26481)
PR Close #26481
2018-10-16 20:31:04 -07:00
Miško Hevery 7d82053117 docs(ivy): i18n design (#26091)
PR Close #26091
2018-10-16 14:08:01 -07:00
Kara Erickson e76a570908 refactor(ivy): remove LNode (#26426)
PR Close #26426
2018-10-15 11:20:32 -07:00
Kara Erickson 931e603f80 refactor(ivy): revert LNode.data into LViewData[HOST] (#26424)
PR Close #26424
2018-10-15 10:17:12 -07:00
Pawel Kozlowski 45732e5b91 fix(ivy): fix reference to pipeBind instruction with 2 args (#26451)
PR Close #26451
2018-10-15 10:14:25 -07:00
Manduro ff15043e48 fix(core): allow null value for renderer setElement(…) (#17065)
Using Renderer’s setElementAttribute or setElementStyle with a null or undefined value removes the
corresponding attribute or style. The argument type should allow this when using strictNullChecks.

Closes #13686

PR Close #17065
2018-10-12 09:17:59 -07:00
Miško Hevery 9ebb4c02a2 docs(ivy): update status.md (#26382)
PR Close #26382
2018-10-12 09:01:41 -07:00
Kara Erickson 735dfd3b1a refactor(ivy): replace LNode.dynamicLContainerNode with flat LContainers (#26407)
PR Close #26407
2018-10-11 21:07:21 -07:00
Kara Erickson 70cd112872 refactor(ivy): remove TNode.dynamicContainerNode (#26407)
PR Close #26407
2018-10-11 21:07:21 -07:00
Pawel Kozlowski 6a64ac4151 fix(ivy): Renderer2 should not use a special injection fn (#26369)
PR Close #26369
2018-10-11 14:12:03 -07:00
Pawel Kozlowski 4b494f23f5 fix(ivy): fix generated code for style bindings with units (#26397)
PR Close #26397
2018-10-11 14:11:15 -07:00
Pete Bacon Darwin 1e69d601fb fix(ivy): ensure that `ɵNgModuleDefWithMeta` is exported (#26082)
This is needed to build an app with `ngtsc` once `ngcc` has compiled
`@angular/core`.

PR Close #26082
2018-10-11 14:08:39 -07:00
Pawel Kozlowski 053bf27fb3 refactor(ivy): use context discovery in TestBed implementation (#26211)
PR Close #26211
2018-10-11 13:01:28 -07:00
Andrew Kushnir 39f42bad1c feat(ivy): i18n compiler support for element attributes (#26280)
PR Close #26280
2018-10-11 13:00:19 -07:00
Pawel Kozlowski 3f8ac238f1 refactor(ivy): remove unused directives field from TView (#26364)
It was removed in #26316

PR Close #26364
2018-10-11 12:59:02 -07:00
Andrew Kushnir be4edf15ee fix(core): resolving merge conflicts in query.ts (#26324)
PR Close #26324
2018-10-09 17:34:08 -07:00
Andrew Kushnir e5644204dc fix(ivy): removing unnecessary assert in getOrCreateNodeInjector function (#26305)
PR Close #26305
2018-10-09 16:52:00 -07:00
Andrew Kushnir 69b9758ab8 fix(ivy): removing no longer needed QueryReadType (#26314) (#26314)
PR Close #26314

PR Close #26314
2018-10-09 16:50:34 -07:00
Kara Erickson 7ea5161d4d refactor(ivy): merge directives into LViewData (#26316)
PR Close #26316
2018-10-09 16:46:00 -07:00
Kara Erickson b0879046b7 test(ivy): add testing utility to replace loadDirective (#26316)
PR Close #26316
2018-10-09 16:46:00 -07:00
Alex Rickabaugh 456f23f76a fix(ivy): reflect animations field directly into the output definition (#26322)
The 'animations' field of @Component metadata should be copied directly
into the ngComponentDef for that component and should not pass through
static resolution.

Previously the animations array was statically resolved and then the
values were translated back when generating ngComponentDef.

PR Close #26322
2018-10-09 16:45:31 -07:00
Judy Bogart f543d71cc3 docs: add package doc files (#26047)
PR Close #26047
2018-10-05 15:42:14 -07:00
JoostK 9953fe7c00 fix(ivy): reexport compileNgModuleFactory__POST_NGCC__ to prevent DCE in FESM (#26071)
While creating FESM files, rollup usually drops all unused symbols.
All *__POST_NGCC__ are unused unless ngcc rewires stuff. To prevent this DCE
we reexport them as private symbols. If ngcc is not used, these symbols will
be dropped when we optimize an application bundle.

PR Close #26071
2018-10-05 13:45:55 -07:00
Kara Erickson 8f25321787 refactor(ivy): update context discovery to prep for dir merge (#26262)
PR Close #26262
2018-10-05 13:39:30 -07:00
Kara Erickson 51dfdd5dd1 fix(ivy): sync view with blueprint when necessary (#26263)
PR Close #26263
2018-10-05 13:39:03 -07:00
Pawel Kozlowski fdaf573073 feat(ivy): expose node injector as part of debug context (#26210)
PR Close #26210
2018-10-04 10:12:02 -07:00
Alex Rickabaugh 36d6e6076e feat(ivy): support template type check narrowing for *ngFor and *ngIf (#26203)
This commit adds an ngTemplateGuard_ngIf static method to the NgIf
directive and an ngTemplateContextGuard static method to NgFor. The
function of these two static methods is to enable type narrowing
within generated type checking code for consumers of the directives.

PR Close #26203
2018-10-04 10:11:17 -07:00
Alex Rickabaugh 79466baef8 fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203)
Previously in Ivy, metadata for directives/components/modules/etc was
carried in .d.ts files inside type information encoded on the
DirectiveDef, ComponentDef, NgModuleDef, etc types of Ivy definition
fields. This works well, but has the side effect of complicating Ivy's
runtime code as these extra generic type parameters had to be specified
as <any> throughout the codebase. *DefInternal types were introduced
previously to mitigate this issue, but that's the wrong way to solve
the problem.

This commit returns *Def types to their original form, with no metadata
attached. Instead, new *DefWithMeta types are introduced that alias the
plain definition types and add extra generic parameters. This way the
only code that needs to deal with the extra metadata parameters is the
compiler code that reads and writes them - the existence of this metadata
is transparent to the runtime, as it should be.

PR Close #26203
2018-10-04 10:11:17 -07:00
Kara Erickson 730679964f refactor(ivy): flatten LInjector into LViewData (#26220)
PR Close #26220
2018-10-03 15:27:57 -07:00
Andrew Kushnir cb59d87489 feat(ivy): compiler support to generate QUERY_READ_FROM_NODE calls (#26171)
PR Close #26171
2018-10-03 12:28:23 -07:00
Matias Niemelä ab379ab72a refactor(ivy): always use styling helper methods when comparing values (#26149)
PR Close #26149
2018-10-01 09:35:22 -07:00
Matias Niemelä 32e479ffec refactor(ivy): reorganize styling and player files (#26149)
PR Close #26149
2018-10-01 09:35:22 -07:00
Matias Niemelä 391c708d7e fix(ivy): ensure [style]/[class] bindings identity check the previous value (#26149)
PR Close #26149
2018-10-01 09:35:22 -07:00
Matias Niemelä c51331689f refactor(ivy): rename stylingProp => styleProp (#26149)
PR Close #26149
2018-10-01 09:35:22 -07:00
Kara Erickson 68fadd9b97 refactor(ivy): replace LNode.nodeInjector with TNode.injectorIndex (#26177)
PR Close #26177
2018-10-01 09:34:52 -07:00
Igor Minar 9993c72335 feat: add support for TypeScript 3.1 (#26151)
PR Close #26151
2018-09-28 09:34:51 -07:00
Matias Niemelä 63b795ae4a refactor(ivy): make sure that test bed symbols are imported from ivy_switch (#26121)
PR Close #26121
2018-09-27 12:06:34 -07:00
Pawel Kozlowski 5f6900ecc0 feat(ivy): add ability to inspect local refs through context discovery (#26117)
PR Close #26117
2018-09-27 12:00:53 -07:00
Misko Hevery 325e8010e9 fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Misko Hevery 632b19d5c2 fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Andrew Kushnir add1198b88 fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Andrew Kushnir 0ed2df2a36 fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Andrew Kushnir bc1f2d6411 fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Andrew Kushnir d7326d81ba fixup! feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Andrew Kushnir b286abeabe feat(ivy): adding support for ngNonBindable attribute 2018-09-27 11:52:07 -07:00
Ben Lesh ffc6e199bf build: RxJS updated to 6.3 (#26087)
PR Close #26087
2018-09-26 17:01:15 -07:00
Kara Erickson 15a2b8f622 fix(ivy): wrapper fns arent necessary anymore (#26108)
PR Close #26108
2018-09-26 00:03:16 -07:00
Kara Erickson 6a62ed2245 fix(ivy): objects like ElementRef should not use a special injection fn (#26064)
PR Close #26064
2018-09-25 12:51:29 -07:00
Matias Niemelä 0c344715e5 feat(ivy): expose a series of helpful application inspection tools (#25919)
PR Close #25919
2018-09-25 09:46:12 -07:00
Pete Bacon Darwin 206ae7a233 docs(core): remove usage notes from ReflexiveInjector.parent property (#26039)
Properties are not allowed usage notes, and in this case the example
is so simple it didn't warrant moving it to the overall class documentation.

PR Close #26039
2018-09-24 09:11:02 -07:00
Pete Bacon Darwin 79b6256789 docs(core): move headings to `@usageNotes` (#26039)
PR Close #26039
2018-09-24 09:11:02 -07:00
Matias Niemelä 82a14dc107 feat(ivy): provide groundwork for animations in core (#25234)
PR Close #25234
2018-09-21 14:51:24 -07:00
Kara Erickson d5f47d6b71 refactor(ivy): special injection tokens should not be cached (#26048)
PR Close #26048
2018-09-20 18:02:08 -07:00
Alan Agius 549de1e21a fix(core): add missing `peerDependency ` to `@angular/compiler` (#26033)
In 919f42fea1 (diff-58563046c4439699f2e6a89187099a54) a dependency to the compiler was added. However the peerDependency was not added.
PR Close #26033
2018-09-20 10:53:25 -07:00
Adam Plumer 3fb0da2de5 feat(platform-server): update domino to v2.1.0 (#25564)
PR Close #25564
2018-09-19 16:07:36 -07:00
Judy Bogart d0e710d472 docs: copy edit (#25582)
PR Close #25582
2018-09-19 10:43:06 -07:00
Judy Bogart bc7f962039 docs: clean up formats, add detail (#25582)
PR Close #25582
2018-09-19 10:43:06 -07:00