10780 Commits

Author SHA1 Message Date
Alex Rickabaugh
34c42836cf test(ivy): move hello_world and todo fully to ngtsc ()
ngtsc is sufficiently capable now that it can compile hello_world
and todo and achieve equivalent results to ngc in ivy (global) mode.

Bundle sizes:
hello_world - 3.0 kB
todo        - 14.7 kB

PR Close 
2018-06-28 17:51:42 -04:00
Alex Rickabaugh
50d4a4fe5c fix(compiler): fix a few non-tree-shakeable code patterns ()
This change makes @angular/compiler more tree-shakeable by changing
an enum to a const enum and by getting rid of a top-level map that
the tree-shaker was seeing as a reference which caused r3_identifiers
to be retained.

This drops a few hundred bytes of JS from tree-shaken ngtsc compiled
apps.

PR Close 
2018-06-28 17:51:42 -04:00
Alex Rickabaugh
69510acb20 test(ivy): symbol extractor should handle different compile options ()
The js_expected_symbol_test implementation extracts symbols names
from a rollup iife bundle. Previously, it only handled the case
with a simple 'var bundle = ...;' statement.

Sometimes, rollup produces a more complex bundle, where the 'bundle'
variable is not the only top-level variable declared in the same
declaration statement. This commit patches the symbol exctractor
to support this more complex case.

Additionally, when the symbol test fails, it prints a command to
accept the symbol diff. This command needs to include the
--define=compile flag to ensure the diff is applied in the same
compile mode as the test was run.

PR Close 
2018-06-28 17:51:42 -04:00
Alex Rickabaugh
ef1c6d8c26 feat(ivy): dummy handler for @Pipe to cause decorator removal ()
Currently ngtsc does not compile @Pipe. This has a side effect
of not removing the @Pipe decorator.

This adds a dummy DecoratorHandler that compiles @Pipe into an
empty ngPipeDef. Eventually this will be replaced with a full
implementation, but for now this solution allows compield code
to be tree-shaken properly.

PR Close 
2018-06-28 17:51:42 -04:00
Alex Rickabaugh
2ecaa40e64 build(ivy): run latest build-optimizer on ngtsc compiled code ()
Previously the repo was depending on an old version of build optimizer.
This change updates to the latest (an RC release in the CLI package).

Additionally, this changes the behavior of ng_rollup_bundle to apply
the optimizer to ngtsc compiled code, and configures it to treat the
@angular/compiler package as side-effect-free.

This results in a substantial size reduction of ngtsc compiled code.

PR Close 
2018-06-28 17:51:42 -04:00
Alex Rickabaugh
fc4dc35426 feat(ivy): strip all Angular decorators in compiled classes ()
Previously ngtsc removed the class-level decorators (@Component,
etc) but left all the ancillary decorators (@Input, @Optional,
etc).

This changes the transform to descend into the members of decorated
classes and remove any Angular decorators, not just the class-level
ones.

PR Close 
2018-06-28 17:51:41 -04:00
Alex Rickabaugh
104d30507a feat(ivy): able to compile @angular/core with ngtsc ()
@angular/core is unique in that it defines the Angular decorators
(@Component, @Directive, etc). Ordinarily ngtsc looks for imports
from @angular/core in order to identify these decorators. Clearly
within core itself, this strategy doesn't work.

Instead, a special constant ITS_JUST_ANGULAR is declared within a
known file in @angular/core. If ngtsc sees this constant it knows
core is being compiled and can ignore the imports when evaluating
decorators.

Additionally, when compiling decorators ngtsc will often write an
import to @angular/core for needed symbols. However @angular/core
cannot import itself. This change creates a module within core to
export all the symbols needed to compile it and adds intelligence
within ngtsc to write relative imports to that module, instead of
absolute imports to @angular/core.

