Commit Graph

1187 Commits

Author SHA1 Message Date
Kara Erickson f693be3996 feat(ivy): add pureFunction0 instruction (#22214)
PR Close #22214
2018-02-16 18:03:55 -08:00
Kara Erickson a73d5308e0 refactor(ivy): rename objectLiteral to pureFn to prep for pipes (#22214)
PR Close #22214
2018-02-16 18:03:55 -08:00
Matias Niemelä e1bf067090 fix(animations): report correct totalTime value even during noOp animations (#22225)
This patch ensures that if the NoopAnimationsModule is used then it will
correctly report the associated `totalTime` property within the emitted
AnimationEvent instance when an animation event trigger is fired.

BREAKING CHANGE: When animation is trigged within a disabled zone, the
associated event (which an instance of AnimationEvent) will no longer
report the totalTime as 0 (it will emit the actual time of the
animation). To detect if an animation event is reporting a disabled
animation then the `event.disabled` property can be used instead.

PR Close #22225
2018-02-16 18:03:31 -08:00
Marc Laval dfa2fb95d5 test(ivy): clean the imported renderer2 (#22255)
PR Close #22255
2018-02-16 15:11:23 -08:00
Trotyl Yu 2639b4bffb fix(common): correct mapping of Observable methods (#20518)
fixes #20516
PR Close #20518
2018-02-16 15:10:31 -08:00
Oussama Ben Brahim f1a063298e feat(core): set preserveWhitespaces to false by default (#22046)
Fixes #22027

PR Close #22046
2018-02-16 09:06:14 -08:00
Victor Berchet d241532488 docs(ivy): add a note about exporting top level variables (#22234)
PR Close #22234
2018-02-15 16:16:40 -08:00
Alex Rickabaugh f755db78dc fix(core): require factory to be provided for shakeable InjectionToken (#22207)
InjectionToken can be created with an ngInjectableDef, and previously
this allowed the full expressiveness of @Injectable. However, this
requires a runtime reflection system in order to generate factories
from expressed provider declarations.

Instead, this change requires scoped InjectionTokens to provide the
factory directly (likely using inject() for the arguments), bypassing
the need for a reflection system.

Fixes #22205

PR Close #22207
2018-02-15 16:16:16 -08:00
Victor Berchet 5dd2b5135d refactor(ivy): rename `bindX()` functions to `interpolationX()` (#22229)
rationale: remove the confusion with `bind()` and `bind0()`

PR Close #22229
2018-02-15 14:20:53 -08:00
Alex Rickabaugh 7ac34e42a0 feat: allow direct scoping of @Injectables to the root injector (#22185)
@Injectable() supports a scope parameter which specifies the target module.
However, it's still difficult to specify that a particular service belongs
in the root injector. A developer attempting to ensure that must either
also provide a module intended for placement in the root injector or target
a module known to already be in the root injector (e.g. BrowserModule).
Both of these strategies are cumbersome and brittle.

Instead, this commit adds a token APP_ROOT_SCOPE which provides a
straightforward way of targeting the root injector directly, without
requiring special knowledge of modules within it.

PR Close #22185
2018-02-15 14:20:27 -08:00
Alex Eagle 029dbf0e18 feat(bazel): ng_module produces bundle index (#22176)
It creates the bundle index .d.ts and .metadata.json files.
The names are based on the ng_module target.

PR Close #22176
2018-02-15 14:08:53 -08:00
Alex Eagle bba65e0f41 feat(bazel): introduce a binary stamping feature (#22176)
This grabs version control metadata and makes it available in the build, eg. to put in the version field for released artifacts

PR Close #22176
2018-02-15 14:08:53 -08:00
Alex Eagle a069e08354 refactor(bazel): convert most ts_library to ng_module (#22176)
This is necessary so we can produce ng metadata for our packages that are published as libraries

PR Close #22176
2018-02-15 14:08:53 -08:00
Adrien Boullé 020338230f style: fix typos boostrap to bootstrap (#21917)
PR Close #21917
2018-02-15 09:54:00 -08:00
Victor Berchet a1d86daa71 refactor(ivy): assertion (#22189)
Encourage the use of message to explain the assertion

PR Close #22189
2018-02-15 09:53:05 -08:00
Matias Niemelä 831592c381 Revert "style: fix typos boostrap to bootstrap (#21917)"
This reverts commit 363498b6b4.
2018-02-14 22:56:44 -05:00
Matias Niemelä f628797d91 Revert "refactor(ivy): assertion (#22189)"
This reverts commit 0b683123d2.
2018-02-14 22:56:11 -05:00
Victor Berchet 0b683123d2 refactor(ivy): assertion (#22189)
Encourage the use of message to explain the assertion

PR Close #22189
2018-02-14 18:42:04 -05:00
Adrien Boullé 363498b6b4 style: fix typos boostrap to bootstrap (#21917)
PR Close #21917
2018-02-14 18:21:52 -05:00
JiaLi.Passion 1d571b299d feat(platform-browser): fix #19604, can config hammerOptions (#21979)
PR Close #21979
2018-02-14 15:02:58 -05:00
Kara Erickson a589ca0adb test(ivy): clean up canonical spec (#22188)
PR Close #22188
2018-02-13 13:04:43 -08:00
Trotyl 72f8abd7b3 fix(compiler): make unary plus operator consistent to JavaScript (#22154)
fixes #22089

PR Close #22154
2018-02-13 13:04:30 -08:00
Miško Hevery 20a900b648 test: Add bundle symbol extractor tool (#22002)
This tool will be used for extracting symbols out of bundles so that
we can assert that only whitelisted symbols are allowed.

PR Close #22002
2018-02-13 11:28:54 -08:00
adasilva 6435ecd3c6 fix(platform-browser): support 0/false/null values in transfer_state (#22179)
Issue #22178

PR Close #22179
2018-02-13 11:28:22 -08:00
guillaumebarranco 16d1700a8e fix(core): add stacktrace in log when error during cleanup component in TestBed (#22162)
PR Close #22162
2018-02-13 11:28:08 -08:00
Kara 5e4af7c550 fix(ivy): o2+ should work with multiple template instances (#22075)
Closes #22075
2018-02-13 10:24:41 -08:00
Chuck Jazdzewski be59c3a98c fix(common): weaken AsyncPipe transform signature (#22169)
The AsyncPipe type signature was changed to allow
deferred creation of promises and observalbes that
is supported by the implementation by allowing
`Promise<T>|null|undefined` and by allowing
`Observable<T>|null|undefined`.

PR Close #22169
2018-02-12 15:57:29 -08:00
Chuck Jazdzewski b333919722 build(bazel): allow ng_modules to elide .ngsummary.closure.js files (#22107)
PR Close #22107
2018-02-12 15:57:17 -08:00
Alex Rickabaugh 235a235fab feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.

Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".

Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.

Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.

Additionally, this commit adds several unit and integration tests of various
flavors to test this change.

PR Close #22005
2018-02-12 14:34:59 -08:00
Alex Rickabaugh 2d5e7d1b52 feat(compiler): mark @NgModules in provider lists for identification at runtime (#22005)
All of the providers in a module get compiled into a module definition in the
factory file. Some of these providers are for the actual module types, as those
are available for injection in Angular. For tree-shakeable tokens, the runtime
needs to be able to distinguish which modules are present in an injector.

This change adds a NodeFlag which tags those module providers for later
identification.

PR Close #22005
2018-02-12 14:34:59 -08:00
Alex Rickabaugh 647b8595d0 build: update some ts_library rules to ng_module (#22005)
This is needed so the rules produce metadata.json files, which is essential
for building compiler/integration tests with Bazel.

PR Close #22005
2018-02-12 14:34:59 -08:00
Alex Rickabaugh 0a1a397cd7 fix(platform-browser): add @Injectable where it was missing (#22005)
PR Close #22005
2018-02-12 14:34:59 -08:00
Victor Berchet 62e7b9da1e refactor(ivy): code simplification (#22082)
PR Close #22082
2018-02-12 10:00:56 -08:00
Victor Berchet 61341b2791 refactor(ivy): generatePropertyAliases (#22082)
PR Close #22082
2018-02-12 10:00:56 -08:00
Dan Bucholtz 92a5876f51 refactor(router): move activation to private method (#22033)
PR Close #22033
2018-02-12 10:00:36 -08:00
Misko Hevery 92d7060cb0 Revert "build(bazel): allow ng_modules to elide .ngsummary.closure.js files (#22107)"
This reverts commit 263a2eca88.
2018-02-09 20:08:41 -08:00
Alex Eagle 7e9b120452 build: update to latest bazel rules (#22127)
PR Close #22127
2018-02-09 17:21:54 -08:00
Alex Eagle b081dfe705 fix(bazel): allow TS to read ambient typings (#21876)
Same fix as e70d7a2a7c
This is because the CompilerOptions needs to have directoryExists undefined in order to get the google3 behavior,
so we have to set the property outside the constructor.

Fixes #21872

PR Close #21876
2018-02-09 17:16:25 -08:00
Chuck Jazdzewski 263a2eca88 build(bazel): allow ng_modules to elide .ngsummary.closure.js files (#22107)
PR Close #22107
2018-02-09 16:07:49 -08:00
Olivier Combe 44154e71fd fix(common): round currencies based on decimal digits in `CurrencyPipe` (#21783)
By default, we now round currencies based on the number of decimal digits available for that currency instead of using the rouding defined in the number formats.
More info about that can be found in http://www.unicode.org/cldr/charts/latest/supplemental/detailed_territory_currency_information.html#format_info

Fixes #10189

PR Close #21783
2018-02-09 14:42:23 -08:00
Olivier Combe 0b2f7d13d0 fix(common): regenerate i18n locale data files (#21783)
PR Close #21783
2018-02-09 14:42:23 -08:00
Olivier Combe 420cc7afc6 fix(common): add locale currency values (#21783)
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously)

Fixes #20385

PR Close #21783
2018-02-09 14:42:23 -08:00
Chuck Jazdzewski aa456edafc refactor(ivy): validate that identifier identity in emitted output (#21877)
Modifies validation syntax to generate back references to ensure
that identifiers are used consistently.

Introduced … to allow validating constant definition and usage.

PR Close #21877
2018-02-09 13:06:10 -08:00
Pete Bacon Darwin 7007f51c35 feat(aio): first pass API docs redesign (#21874)
Includes:

* display ToC for API docs
* update dgeni-packages to 0.24.1
* add floating sidebar in API docs
* add breadcrumbs and structured data for Google crawler
* improved rendering of method overloads
* properties rendered in a table
* params rendered with docs
* removal of outdated "infobox" from all API docs

PR Close #21874
2018-02-09 13:05:16 -08:00
Miško Hevery cf8d512e43 Revert "fix(forms): set state before emitting a value from ngModelChange (#21514)"
This reverts commit 9744a1c966.
2018-02-09 10:11:23 -08:00
Miško Hevery 0b1f5d2127 Revert "docs(common): add `HttpParamsOptions` to the public API (#20332)"
This reverts commit a9545aba4d.
2018-02-08 14:37:27 -08:00
Alex Eagle dcf64a0d01 fix(bazel): improve error message for missing assets (#22096)
fixes #22095

PR Close #22096
2018-02-08 10:01:27 -08:00
George Kalpakas a9545aba4d docs(common): add `HttpParamsOptions` to the public API (#20332)
Fixes #20276

PR Close #20332
2018-02-08 09:44:36 -08:00
Kara Erickson d9ae70c699 test(ivy): normalize template names in canonical spec (#21815)
PR Close #21815
2018-02-08 08:55:40 -08:00
Peter Bacon Darwin a751649c8d fix(core): use appropriate inert document strategy for Firefox & Safari (#17019)
Both Firefox and Safari are vulnerable to XSS if we use an inert document
created via `document.implementation.createHTMLDocument()`.

Now we check for those vulnerabilities and then use a DOMParser or XHR
strategy if needed.

Further the platform-server has its own library for parsing HTML, so we
sniff for that (by checking whether DOMParser exists) and fall back to
the standard strategy.

Thanks to @cure53 for the heads up on this issue.

PR Close #17019
2018-02-08 08:55:15 -08:00