Commit Graph

1596 Commits

Author SHA1 Message Date
Alex Eagle be10bf538b fix(bazel): don't try to do flatmoduleindex under Blaze (#23083)
PR Close #23083
2018-03-29 22:23:49 -07:00
Igor Minar 439030fb57 fix(bazel): complete the rollup globals list for all angular entrypoints (#23080)
PR Close #23080
2018-03-29 20:34:58 -07:00
Alex Eagle 481b22ecb0 fix(bazel): downlevel decorators in fesm5 files (#23078)
Needed so that our bundles appear side-effect-free to tools like webpack

PR Close #23078
2018-03-29 18:53:49 -07:00
Alex Eagle 45e090b614 fix(bazel): pass --global option to rollup (#23073)
This fixes the UMD bundles which otherwise don't contain the right global symbols

PR Close #23073
2018-03-29 17:44:43 -07:00
Alex Eagle 0d9140cdce fix(bazel): ng_package should include private exports in fesms (#23054)
PR Close #23054
2018-03-29 14:11:12 -07:00
Chuck Jazdzewski 9fb08e2377 ci(language-service): enable language service tests in bazel (#23001)
PR Close #23001
2018-03-29 13:11:27 -07:00
Victor Berchet 28058b784b fix(compiler): fix support for html-like text in translatable attributes (#23053)
PR Close #23053
2018-03-29 08:58:27 -07:00
Alex Eagle 00497437a6 fix(bazel): don't inline tslib into fesms (#23044)
PR Close #23044
2018-03-28 10:19:14 -07:00
Chuck Jazdzewski 4e004f3783 ci(compiler-cli): run compiler-cli tests in bazel (#22997)
PR Close #22997
2018-03-28 10:02:53 -07:00
George Kalpakas d9dc46e651 fix(service-worker): ignore invalid `only-if-cached` requests (#22883)
Under some circumstances (possibly related to opening Chrome DevTools),
requests are made with `cache: 'only-if-cached'` and `mode: 'no-cors'`.
These request will eventually fail, because `only-if-cached` is only
allowed to be used with `mode: 'same-origin'`.
This is likely a bug in Chrome DevTools.

This commit avoids errors related to such requests by not handling them.

Fixes #22362

PR Close #22883
2018-03-28 10:02:16 -07:00
George Kalpakas 9e9b8dd494 fix(service-worker): do not enter degraded mode when offline (#22883)
Previously, when trying to fetch `ngsw.json` (e.g. during
`checkForUpdate()`) while either the client or the server were offline,
the ServiceWorker would enter a degrade mode, where only existing
clients would be served. This essentially meant that the ServiceWorker
didn't work offline.
This commit fixes it by differentiating offline errors and not entering
degraded mode. The ServiceWorker will remain in the current mode until
connectivity to the server is restored.

Fixes #21636

PR Close #22883
2018-03-28 10:02:16 -07:00
George Kalpakas 12665a749c test(service-worker): minor test fixes and refactorings (#22883)
PR Close #22883
2018-03-28 10:02:16 -07:00
Kara Erickson e2e80ec61c refactor(ivy): remove pipe references from the template (#23032)
PR Close #23032
2018-03-28 09:17:27 -07:00
Kara Erickson 5a86f7144f fix(ivy): store local variables in data instead of calling loadDirective (#23029)
PR Close #23029
2018-03-28 09:17:05 -07:00
Alex Rickabaugh bd024c02e2 feat(compiler): lower @NgModule ids if needed (#23031)
This change allows the id of an NgModule to be dynamically computed if
needed.

PR Close #23031
2018-03-28 09:15:16 -07:00
Alex Rickabaugh 884bf0ef09 fix: consistently rewrite Injector to INJECTOR (#23008)
In Ivy mode we rewrite references to Injector to INJECTOR in ngInjectableDef, to fix tree-shaking.

This changes the rewrite to happen always, even in non-Ivy mode, and makes Angular understand
INJECTOR across the board at runtime.

PR Close #23008
2018-03-28 09:14:32 -07:00
Alex Eagle 0b348c8ffe build: fix bazel stamping (#22965)
As pointed out in https://github.com/bazelbuild/rules_nodejs/issues/156
our mechanism would never pick up changes to the version info.

PR Close #22965
2018-03-28 09:00:02 -07:00
Keen Yee Liau ed53c5ccdd refactor(language-service): Remove angularOnlyResults (#22636)
This commit is a duplicate of https://github.com/angular/angular/pull/18637
to remove Angular-specific results from the language service.

PR Close #22636
2018-03-27 17:22:44 -04:00
Olivier Combe d28ce50067 test(ivy): make sure `goog.getMsg()` is defined before being used (#22998)
PR Close #22998
2018-03-27 17:07:50 -04:00
Veres Lajos 0ebdb3d12f style: typo fix amendments (#22975)
PR Close #22975
2018-03-27 14:51:53 -04:00
Veres Lajos de90314304 style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975)
PR Close #22975
2018-03-27 14:51:53 -04:00
Kara Erickson f739f756ce test(ivy): fix flaky tests (#23010)
PR Close #23010
2018-03-27 14:48:50 -04:00
Kara Erickson 910a16a1ff refactor(ivy): remove directive references from template (#22986)
PR Close #22986
2018-03-26 22:33:23 -04:00
Jeremy Elbourn 2aabbc51fa fix(bazel): ng_package packages attr not forwarded to npm_package (#22967)
PR Close #22967
2018-03-26 22:32:09 -04:00
Jeremy Elbourn 2388f24256 build(bazel): add entry_point_name attr to ng_package (#22963)
PR Close #22963
2018-03-26 22:30:16 -04:00
Alex Eagle 27e14b2fb3 feat(bazel): prefix private-export (barred-latin-o) symbols (#23007)
This allows a bundle index to be re-exported by a higher-level module without fear of collisions.
Under bazel, we always set the prefix to be underscore-joined workspace, package, label

PR Close #23007
2018-03-26 22:28:55 -04:00
Matias Niemelä bf6a416bce revert: docs(common): add `HttpParamsOptions` to the public API (#20332)
This reverts commit 7b7757dd3d.
2018-03-26 16:29:46 -04:00
George Kalpakas 7b7757dd3d docs(common): add `HttpParamsOptions` to the public API (#20332)
Fixes #20276

PR Close #20332
2018-03-23 16:31:10 -04:00
Alex Rickabaugh 6f0191744c fix(core): don't override ngInjectableDef in the decorator if present on the type (#22943)
Previously, @Injectable() would generate an ngInjectableDef on the type it was
decorating, even if that type already had a compiled ngInjectableDef, overwriting
the compiled version.

PR Close #22943
2018-03-23 16:13:06 -04:00
Victor Berchet 65f296a676 test(compiler): assert translation names pattern (#22960)
PR Close #22960
2018-03-23 15:06:06 -04:00
Misko Hevery b9cbe83104 docs(ivy): update STATUS.md with compiler work breakdown (#22874)
PR Close #22874
2018-03-23 15:04:55 -04:00
sergeome 7966744a44 fix(common): titlecase pipe (#22600)
PR Close #22600
2018-03-23 13:42:51 -04:00
Jeremy Elbourn d9a0a8ff3e build(bazel): add `data` attr to ng_package (#22919)
PR Close #22919
2018-03-23 13:16:07 -04:00
Victor Berchet bcaa07b0ac refactor(compiler): move handling of translations to the ConstantPool (#22942)
PR Close #22942
2018-03-23 13:12:58 -04:00
Victor Berchet d98e9e7c7f fix(compiler): take quoting into account when determining if object literals can be shared (#22942)
PR Close #22942
2018-03-23 13:12:58 -04:00
Victor Berchet 5ab9d4d437 test(compiler): allow asserting matching identifier names (#22835)
PR Close #22835
2018-03-22 21:24:19 -04:00
Victor Berchet 129bb1800b refactor(compiler): refactor code matching helpers for compliance spec (#22835)
PR Close #22835
2018-03-22 21:24:19 -04:00
Kara Erickson 49396ca2ae refactor(ivy): move directives into separate array (#22918)
PR Close #22918
2018-03-22 21:23:02 -04:00
Chuck Jazdzewski 8ca26a9ebb ci(compiler): run compiler tests in bazel (#22900)
PR Close #22900
2018-03-22 19:22:14 -04:00
Kara Erickson e44f69c387 refactor(ivy): move dir flags to tnode (#22901)
PR Close #22901
2018-03-22 19:19:40 -04:00
Olivier Combe 99711b12f9 test(core): hello world i18n demo (#22654)
PR Close #22654
2018-03-22 19:01:51 -04:00
Olivier Combe 204ba9d413 feat(compiler): add basic support for in ivy/i18n code generation (#22654)
PR Close #22654
2018-03-22 19:01:51 -04:00
Matias Niemelä e5e1b0da33 fix(animations): treat numeric state name values as strings (#22923)
This patch ensures that if a numeric state name value in an animation
is detected then it will not throw an error. Normally this wouldn't
occur, but some JS optimizers may convert a quoted numeric value
(like "1" to 1) in some cases to save space. This patch makes sure
that Angular doesn't throw an error when this occurs.

PR Close #22923
2018-03-22 19:00:58 -04:00
Matias Niemelä d77bb460b0 revert: docs(ivy): update STATUS.md with compiler work breakdown (#22874)
This reverts commit b524e4b142.
2018-03-22 18:09:45 -04:00
Miško Hevery c84817970e fix(ivy): remove custom tsconfig from render3 (#22913)
PR Close #22913
2018-03-22 18:02:48 -04:00
Misko Hevery b524e4b142 docs(ivy): update STATUS.md with compiler work breakdown (#22874)
PR Close #22874
2018-03-22 18:01:38 -04:00
Matias Niemelä f88fba020b fix(animations): avoid animation insertions during router back/refresh (#21977)
Closes #19712

PR Close #21977
2018-03-22 17:59:41 -04:00
Victor Berchet 32105c8012 test: temporarily disable ng_package test (#22933)
PR Close #22933
2018-03-22 15:27:28 -04:00
Victor Berchet 4a075e885f test: display a diff when example_apckage.spec.ts fails to ease debugging (#22933)
PR Close #22933
2018-03-22 15:27:28 -04:00
Rado Kirov 838a610197 fix(compiler): don't typecheck all inputs (#22899)
ngc knows to filter out d.ts inputs, but the logic accidentally
depended on whether it had a previous Program lying around.

Fixing that logic puts ngc on the fast code path, but in that code
path it must be able to merge tsickle EmitResults, so we need to
plumb the tsickle.mergeEmitResults function through all the intervening
APIs.  The bulk of this change is that plumbing.

PR Close #22899
2018-03-21 18:29:18 -04:00
Alex Eagle 64efcf103c build: add the FESM files back to ng_package (#22889)
PR Close #22889
2018-03-21 13:19:19 -07:00
adasilva 8c2a57878b fix(service-worker): fix LruList bugs (#22769)
'remove' method not removing url from state.map
'accessed' method not removing 'previous' reference from existing  node when it becomes the head

Fixes #22218
Fixes #22768

PR Close #22769
2018-03-21 13:11:26 -07:00
Igor Minar 8768665587 fix: correct peerDependencies declaration on rxjs 2018-03-20 22:48:41 -07:00
Jason Aden 623d769858 fix(router): make locationSyncBootstrapListener public due to change in output after TS 2.7 update in #22669 (#22896)
PR Close #22896
2018-03-20 17:40:25 -07:00
Miško Hevery 17fb9832f4 fix(ivy): fix type error in newer version of TS (#22897)
Newer version of TS is stricter about types and flags counter-variant
types in some  situations. This change inlines the DirectiveDefArgs
into the arguments which:
1) removes the inheritance which caused the issue and
2) Makes it more friendly to IDEs since they will not report comments.

Closes #22877
Closes #22843

PR Close #22897
2018-03-20 15:49:45 -07:00
Igor Minar 3cc5c2e4d0 build: update to rxjs@6.0.0-beta.0 (#22887)
PR Close #22887
2018-03-20 15:26:49 -07:00
Vikram Subramanian e6c731f791 fix(router): don't use spread operator to workaround an issue in closure compiler (#22884)
Closure compiler could not handle the spread operator in this one place. Working around it by removing the use of spread operator.

PR Close #22884
2018-03-20 13:30:37 -07:00
Igor Minar 7d095b96cd fix: correct several esm2015 entry-points in package.jsons (#22892)
PR Close #22892
2018-03-20 13:30:08 -07:00
Alex Eagle 689f351092 build: expose flatModuleOutFile option on ng_module (#22814)
This lets projects like Material change ng_package "bundle index" files to non-conflicting paths

Currently packages like @angular/core ship with the generated metadata
in a path like 'core.js' which overwrites one of the inputs.

Angular material puts the generated file in a path like 'index.js'

Either way these files generated by ng_module rules have the potential
to collide with inputs given by the user, which results in an error.

Instead, give users the freedom to choose a different non-conflicting name.

Also this refactors the ng_package rule, removing the redundant
secondary_entry_points attribute.

Instead, we assume that any ng_module in the deps with a module_name
attribute is a secondary entry point.

PR Close #22814
2018-03-20 13:28:57 -07:00
Igor Minar b43f8bc7d3 feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)
PR Close #22573
2018-03-19 21:51:51 -07:00
Domas Trijonis 2b3de6390f fix(upgrade): two-way binding and listening for event (#22772)
Changes would not propagate to a value in downgraded component in case you had two-way binding and listening to a value-change, e.g. [(value)]="value" (value-change)="fetch()"

Closes #22734

PR Close #22772
2018-03-19 22:44:36 -05:00
Rado Kirov 5c387a7f3c fix(compiler): do not emit line/char in ngsummary files. (#22840)
Having ngsummaries emit line/char numbers causes white space change to
retrigger upstream recompilations.

PR Close #22840
2018-03-19 16:01:41 -07:00
Misko Hevery fc50c77bd3 test(ivy): switch HelloWorld to ivy compiler (#22788)
PR Close #22788
2018-03-19 16:00:38 -07:00
Greg Magolan bfe077ad64 fix(bazel): correct expected outs for external sources in ng_module (#22755)
PR Close #22755
2018-03-19 16:30:01 -05:00
Kara Erickson 1a0cb21538 refactor(ivy): remove unnecessary binding from hello world (#22848)
PR Close #22848
2018-03-19 16:29:45 -05:00
Igor Minar 0bede54b2d style: fix formatting issues on the master branch (#22854)
PR Close #22854
2018-03-18 14:03:26 -07:00
Kara Erickson e27cfd6236 refactor(ivy): split up directiveCreate for tree shaking (#22838)
PR Close #22838
2018-03-18 11:56:35 -07:00
Kara Erickson 1612985e48 refactor(ivy): allow tick and deps to be tree-shaken (#22838)
PR Close #22838
2018-03-18 11:47:44 -07:00
Kara Erickson 4f21d373b7 refactor(ivy): move hostBindings calls out of template (#22833)
PR Close #22833
2018-03-18 11:41:39 -07:00
Igor Minar ce63dc6f95 feat: update the package output of build.sh to APF v6 (#22808)
PR Close #22808
2018-03-18 09:33:51 -07:00
Igor Minar d54615d555 build: don't mark language-service package as sideEffect free (#22808)
we are not sure if this is the case and we don't need this package to
be optimized at the moment.

PR Close #22808
2018-03-18 09:33:51 -07:00
Miško Hevery f258ec67bf docs(ivy): update status of ivy (#22834)
PR Close #22834
2018-03-16 22:20:21 -07:00
Rob Wormald 5d82d8da6d fix(elements): fix elements test bootstrap (#22839)
PR Close #22839
2018-03-16 22:19:50 -07:00
Alex Rickabaugh 6ef9f2278f feat(ivy): @NgModule -> ngInjectorDef compilation (#22458)
This adds compilation of @NgModule providers and imports into
ngInjectorDef statements in generated code. All @NgModule annotations
will be compiled and the @NgModule decorators removed from the
resultant js output.

All @Injectables will also be compiled in Ivy mode, and the decorator
removed.

PR Close #22458
2018-03-16 12:57:11 -07:00
Andrew Seguin 688096b7a3 feat(elements): remove attribute/input from config (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 2e450f6fda feat(elements): update package.json with latest (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 0b45dfac29 feat(elements): fix lint (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 167fdf745c feat(elements): rename API to createCustomElement (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 39a12d2c3d feat(elements): make bazel happy (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 87f60bccfd feat(elements): injector create (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 46efd4b938 feat(elements): George's comments (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 19368085aa feat(elements): provide type, not factory; remove config need (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin d2be675acc feat(elements): add tests for component factory strategy (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Andrew Seguin 22b96b9690 feat(elements): add support for creating custom elements (#22413)
PR Close #22413
2018-03-16 12:39:07 -07:00
Chuck Jazdzewski cedc04c320 docs(ivy): document project status (#22751)
Moves the status reporting from the issue #21706 to a file that
can be updated as changes are being made. This addresses one of the
comments on the issue and allows better tracking of updates to this
status and changes made.

PR Close #22751
2018-03-16 11:27:15 -07:00
Kara Erickson bafdad9083 fix(ivy): cache local names and support multiple locals with same value (#22807)
PR Close #22807
2018-03-16 11:26:38 -07:00
Kara Erickson 9220521149 test(ivy): correct export tests and add query test (#22807)
PR Close #22807
2018-03-16 11:26:38 -07:00
Jeremy Elbourn b149424b11 build(bazel): make ng_package auto generate package.json for secondary entry-points (#22806)
PR Close #22806
2018-03-15 21:18:27 -07:00
Oussama Ben Brahim 269c3a1908 build(compiler-cli): fix tsconfig.json circularity issue (#22722)
Fixes #22721

PR Close #22722
2018-03-15 21:18:07 -07:00
Alex Eagle f9247e4b2e build: enable importHelpers in tsconfig (#22812)
This is the primary tsconfig file used for Bazel builds.
Previously, we enabled this option only for releases.

PR Close #22812
2018-03-15 21:16:03 -07:00
Igor Minar 44de10e2db feat: mark angular packages as side-effect free (#22785)
This flag is picked up by webpack v4 and used for more agressive optimizations.

Our code is already side-effect free, because that's what we needed for build-optimizer to work.

PR Close #22785
2018-03-15 14:52:40 -07:00
Victor Berchet 0ebd577db4 refactor(compiler): Drop support for the deprecated `<template>`. Use `<ng-template>` instead (#22783)
BREAKING CHANGE:

The `<template>` tag was deprecated in Angular v4 to avoid collisions (i.e. when
using Web Components).

This commit removes support for `<template>`. `<ng-template>` should be used
instead.

BEFORE:

    <!-- html template -->
    <template>some template content</template>

    # tsconfig.json
    {
      # ...
      "angularCompilerOptions": {
        # ...
        # This option is no more supported and will have no effect
        "enableLegacyTemplate": [true|false]
      }
    }

AFTER:

    <!-- html template -->
    <ng-template>some template content</ng-template>

PR Close #22783
2018-03-15 14:52:22 -07:00
Kara Erickson 4e6ac185e5 refactor(ivy): double size of DI bloom filter (#22775)
PR Close #22775
2018-03-15 14:49:39 -07:00
Kara Erickson e55bf8fa79 refactor(ivy): access component def through tData (#22771)
PR Close #22771
2018-03-15 14:49:23 -07:00
Olivier Combe 3b167be069 feat(compiler): support for singleline, multiline & jsdoc comments (#22715)
PR Close #22715
2018-03-15 14:48:53 -07:00
Alex Eagle 88b3198c80 feat(bazel): change ng_package rule to APF v6 (#22782)
Angular Package Format v6 stops bundling files in the esm5 and esm2015
directories, now that Webpack 4 can tree-shake per-file.

Adds some missing files like package.json to make packages closer to
what we publish today.

Refactor ng_package to be a type of npm_package and re-use the packaging
action from that rule.

PR Close #22782
2018-03-15 11:38:31 -07:00
Chuck Jazdzewski 6e5e819e80 fix(compiler-cli): emit correct css string escape sequences (#22776)
Works around an issue with TypeScript 2.6 and 2.7 that causes
the tranformer emit to emit incorrect escapes for css string
literals.

Fixes: #22774

PR Close #22776
2018-03-15 11:37:50 -07:00
Adam Plumer cd2ebd22fd fix(platform-server): add styles to elements correctly (#22527)
* Partially reverts #22263 due to lack of total spec compliance
  on the server
* Maintains the camel-case styles fix

PR Close #22527
2018-03-14 14:12:31 -07:00
Miško Hevery 112431db69 test(ivy): add canonical compiler spec for class/style (#22719)
Adds a stub for `elementStyle` and `elementClass` instruction
with a canonical spec for the compiler. The spec shows the the
compiler should be using `elementStyle` and `elementClass` instruction
in place of `[class]` and `[style]` bindings respectively.
PR Close #22719
2018-03-14 12:59:52 -07:00
Miško Hevery a0a01f1e1e refactor(ivy): rename class/style to make space for new instruction (#22719)
Rename:
- `elementClass` (short: `k`) => `elementClassNamed` (short: `kn`)
- `elementStyle` (short: `s`) => `elementStyleNamed` (short: `sn`)

Currently `[class.name]` is `elementClass(0, ‘name’, value)`. We would
like to introduce new binding `[class]` which needs a new instruction
ideally `elementClass(0, value)`. Doing the rename creates space
to create such an instruction in subsequent change.

PR Close #22719
2018-03-14 12:59:52 -07:00
Miško Hevery ae19d071bb test(ivy): add ComponentFixture for cleaner tests. (#22719)
PR Close #22719
2018-03-14 12:59:52 -07:00
Matias Niemelä f5a98f41fe fix(core): remove core animation import symbols (#22692)
This patch removes the deprecated support for animation
symbol imports from @angular/core.

BREAKING CHANGE: it is no longer possible to import
animation-related functions from @angular/core. All
animation symbols must now be imported from @angular/animations.

PR Close #22692
2018-03-14 12:23:51 -07:00
Pawel Kozlowski c09bd67aee fix(ivy): fix views manipulation logic (#22656)
This commit fixes a bug that would result in views insert / remove
even if a view needed only refresh operation.

The crux of the bug was that we were looking for a view to update
only in the LContainer.nextIndex position. This is incorrect as a
view with a given block id could be present later in the views
array (this happens if we about to remove a view in the middle of
the views array).

The code in this fix searches for a view to update in the views array and
can remove views in the middle of the views collection. Previously we
would remove views at the end of the collection only.

PR Close #22656
2018-03-14 12:07:15 -07:00
Michael Giambalvo 37fedd001c feat(core): add task tracking to Testability (#16863)
Allow passing an optional timeout to Testability's whenStable(). If
specified, if Angular is not stable before the timeout is hit, the
done callback will be invoked with a list of pending macrotasks.

Also, allows an optional update callback, which will be invoked whenever
the set of pending macrotasks changes. If this callback returns true,
the timeout will be cancelled and the done callback will not be invoked.

If the optional parameters are not passed, whenStable() will work
as it did before, whether or not the task tracking zone spec is
available.

This change also migrates the Testability unit tests off the deprecated
AsyncTestCompleter.

PR Close #16863
2018-03-14 08:48:48 -07:00
Kara Erickson b1365d1fa8 refactor(ivy): remove directiveRefresh instruction (#22745)
PR Close #22745
2018-03-13 23:29:21 -07:00
WilliamKoza 4ac606b419 docs(compiler): fix spelling errors (#22704)
PR Close #22704
2018-03-13 21:45:13 -07:00
Miško Hevery 51027d73cc fix(ivy): Update rollup rule to prevent inlining symbols in debug. (#22747)
The new rollup rule disables inlining symbols in debug mode. This makes 
it look as if there would be more symbols but in reality these are the
symbols which are no longer being inlined.
PR Close #22747
2018-03-13 19:58:30 -07:00
Kara Erickson bd9d4df735 refactor(ivy): remove inputsPropertyName (#22716)
Closes #22591

PR Close #22716
2018-03-13 13:26:15 -07:00
Jeremy Elbourn 34e355a3b0 build(bazel): ng_package rxjs/operators rollup config (#22744)
PR Close #22744
2018-03-13 12:12:11 -07:00
Matias Niemelä 58b94e6f5e feat(animations): expose `element` and `params` within transition matchers (#22693)
PR Close #22693
2018-03-13 09:42:24 -07:00
Alex Rickabaugh db56836425 feat: tree-shakeable providers API updates (#22655)
Rename @Injectable({scope -> providedIn}).

Instead of {providedIn: APP_ROOT_SCOPE}, accept {providedIn: 'root'}.
Also, {providedIn: null} implies the injectable should not be added
to any scope.

PR Close #22655
2018-03-13 09:28:05 -07:00
Alex Rickabaugh 6e00410e1c fix(compiler-cli): annotate Ivy fields as @nocollapse in closure mode (#22691)
Closure has a transformation which turns:

Service.ngInjectableDef = ...;

into:

Service$ngInjectableDef = ...;

This transformation obviously breaks Ivy in a major way. The solution is
to annotate the fields as @nocollapse. However, Typescript appears to ignore
synthetic comments added to a node during a transformation, so the "right"
way to add these comments doesn't work.

As an interim measure, a post-processing step just before the compiled JS is
written to disk appends the correct comments with a regular expression.

PR Close #22691
2018-03-12 14:34:22 -07:00
Marc Laval f95730b8e2 fix(ivy): elements properties should not be stringified (#22683)
PR Close #22683
2018-03-12 13:16:05 -07:00
Igor Minar 3f70aba272 fix(compiler-cli): disableTypeScriptVersionCheck should be applied even for older tsc versions (#22669)
Previously the flag would only disable the check in the case we tried to use newer tsc version.

In g3 we sometimes take a while to update tsc, but as a prerequisite of that Angular needs to be
updated first. This change enables us to update Angular and use it in g3 while g3 is being update
to the required tsc. Of course extra care is required when this check is disabled, but since we
control everything in g3, it's on us to get this right.

I don't see any preexisting tests for this, and I'm not sure how to write them right now.
I filed https://github.com/angular/angular/issues/22699

PR Close #22669
2018-03-12 09:27:24 -07:00
Igor Minar c602563589 feat(compiler-cli): require node 8 as runtime engine (#22669)
This is not expected to be a breaking change for anyone who's on Node LTS (currently v8)
and aligns @angular/compilar-cli with @angular/cli's runtime requirements.

PR Close #22669
2018-03-12 09:27:23 -07:00
Chuck Jazdzewski 8449eb8d62 build: upgrade to TypeScript 2.7 (#22669)
Fixes: #21571

PR Close #22669
2018-03-12 09:27:23 -07:00
Kara Erickson aa7dba244b feat(ivy): support checkNoChanges (#22710)
PR Close #22710
2018-03-11 22:16:38 -07:00
Jason Aden 0bf6fa5b32 fix(router): correct over-encoding of URL fragment (#22687)
Relates to: #10280 #22337

PR Close #22687
2018-03-11 22:15:01 -07:00
Alex Eagle 40315bef3d fix(compiler-cli): enableResourceInlining handles both styles and styleUrls (#22688)
When both are present, the inlined styles are appended to the end of the styles

PR Close #22688
2018-03-11 22:14:32 -07:00
Alex Eagle 123efba388 fix(compiler-cli): resolve resource URLs before loading them under enableResourceInlining (#22688)
Also turn on the feature for Bazel ng_module rules

PR Close #22688
2018-03-11 22:14:31 -07:00
Kara Erickson fa451bcd19 feat(ivy): support markForCheck (#22690)
PR Close #22690
2018-03-09 20:29:05 -08:00
Alex Rickabaugh 0d8deb0795 fix(compiler-cli): generate proper exports.* identifiers in cjs output (#22564)
When the compiler generates a reference to an exported variable in the
same file, it inserts a synthetic ts.Identifier node. In CommonJS
output, this synthetic node would not be properly rewritten with an
`exports.` prefix.

This change sets the TS original node property on the synthetic node
we generate, which ensures TS knows to rewrite it in CommonJS output.

PR Close #22564
2018-03-09 13:09:57 -08:00
Alex Eagle b5be18f405 feat(compiler-cli): add resource inlining to ngc (#22615)
When angularCompilerOptions { enableResourceInlining: true }, we replace all templateUrl and styleUrls properties in @Component with template/styles

PR Close #22615
2018-03-09 09:15:12 -08:00
Alex Eagle 1e6cc42a01 test: migrate remaining public-api tests to Bazel (#22639)
We now create npm packages to cover all the public api assertions in tools/public_api_guard.
We no longer depend on ts-api-guardian from npm - it is now stale since the repository was archived.
There is no longer a gulp task to enforce or accept the public API, this is in CircleCI as part of running all bazel test targets.

PR Close #22639
2018-03-09 09:11:40 -08:00
Kara Erickson b26a90567c feat(ivy): support attaching and detaching views from change detection (#22670)
PR Close #22670
2018-03-08 23:44:33 -08:00
Chuck Jazdzewski b0b9ca3386 feat(ivy): produce Renderer2 back-patching and factories. (#22506)
Produces back-patch as described in the #22235 and referenced in #22480.

This just contains the compiler implementations and the corresponding unit
tests. Connecting the dots as described in #22480 will be in a follow on
change.

PR Close #22506
2018-03-08 22:39:07 -08:00
Kara Erickson 5412e10bcd docs(core): replace ancient live demos (#22665)
PR Close #22665
2018-03-08 16:43:14 -08:00
Igor Minar 489fec1299 feat: update tslib to 1.9.0 (#22667)
BREAKING CHANGE: after this change, npm and yarn will issue incompatible peerDependencies warning

We don't expect this to actually break an application, but the application/library package.json
will need to be updated to provide tslib 1.9.0 or higher.

PR Close #22667
2018-03-08 16:42:34 -08:00
Misko Hevery 2fee5cc095 test(ivy): add injection canonical specs (#22595)
PR Close #22595
2018-03-08 12:09:39 -08:00
Kara Erickson f13f4db9dc refactor(ivy): fix rebase error (#22661)
PR Close #22661
2018-03-08 11:37:42 -08:00
Chuck Jazdzewski 73c203fda9 feat(ivy): support host attribute and property bindings (#22334)
PR Close #22334
2018-03-08 10:57:30 -08:00
Kara Erickson 4c089c1d93 feat(ivy): support ChangeDetectorRef.detectChanges (#22614)
PR Close #22614
2018-03-07 21:08:25 -08:00
Kara Erickson d485346d3c fix(ivy): lifecycle hooks should be queued for root component (#22614)
PR Close #22614
2018-03-07 21:08:25 -08:00
Marc Laval f64ee15487 feat(ivy): implement pipes (#22254)
PR Close #22254
2018-03-07 20:58:48 -08:00
Marc Laval 5d4fa7f0c8 test(ivy): add canonical examples of bindings on elements (#22403)
PR Close #22403
2018-03-07 20:55:49 -08:00
Kara Erickson 8fb34bcd43 refactor(forms): deprecate ngModel usage on same field as formControl (#22633)
Support for using the `ngModel` input property and `ngModelChange`
event with reactive form directives has been deprecated in
Angular v6 and will be removed in Angular v7.

Now deprecated:
```html
<input [formControl]="control" [(ngModel)]="value">
```

```ts
this.value = 'some value';
```

This has been deprecated for a few reasons. First, developers have
found this pattern confusing. It seems like the actual `ngModel`
directive is being used, but in fact it's an input/output property
named `ngModel` on the reactive form directive that simply approximates
(some of) its behavior. Specifically, it allows getting/setting the
value and intercepting value events. However, some of `ngModel`'s other
features - like delaying updates with`ngModelOptions` or exporting the
directive - simply don't work, which has understandably caused some
confusion.

In addition, this pattern mixes template-driven and reactive forms
strategies, which we generally don't recommend because it doesn't take
advantage of the full benefits of either strategy. Setting the value in
the template violates the template-agnostic principles behind reactive
forms, whereas adding a FormControl/FormGroup layer in the class removes
the convenience of defining forms in the template.

To update your code before v7, you'll want to decide whether to stick
with reactive form directives (and get/set values using reactive forms
patterns) or switch over to template-driven directives.

After (choice 1 - use reactive forms):

```html
<input [formControl]="control">
```

```ts
this.control.setValue('some value');
```

After (choice 2 - use template-driven forms):

```html
<input [(ngModel)]="value">
```

```ts
this.value = 'some value';
```

You can also choose to silence this warning by providing a config for
`ReactiveFormsModule` at import time:

```ts
imports: [
  ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'});
]
```

Alternatively, you can choose to surface a separate warning for each
instance of this pattern with a config value of `"always"`. This may
help to track down where in the code the pattern is being used as the
code is being updated.

Note: `warnOnNgModelWithFormControl` is set up as deprecated so that it
can be removed in v7 when it is no longer needed. This will not display
properly in API docs yet because dgeni doesn't yet support deprecating
properties in object literals, but we have an open issue to resolve the
discrepancy here: https://github.com/angular/angular/issues/22640.

PR Close #22633
2018-03-07 20:47:53 -08:00
Miško Hevery 6d1367d297 feat(ivy): provide sanitization methods which can be tree shaken (#22540)
By providing a top level sanitization methods (rather than service) the
compiler can generate calls into the methods only when needed. This makes
the methods tree shakable.

PR Close #22540
2018-03-07 18:24:07 -08:00
Miško Hevery 538f1d980f refactor(core): move sanitization into core (#22540)
This is in preparation of having Ivy have sanitization inline.

PR Close #22540
2018-03-07 18:24:06 -08:00
Olivier Combe 78167915ee build(common): export locale data as commonjs instead of es2015 (#20624)
PR Close #20624
2018-03-07 14:33:45 -08:00
Alex Eagle ce649f725f build: add a ng_package rule for @angular/router (#22628)
PR Close #22628
2018-03-07 10:56:27 -08:00
Alex Eagle fcb8c492d6 build: add an npm_package rule for @angular/bazel (#22628)
PR Close #22628
2018-03-07 10:56:27 -08:00
Miško Hevery 363dfa5437 test(ivy): Back patch example (#22235)
PR Close #22235
2018-03-06 15:02:02 -08:00
Alex Eagle 4c40812b71 fix(bazel): fixes for ng_package on Windows (#22597)
PR Close #22597
2018-03-06 07:52:48 -08:00
Jason Aden fa974c7d4e fix(router): fix URL serialization so special characters are only encoded where needed (#22337)
This change brings Angular largely in line with how AngularJS previously serialized URLs. This is based on RFC 3986 and resolves issues such as the above #10280 where URLs could be parsed, re-serialized, then parsed again producing a different result on the second parsing.

Adjustments to be aware of in this commit:

* URI fragments will now serialize the same as query strings
* In the URI path or segments (portion prior to query string and/or fragment), the plus sign (`+`) and ampersand (`&`) will appear decoded
* In the URL path or segments, parentheses values (`(` and `)`) will now appear percent encoded as `%28` and `%29` respectively
* In the URL path or segments, semicolons will be encoded in their percent encoding `%3B`

NOTE: Parentheses and semicolons denoting auxillary routes or matrix params will still appear in their decoded form -- only parentheses and semicolons used as values in a segment or key/value pair for matrix params will be encoded.

While these changes are not considered breaking because applications should be decoding URLs and key/value pairs, it is possible that some unit tests will break if comparing hard-coded URLs in tests since that hard coded string will represent the old encoding. Therefore we are releasing this fix in the upcoming Angular v6 rather than adding it to a patch for v5.

Fixes: #10280

PR Close #22337
2018-03-06 06:58:08 -08:00
Pawel Kozlowski 2c75acc5b3 feat(ivy): add support for the ngProjectAs attribute (#22498)
PR Close #22498
2018-03-06 06:55:51 -08:00
Suguru Inatomi f86d8ae0fd docs(compiler): fix a line about ivy library (#22579)
PR Close #22579
2018-03-05 21:25:43 -08:00
Kara Erickson 2c2b62f45f fix(ivy): preventDefault when listener returns false (#22529)
Closes #22495

PR Close #22529
2018-03-05 12:15:17 -08:00
Misko Hevery 51ca643c27 test(ivy): add injectAttribute spec (#22510)
PR Close #22510
2018-03-05 10:10:32 -08:00
Misko Hevery 69d359bb51 refactor(ivy): break compiler canonical test into smaller files (#22510)
PR Close #22510
2018-03-05 10:10:32 -08:00
Alex Eagle ba8df8a3f1 build: update to latest bazel rules (#22558)
PR Close #22558
2018-03-02 13:27:25 -08:00
Chuck Jazdzewski 0451fd93df feat(ivy): support generating view and content queries (#22330)
PR Close #22330
2018-03-01 13:06:47 -08:00
Chuck Jazdzewski 49f074f61d feat(ivy): support array and object literals in binding expressions (#22336)
PR Close #22336
2018-03-01 13:02:58 -08:00
Rado Kirov ab790f3c84 build: Add support for bazelOptions.maxCacheSizeMb in ngc-wrapped. (#22511)
PR Close #22511
2018-03-01 08:41:10 -08:00
Alex Rickabaugh dd534471ec fix(compiler): allow tree-shakeable injectables to depend on string tokens (#22376)
Previously the injectable compiler assumed all tree-shakeable injectables
would have dependencies that were injectables or InjectionTokens. However
old code still uses string tokens (e.g. NgUpgrade and '$injector'). Using
such tokens would cause the injectable compiler to crash.

Now, the injectable compiler can properly generate a dependency on such a
string token.

PR Close #22376
2018-03-01 08:15:13 -08:00
Chuck Jazdzewski 8bb2f5c71d docs(compiler): ivy separate compilation design document (#22480)
PR Close #22480
2018-03-01 08:14:35 -08:00
Hans Larsen 288851c41e release: add ng update package group metadata to angular (#22482)
"ng update" supports having multiple packages as part of a group which should be updated together, meaning that e.g. calling "ng update @angular/core" would be equivalent to updating all packages of the group (that are part of the package.json already).

In order to support the grouping feature, the package.json of the version the user is updating to needs to include an "ng-update" key that points to this metadata.

The entire specification for the update workflow can be found here: 2e8b12a4ef/docs/specifications/update.md

PR Close #22482
2018-02-28 14:57:53 -08:00
Kara Erickson 9eaf1bbe67 feat(ivy): support injecting ChangeDetectorRef (#22469)
PR Close #22469
2018-02-28 13:35:48 -08:00
Alex Eagle aabe16c08c fix(bazel): ng_package includes transitive .d.ts and flatModuleMetadata (#22499)
Fixes #22419

PR Close #22499
2018-02-28 13:29:56 -08:00
Alex Eagle b6c941053e feat(bazel): ng_package adds package.json props (#22499)
We now add the 'main', 'module', 'es2015', and 'typings' properties,
pointing to where the packaging tool lays them out.

Fixes #22416

PR Close #22499
2018-02-28 13:29:56 -08:00
Alex Rickabaugh f8749bfb70 fix(core): export inject() from @angular/core (#22389)
inject() supports the ngInjectableDef-based configuration of the injector
(otherwise known as tree-shakeable services). It was missing from the
exported API of @angular/core, this PR adds it.

The test added here is correct in theory, but may pass accidentally due
to the decorator side-effect replacing the inject() call at runtime. An
upcoming compiler PR will strip reified decorators from the output
entirely.

Fixes #22388

PR Close #22389
2018-02-28 10:44:37 -08:00
Kara Erickson 8c358844dd feat(ivy): support OnPush change detection (#22417)
PR Close #22417
2018-02-28 10:42:11 -08:00
Kara Erickson e454c5a98e refactor(ivy): store creationMode in LView.flags (#22417)
PR Close #22417
2018-02-28 10:42:11 -08:00
George Kalpakas 8a85888773 fix(upgrade): correctly destroy nested downgraded component (#22400)
Previously, when a downgraded component was destroyed in a way that did
not trigger the `$destroy` event on the element (e.g. when a parent
element was removed from the DOM by Angular, not AngularJS), the
`ComponentRef` was not destroyed and unregistered.
This commit fixes it by listening for the `$destroy` event on both the
element and the scope.

Fixes #22392

PR Close #22400
2018-02-27 18:41:02 -08:00
Adam Plumer 40ba009e25 fix(platform-server): generate correct stylings for camel case names (#22263)
* Add correct mapping from camel case to kebab case for CSS style
names
* Remove internal CSS methods in favor of native Domino APIs

Fixes #19235

PR Close #22263
2018-02-26 17:46:21 -08:00
Adam Plumer d3827a0017 feat(platform-server): bump Domino to v2.0 (#22411)
BREAKING CHANGE:

* Bump the dependency on Domino to 2.0 to resolve issues with
  namespacing

PR Close #22411
2018-02-26 14:55:52 -08:00
George Kalpakas 13ab91e05d fix(upgrade): fix empty transclusion content with AngularJS@>=1.5.8 (#22167)
The function provided by `ngUpgrade` as `parentBoundTranscludeFn` when
upgrading a component with transclusion, will break in AngularJS v1.5.8+
if no transclusion content is provided. The reason is that AngularJS
will try to destroy the transclusion scope (which would not be needed
any more). But since the transcluded content comes from Angular, not
AngularJS, there is no transclusion scope to destroy.
This commit fixes it by providing a dummy scope object with a no-op
`$destroy()` method.

Fixes #22175

PR Close #22167
2018-02-25 10:06:14 -08:00
George Kalpakas f089bf5333 fix(upgrade): correctly handle `=` bindings in `@angular/upgrade` (#22167)
Previously, having a `=` binding on an upgraded components would result
in setting the corresponding property to an EventEmitter function. This
should only happen for `&` bindings.
This commit rstrores the correct behavior.

Note:
The issue was only present in the dynamic version of `ngUpgrade`. The
static version worked as expected.
The error did not show up in tests, because in AngularJS v1.5.x a
function would be serialized to an empty string in interpolations, thus
making them indistinguishable from uninitialized properties (in the
view). The serialization behavior changed in AngularJS v1.6.x, making
the errors visible.

PR Close #22167
2018-02-25 10:06:14 -08:00
George Kalpakas 8e1e040f72 test(upgrade): run tests against multiple AngularJS versions (#22167)
Fixes #19332

PR Close #22167
2018-02-25 10:06:14 -08:00
George Kalpakas 28240625e6 refactor(upgrade): use correct paths for imports (#22167)
`packages/upgrade/static/src` is anymlink to `packages/upgrade/src`.
Still, using the correct paths (e.g. using
`@angular/upgrade/static/src/...` for `@angula/upgrade/static` specs
ensures that the module loader (e.g. SystemJS) can map the imports to
the same instances.

PR Close #22167
2018-02-25 10:06:14 -08:00
George Kalpakas 0d248079ba test(platform-browser): remove stray `debugger` statement (#22167)
PR Close #22167
2018-02-25 10:06:14 -08:00
Victor Berchet a4032296cc
Revert "fix(router): fix URL serialization so special characters are only encoded where needed (#22337)"
This reverts commit 094666da17.
2018-02-23 18:12:40 -08:00
Olivier Combe 4180912538 feat(common): export functions to format numbers, percents, currencies & dates (#22423)
The utility functions `formatNumber`, `formatPercent`, `formatCurrency`, and `formatDate` used by the number, percent, currency and date pipes are now available for developers who want to use them outside of templates.

Fixes #20536

PR Close #22423
2018-02-23 15:27:10 -08:00
Jason Aden 094666da17 fix(router): fix URL serialization so special characters are only encoded where needed (#22337)
Fixes: #10280

This change brings Angular largely in line with how AngularJS previously serialized URLs. This is based on [RFC 3986](http://tools.ietf.org/html/rfc3986) and resolves issues such as the above #10280 where URLs could be parsed, re-serialized, then parsed again producing a different result on the second parsing.

Adjustments to be aware of in this commit:

* Query strings will now serialize with decoded slash (`/`) and question mark (`?`)
* URI fragments will now serialize the same as query strings, but hash sign (`#`) will also appear decoded
* In the URI path or segments (portion prior to query string and/or fragment), the plus sign (`+`) and ampersand (`&`) will appear decoded
* In the URL path or segments, parentheses values (`(` and `)`) will now appear percent encoded as `%28` and `%29` respectively
* In the URL path or segments, semicolons will be encoded in their percent encoding `%3B`

NOTE: Parentheses and semicolons denoting auxillary routes or matrix params will still appear in their decoded form -- only parentheses and semicolons used as values in a segment or key/value pair for matrix params will be encoded.

While these changes are not considered breaking because applications should be decoding URLs and key/value pairs, it is possible that some unit tests will break if comparing hard-coded URLs in tests since that hard coded string will represent the old encoding. Therefore we are releasing this fix in the upcoming Angular v6 rather than adding it to a patch for v5.

PR Close #22337
2018-02-23 13:20:51 -08:00
Alex Eagle b43b164a61 feat(bazel): add an ng_package rule (#22221)
This produces a directory following the Angular Package layout spec.

Includes integration test coverage by making a minimal ng_package in integration/bazel.
Unit tests verify the content of the @angular/core and @angular/common packages.

This doesn't totally match our current output, but is good enough to unblock some
early adopters.

It re-uses logic from the rollup_bundle rule in rules_nodejs. It should also
eventually have the .pack and .publish secondary targets like npm_package rule.

PR Close #22221
2018-02-23 11:19:04 -08:00
Marc Laval aad431642a refactor(ivy): rename componentRefresh to directiveRefresh (#22395)
PR Close #22395
2018-02-23 09:42:08 -08:00
Marc Laval 7effb0016c fix(ivy): ngOnChanges to receive SimpleChanges with non minified property names as keys (#22352)
PR Close #22352
2018-02-22 17:48:52 -08:00
Matias Niemelä b2f366b3b7 fix(animations): only use the WA-polyfill alongside AnimationBuilder (#22143)
This patch removes the need to include the Web Animations API Polyfill
(web-animations-js) as a dependency. Angular will now fallback to using
CSS Keyframes in the event that `element.animate` is no longer supported
by the browser.

In the event that an application does use `AnimationBuilder` then the
web-animations-js polyfill is required to enable programmatic,
position-based access to an animation.

Closes #17496

PR Close #22143
2018-02-22 16:07:53 -08:00
Jason Aden 45eff4cc65 fix(router): don't mutate route configs (#22358)
Fixes #22203

PR Close #22358
2018-02-22 13:35:38 -08:00
Marc Laval b3ffeaa22b fix(ivy): OnDestroy hook should not be called twice for a directive on an element (#22350)
PR Close #22350
2018-02-22 13:35:17 -08:00
Trotyl b7544cccc6
feat(core): support metadata reflection for native class types (#22356)
closes #21731

PR Close #22356
2018-02-22 13:22:03 -08:00
Marc Laval 894b098eb3 test(ivy): add missing tests on directive lifecycle hooks (#22368)
PR Close #22368
2018-02-22 11:21:15 -08:00
Fabian Wiles e86b64b620 feat(forms): allow markAsPending to emit events (#20212)
closes #17958

BREAKING CHANGE:
- `AbstractControl#statusChanges` now emits an event of `'PENDING'` when you call `AbstractControl#markAsPending`
- Previously it did not emit an event when you called `markAsPending`
- To migrate you would need to ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`

PR Close #20212
2018-02-22 11:15:33 -08:00
Victor Berchet 90e9c59e23 Revert "feat(core): support metadata reflection for native class types (#22356)"
This reverts commit 5c89d6bffa.
2018-02-22 10:26:06 -08:00
Martin Probst ca06af40f4 build: allow passing node options to ngc. (#22245)
PR Close #22245
2018-02-22 10:20:04 -08:00
Trotyl 5c89d6bffa feat(core): support metadata reflection for native class types (#22356)
closes #21731

PR Close #22356
2018-02-21 16:09:27 -08:00
Philip Pham 3e6a86fb0a fix(forms): set state before emitting a value from ngModelChange (#21514)
Closes #21513.

PR Close #21514
2018-02-21 15:59:33 -08:00
Trotyl a7ebf5aadd fix(core): properly handle function without prototype in reflector (#22284)
closes #19978

PR Close #22284
2018-02-21 14:52:04 -08:00
Ricardo M 9e6268ba59 docs(http): fix a typo in code comment (#22327)
PR Close #22327
2018-02-21 11:06:06 -08:00
Alex Eagle 236a9320df build: update tsickle dep from compiler-cli (#22295)
PR Close #22295
2018-02-20 15:40:44 -08:00
Alex Eagle 28ac24444f fix(compiler-cli): add missing entry point to package, update tsickle (#22295)
PR Close #22295
2018-02-20 15:40:44 -08:00
Chuck Jazdzewski 99909bbf2c feat(ivy): generate pipe references and definitions (#22034)
PR Close #22034
2018-02-20 13:58:03 -08:00
Marc Laval ee60bb5b36 fix(ivy): pureFunction8 should update the right bindings (#22313)
PR Close #22313
2018-02-20 11:36:50 -08:00
Frederik Prijck e2bdef4cf6 test(language-service): fix minor typos (#21372)
PR Close #21372
2018-02-20 10:08:55 -08:00
Victor Berchet 8115edc82f fix(common): then and else template might be set to null (#22298)
PR Close #22298
2018-02-18 19:25:28 -08:00
Victor Berchet a8b5465e24 fix(ivy): update master with renamings (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet 9ce495b3d8 refactor(ivy): simplify interpolation instructions (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet d40263447d refactor(ivy): move get functions next to their underlying variable (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet 31c5c1060a docs(ivy): update the API docs instructions to add details about removing attributes (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet c9ebd60435 refactor(ivy): interpolatiom instructions do not support NO_CHANGE at input. (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet 5a14e2238f refactor(ivy): split the `memory` instruction into `store` and `load` (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
WilliamKoza 3ceee99e22 feat(compiler-cli): Check unvalidated combination of ngc and TypeScript (#22293)
closes #20669

PR Close #22293
2018-02-18 15:12:46 -08:00
Victor Berchet c30d329faa fix(ivy): fix merge errors (master is broken) (#22291)
PR Close #22291
2018-02-18 15:03:39 -08:00
Trotyl 991300b86c feat(platform-browser): do not throw error when Hammer.js not loaded (#22257)
closes #16992

PR Close #22257
2018-02-18 13:29:14 -08:00
Trotyl 67cf11d071 feat(common): better error message when non-template element used in NgIf (#22274)
closes #16410

PR Close #22274
2018-02-18 13:26:50 -08:00
Kara Erickson 49082d7ab2 feat(ivy): support host attributes (#22213)
PR Close #22213
2018-02-18 13:22:38 -08:00
Kara Erickson 6b627f67db test(ivy): add missing host listener and host attribute binding tests (#22213)
PR Close #22213
2018-02-18 13:22:38 -08:00
Kara Erickson 5c320b4c2a test(ivy): add missing host binding and query tests (#22213)
PR Close #22213
2018-02-18 13:22:34 -08:00
Misko Hevery ac2b04a5ab test(ivy): Add small_app spec for sprint #3 (#22018)
PR Close #22018
2018-02-18 13:18:54 -08:00
Misko Hevery a63b764b54 test(ivy): move compiler canonical specs into a single directory (#22018)
PR Close #22018
2018-02-18 13:18:54 -08:00
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