PR Close 
2018-06-28 17:51:41 -04:00
Jason Aden
c57b491778 release: cut the v6.1.0-beta.3 release 2018-06-27 18:12:36 -07:00
Jason Aden
1dc7d0d29e release: cut the v6.0.7 release 2018-06-27 17:53:49 -07:00
Olivier Combe
39c8baea31 fix(common): use correct ICU plural for locale mk ()
PR Close 
2018-06-27 15:03:34 -07:00
George Kalpakas
abed2cd52c refactor(upgrade): fix examples for strictPropertyInitialization and remove internal comments () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Kapunahele Wong
22758912a0 docs(aio): tech edits to upgrade-lazy () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Peter Bacon Darwin
bb6b59128f docs(upgrade): use a class for upgraded service () ()
This makes the resulting use in Angular more ideomatic, since we can just
use the class type as the injection indicator.

PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Peter Bacon Darwin
4258c3d1df docs(upgrade): fix sub-ordered-list syntax () ()
We must always use 1., 2. etc, to indicate ordered lists, even for sub-lists.
We can change the sublist to display as a., b. etc, via CSS.

PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
70156bc4ed docs(upgrade): add guide about downgradeModule() () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
2ac2ab7ff6 docs(upgrade): add API docs for downgradeModule() () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
ca0a55f4ee docs(upgrade): add API docs for propagateDigest () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
0b3d25d67e docs(upgrade): update API docs for upgrade/static () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
24e0c3d43d docs: minor fixes in docs-style-guide () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Georgios Kalpakas
922908818f test: minor improvements in examples e2e tests script () ()
PR Close 

PR Close 
2018-06-27 15:01:47 -07:00
Nico de Haen
8dec381145 docs: fix unit tests in toh-pt6 ()
Resolves 

PR Close 
2018-06-27 14:33:26 -07:00
Alan Agius
32da3e1602 docs: add explanation for enableResourceInlining ()
PR Close 
2018-06-27 14:31:53 -07:00
Max Ivanov
6d68f3e39a docs(changelog): remove repeating blocks ()
PR Close 
2018-06-27 14:29:20 -07:00
Pawel Kozlowski
50fb13fb09 fix(ivy): report results to appropriate content queries ()
PR Close 
2018-06-27 14:20:34 -07:00
Kara Erickson
fe8fcc834c refactor(ivy): remove dynamicParent from LNode ()
PR Close 
2018-06-27 14:14:46 -07:00
Tomasz Kula
5c0e681bf3 docs(aio): fix adding to template driven forms ()
PR Close 
2018-06-26 11:03:36 -07:00
Tomasz Kula
7d6e833a6f docs(aio): fix issues suggested by Brandon ()
PR Close 
2018-06-26 11:03:35 -07:00
Tomasz Kula
49e900d6fc docs(aio): fix issues suggested by Kara ()
PR Close 
2018-06-26 11:03:35 -07:00
Tomasz Kula
5feb9e1935 docs(aio): address pr review issues ()
PR Close 
2018-06-26 11:03:35 -07:00
Tomasz Kula
002a5afa98 docs(aio): add cross field validation example ()
PR Close 
2018-06-26 11:03:35 -07:00
Pete Bacon Darwin
cf0968f98e build(docs-infra): support hiding constructors of injectable classes ()
Classes that are injectable often have constructors that should not be
called by the application developer. It is the responsibility of the
injector to instantiate the class and the constructor often contains
private implementation details that may need to change.

This commit removes constructors from the docs for API items that are
both:

a) Marked with an injectable decorator (e.g. Injectable, Directive,
Component, Pipe), and
b) Have no constructor description

This second rule allows the developer to override the removal if there
is something useful to say about the constructor.

Note that "normal" classes such as `angimations/HttpHeaders` do not have
their constructor removed, despite (at this time) having no description.

