Commit Graph

2021 Commits

Author SHA1 Message Date
Kara Erickson 4708cb91ef refactor(ivy): remove reserveSlots instruction (#25533)
PR Close #25533
2018-08-17 14:32:55 -07:00
Wei Huang f053a3f274 test(bazel): Remove --no-sandbox for protractor tests (#25362)
Since we no longer need this flag to run web tests inside a docker
container, this reverts https://github.com/angular/angular/pull/24906

PR Close #25362
2018-08-17 09:58:30 -07:00
Pawel Kozlowski 31f0f5b3c3 feat(ivy): add support for local refs on ng-template (#25482)
PR Close #25482
2018-08-17 09:58:07 -07:00
Marcus Krahl 07d8d3994c feat(router): add UrlSegment[] to CanLoad interface (#13127)
CanLoad now defines UrlSegment[] as a second parameter of the function.
Users can store the initial url segments and refer to them later, e.g. to go
back to the original url after authentication via router.navigate(urlSegments).
Existing code still works as before because the second function parameter
does not have to be defined.

Closes #12411

PR Close #13127
2018-08-16 16:32:18 -07:00
Miško Hevery 116946fb11 style: tslint enforces no debugger statements left behind (#25532)
PR Close #25532
2018-08-16 16:00:22 -07:00
Misko Hevery 503905c807 feat(ivy): add `ngcc` ivy switch (#25238)
Provides a runtime and compile time switch for ivy including
`ApplicationRef.bootstrapModule`.

This is done by naming the symbols such that `ngcc` (angular
Compatibility compiler) can rename symbols in such a way that running
`ngcc` command will switch the `@angular/core` module from `legacy` to
`ivy` mode.

This is done as follows:

```
const someToken__PRE_NGCC__ = ‘legacy mode’;
const someToken__POST_NGCC__ = ‘ivy mode’;

export someSymbol = someToken__PRE_NGCC__;
```

The `ngcc` will search for any token which ends with `__PRE_NGCC__`
and replace it with `__POST_NGCC__`. This allows the `@angular/core`
package to be rewritten to ivy mode post `ngcc` execution.

PR Close #25238
2018-08-16 13:51:42 -07:00
Kara Erickson 6482f6f0fe refactor(ivy): separate container into 2 instructions (#25509)
PR Close #25509
2018-08-16 13:47:14 -07:00
Greg Magolan 9605456b66 build: refactor ambient node & jasmine types so they are only included where needed (#25491)
PR Close #25491
2018-08-16 13:46:43 -07:00
Miško Hevery 9ee6702fa9 refactor(ivy): remove short instruction names as they provide no value (#25493)
PR Close #25493
2018-08-16 11:04:34 -07:00
Victor Berchet 1f1103913a refactor(ivy): cleanup the public API for core/testing (#25492)
PR Close #25492
2018-08-15 09:53:17 -07:00
Alan Agius 01ec5fd6b0 fix(service-worker): `Cache-Control: no-cache` on assets breaks service worker (#25408)
At the moment `cacheAge` can we undefined when having `Cache-Control` set to `no-cache` due the mapping method in `needToRevalidate`

Closes #25442

PR Close #25408
2018-08-14 16:40:15 -07:00
Kieran Whiteman be2cf4dfd6 docs(core): Correct spelling error in directives docs (#25377)
Link to life-cycle hooks was spelt as "life-cycle hoooks".
PR Close #25377
2018-08-14 16:39:33 -07:00
Greg Magolan b5f354f2fb build(bazel): update to rules_typescript 0.16.0 & update to tagged rules_webtesting 0.2.1 (#25433)
PR Close #25433
2018-08-14 16:37:15 -07:00
Ben Lesh a0a29fdd27 feat(ivy): Add AOT handling for bare classes with Input and Output decorators (#25367)
PR Close #25367
2018-08-14 16:36:18 -07:00
Alex Rickabaugh 26066f282e fix(ivy): consider exported modules from other compilation scopes (#25425)
PR Close #25425
2018-08-14 14:23:24 -07:00
Alex Rickabaugh b40c437379 fix(ivy): ensure factory statements are emitted correctly (#25425)
A small bug caused base factory variable statements for @Component to
not be emitted properly. At the same time as this is fixed, those
statements are now emitted as const.

PR Close #25425
2018-08-14 14:23:24 -07:00
Alex Rickabaugh 82e2725154 fix(ivy): handle the case where no base factory is found (#25425)
When an Angular decorated class is inherited, it might be the case that
the entire inheritance chain actually has no constructor defined. In
that event, a factory which simply instantiates the type without any
arguments should be used.

PR Close #25425
2018-08-14 14:23:24 -07:00
Judy Bogart 98f336c0fb docs: add api doc for programmatic animation classes (#24668)
PR Close #24668
2018-08-14 13:15:27 -07:00
Pawel Kozlowski 9117fa199c test(ivy): activate local references canonical spec (#25462)
PR Close #25462
2018-08-14 12:01:55 -07:00
Pawel Kozlowski 0c4209f4b9 refactor(ivy): harmonize container and element / elementContainer signatures (#25458)
PR Close #25458
2018-08-14 12:01:23 -07:00
Victor Berchet 14ac7ad6b4 feat(ivy): implement TestBed (#25369)
PR Close #25369
2018-08-14 11:58:47 -07:00
Victor Berchet 85106375ac refactor(ivy): misc cleanup (#25369)
PR Close #25369
2018-08-14 11:58:47 -07:00
Ben Lesh bbb3f8fa60 docs(ivy): add better documentation around debugging ivy tests (#25432)
PR Close #25432
2018-08-13 21:44:55 -07:00
Martin Probst c869b143c6 build: drop unused re-export of json_marshal. (#25449)
This appears to be unused, and will be removed from rules_typescript now
that `struct.to_json` can take `dicts`.

PR Close #25449
2018-08-13 21:37:41 -07:00
Ben Lesh 1bb30147d3 fix(ivy): add typeof guard around ngDevMode for instances where we cannot set it in Node (#25475)
PR Close #25475
2018-08-13 20:50:53 -07:00
Ben Lesh fb2c5241fc fix(bazel): correct type concatenated to devmode_js (#25467)
PR Close #25467
2018-08-13 17:27:45 -07:00
Ben Lesh 97d8b5ed88 fix(ivy): reordering how root is acquired (#25470)
PR Close #25470
2018-08-13 17:25:47 -07:00
Kara Erickson 4a4d6fb0e6 test(ivy): compiler compliance tests should support ? (#25435)
PR Close #25435
2018-08-10 17:12:18 -07:00
Miško Hevery 2016afdbff fix(ivy): remove ivy dependency on ViewEngine's resolveRendererType2 (#25396)
PR Close #25396
2018-08-10 13:32:04 -07:00
Kara Erickson 409860a4da fix(ivy): queries should be restored when view changes (#25415)
PR Close #25415
2018-08-10 09:13:16 -07:00
Kara Erickson 2b128a47b9 refactor(ivy): queries should not rely on LNode (#25415)
PR Close #25415
2018-08-10 09:13:16 -07:00
Pawel Kozlowski 2d759927d4 feat(ivy): add support for ng-container in the compiler (#25383)
PR Close #25383
2018-08-09 13:13:04 -07:00
Alex Rickabaugh 7058072ff6 feat(ivy): enable .ngfactory.js generation in g3 only (#25392)
This turns on generation of ngfactory.js files when compiling in Ivy
mode in g3. They're not turned on for Bazel users as there appears to
be a strange interaction with the way our tests run in Bazel mode.

PR Close #25392
2018-08-09 09:58:13 -07:00
Alex Rickabaugh 33fd7e0784 fix(ivy): export NgModuleFactory via r3_symbols for core factories (#25392)
When @angular/core is compiled by ngtsc, a factory file is generated
for ApplicationModule, that is currently invalid because r3_symbols
does not export NgModuleFactory. This change fixes that issue and
ensures the generated ngfactory file for @angular/core is valid.

PR Close #25392
2018-08-09 09:58:13 -07:00
Alex Rickabaugh 2befc65777 fix(ivy): ngtsc should pay attention to declaration order (#25392)
When generating the 'directives:' property of ngComponentDef, ngtsc
needs to be conscious of declaration order. If a directive being
written into the array is declarated after the component currently
being compiled, then the entire directives array needs to be wrapped
in a closure.

This commit fixes ngtsc to pay attention to such ordering issues
within directives arrays.

PR Close #25392
2018-08-09 09:58:13 -07:00
Alex Rickabaugh 6f085f8610 fix(ivy): add missing exportAs field to ngDirectiveDef (#25392)
This commit includes the missing exportAs field from @Directive and
propagates it into the ngDirectiveDef.

PR Close #25392
2018-08-09 09:58:13 -07:00
Alex Rickabaugh 5be186035f feat(ivy): enable inheritance of factory functions in definitions (#25392)
This commit creates an API for factory functions which allows them
to be inherited from one another. To do so, it differentiates between
the factory function as a wrapper for a constructor and the factory
function in ngInjectableDefs which is determined by a default
provider.

The new form is:

factory: (t?) => new (t || SomeType)(inject(Dep1), inject(Dep2))

The 't' parameter allows for constructor inheritance. A subclass with
no declared constructor inherits its constructor from the superclass.
With the 't' parameter, a subclass can call the superclass' factory
function and use it to create an instance of the subclass.

For @Injectables with configured providers, the factory function is
of the form:

factory: (t?) => t ? constructorInject(t) : provider();

where constructorInject(t) creates an instance of 't' using the
naturally declared constructor of the type, and where provider()
creates an instance of the base type using the special declared
provider on @Injectable.

PR Close #25392
2018-08-09 09:58:13 -07:00
Alex Rickabaugh fba276d3d1 fix(ivy): use a single constant pool per source file (#25392)
Previously, ngtsc used a new ConstantPool for each decorator
compilation. This could result in collisions between constants in the
top-level scope.

Now, ngtsc uses a single ConstantPool for each source file being
compiled, and merges the constant statements into the file after the
import section.

PR Close #25392
2018-08-09 09:58:13 -07:00
Pawel Kozlowski 9c92a6fc7a test(ivy): add test for <ng-container> and shallow queries (#25379)
PR Close #25379
2018-08-09 07:35:01 -07:00
Alex Eagle 6c4da9dcd3 build: stop printing source-map-support warning (#25339)
PR Close #25339
2018-08-08 19:02:57 -07:00
Miško Hevery b64fed1ba3 fix(ivy): prevent ngDevMode from getting removed too early (#25371)
PR Close #25371
2018-08-08 13:13:16 -07:00
Alex Eagle a3f1e2cb42 style: format .bzl files with buildifier (#23544)
PR Close #23544
2018-08-08 13:12:07 -07:00
Alex Eagle bfdbdc2ee6 docs(bazel): add skydoc generation (#23544)
PR Close #23544
2018-08-08 13:12:07 -07:00
Igor Minar 74518c4b2e style: fix whitespace and indentation in the testing guide (#21669)
PR Close #21669
2018-08-08 13:11:15 -07:00
JiaLi.Passion ebf508fcd0 docs: add docs for fakeAsync test with custom macroTask in aio (#21669)
PR Close #21669
2018-08-08 13:11:15 -07:00
Roope Hakulinen 732026c3f5 feat(core): add DoBootstrap interface. (#24558)
Closes #24557.

PR Close #24558
2018-08-07 13:17:06 -07:00
Pawel Kozlowski af9ced9026 fix(ivy): project ng-container nodes (#25354)
PR Close #25354
2018-08-07 12:02:48 -07:00
Ádám Lippai c6e5b971d6 fix(compiler-cli): use the oldProgram option in watch mode (#21364)
The performCompilation() is always called with an undefined oldProgram option (even in watch mode).
This was regression introduced in: 957be960d2

Partial fix, discovered in: #21361

PR Close #21364
2018-08-07 11:58:38 -07:00
Pawel Kozlowski dbdbbdbe86 fix(ivy): support ng-container inside another ng-container (#25346)
PR Close #25346
2018-08-07 11:48:42 -07:00
Alex Rickabaugh fefc860f35 fix(ivy): fix bug with banana-in-a-box expressions in nested templates (#25321)
Inside of a nested template, an attempt to generate code for a banana-
in-a-box expression would cause a crash in the _AstToIrVisitor, as it
was not handling the case where a write would be generated to a local
variable.

This change supports such a mode of operation.

PR Close #25321
2018-08-07 11:45:32 -07:00