PR Close 
2018-06-26 10:58:11 -07:00
Alex Rickabaugh
855e8ad9f6 fix(ivy): use closure-safe field name for JIT of ngInjectableDef ()
PR Close 
2018-06-26 10:56:54 -07:00
Alex Rickabaugh
89c442270a feat(ivy): generate ngInjectorDef for @NgModule in JIT mode ()
This commit takes advantage of the @angular/compiler work for ngInjectorDef
in AOT mode in order to generate the same definition in JIT mode.

PR Close 
2018-06-26 10:56:53 -07:00
Alex Rickabaugh
ae9418c7de feat(ivy): generate ngInjectorDef for @NgModule in AOT mode ()
This change generates ngInjectorDef as well as ngModuleDef for @NgModule
annotated types, reflecting the dual nature of @NgModules as both compilation
scopes and as DI configuration containers.

This required implementing ngInjectorDef compilation in @angular/compiler as
well as allowing for multiple generated definitions for a single decorator in
the core of ngtsc.

PR Close 
2018-06-26 10:56:53 -07:00
Miško Hevery
166d90d2a9 ci: fix broken build 2018-06-25 11:36:35 -07:00
Judy Bogart
7d318743c1 docs: test doc for decorator templates () ()
PR Close 

PR Close 
2018-06-25 10:49:31 -07:00
Judy Bogart
2a68ba4cbb docs: fix misdirected group links ()
PR Close 
2018-06-25 10:03:42 -07:00
Judy Bogart
d244523ae6 docs: test api doc for pipes ()
PR Close 
2018-06-25 09:37:30 -07:00
George Kalpakas
941d2cdaaf test(aio): fix upgrade-phonecat examples e2e tests ()
Closes 

PR Close 
2018-06-25 09:30:46 -07:00
George Kalpakas
7d1f9c8a7c build: upgrade AngularJS typings ()
Previously, we were using [@types/angularjs][1], which is deprecated and
outdated (hasn't been updated for over two years). This PR switches to
[@types/angular][2], which is regularly updated (based on the
definitions on [DefinitelyTyped][3]).

[1]: https://www.npmjs.com/package/@types/angularjs
[2]: https://www.npmjs.com/package/@types/angular
[3]: https://github.com/DefinitelyTyped/DefinitelyTyped

PR Close 
2018-06-25 09:30:46 -07:00
Misko Hevery
f841e36543 ci: scripts to review PRs locally ()
PR Close 
2018-06-25 08:45:12 -07:00
Marc Laval
f229449c67 refactor(ivy): insert embedded views immediately ()
PR Close 
2018-06-25 07:58:33 -07:00
Vikram Subramanian
6e20e0aac8 fix(animations): set animations styles properly on platform-server ()
Animations styles weren't getting properly set on platform-server because of erroneous checks and absence of reflection of style property to attribute on the server.

The fix corrects the check for platform and explicitly reflects the style property to the attribute.

PR Close 
2018-06-25 07:58:11 -07:00
Pawel Kozlowski
1e139d4339 refactor(ivy): rename, limit usage of global vars ()
PR Close 
2018-06-25 07:57:52 -07:00
yjaaidi
fba3f10938 docs: add guide-angular.wishtack.io to education resources ()
PR Close 
2018-06-25 07:57:33 -07:00
Rado Kirov
c95437f15d build(bazel): Turning on strictPropertyInitialization for Angular. ()
All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close 
2018-06-25 07:57:13 -07:00
Georgi Parlakov
39c7769c9e docs(core): typo in static injector tests ()
PR Close 
2018-06-25 07:56:56 -07:00
Pete Bacon Darwin
8c51ce6f3b build(docs-infra): move overload short description above syntax ()
PR Close 
2018-06-25 07:56:36 -07:00
George Kalpakas
71b0c3d469 docs(elements): mention comp: elements as a valid label ()
PR Close 
2018-06-25 07:56:14 -07:00
George Kalpakas
b8760a0ca5 test(elements): test typings against TS 2.7 and 2.8 ()
PR Close 
2018-06-25 07:56:14 -07:00