Commit Graph

232 Commits

Author SHA1 Message Date
Victor Berchet 4662878a1f refactor(compiler): refactor template binding parsing (#23460)
A long time ago Angular used to support both those attribute notations:
- `*attr='binding'`
- `template=`attr: binding`

Because the last notation has been dropped we can refactor the binding parsing.
Source maps will benefit from that as no `attr:` prefix is added artificialy any
more.

PR Close #23460
2018-04-20 16:07:55 -07:00
Olivier Combe d1177c75f8 refactor: update CLDR data for closure locale & use a const for undefined (#23372)
PR Close #23372
2018-04-13 16:30:23 -07:00
Igor Minar aa27155618 build(common): mark locales files as side-effect-full (#23366)
These files are in the UMD format for greater portablity, and as such
can't be marked as side-effect-free by webpack/build-optimizer/uglify.

PR Close #23366
2018-04-13 13:09:13 -07:00
Olivier Combe ce40e85cbb refactor(common): update CLDR data to v33.0.0 (#23265)
PR Close #23265
2018-04-11 15:34:46 -07:00
Olivier Combe 5706810af2 fix(common): replace i18n locale undefined values by a const (#23265)
Fixes #22988
PR Close #23265
2018-04-11 15:34:46 -07:00
Pete Bacon Darwin 4b96a58c5a docs: remove all deprecated `@stable` jsdoc tags (#23210)
These are no longer needed as stable docs are computed as those that
do not have `@experimental` or `@deprecated` tags.

PR Close #23210
2018-04-10 21:49:32 -07:00
Alex Eagle 5a298b1c5e fix(common): workaround UMD/webpack limitation (#23271)
Fixes #23217

PR Close #23271
2018-04-09 15:16:12 -07:00
Pete Bacon Darwin 381da1af45 build(aio): move "optional" and "default" to end of param description (#23062)
PR Close #23062
2018-04-05 09:25:15 -07:00
Pete Bacon Darwin cdd05bd2ca docs(common): move Pipe param docs to `transform` function (#23062)
PR Close #23062
2018-04-05 09:25:15 -07:00
Pete Bacon Darwin 079d8e57d5 docs(common): migrate `@whatItDoes` tags to the description (#23062)
We get the overview for the doc by splitting off the first
paragraph.

PR Close #23062
2018-04-05 09:25:15 -07:00
Pete Bacon Darwin 46ba7f69dd docs(common): migrate `@howToUse` tags (#23062)
In pipes the content of these tags is now generated automatically.
In directives these tags have been converted to `@usageNotes` tags,
but in the future me might find a way to generate that usage too.

PR Close #23062
2018-04-05 09:25:15 -07:00
Pawel Kozlowski aaefd51a88 refactor(common): simplify NgClass code, add comments (#21937)
PR Close #21937
2018-04-04 09:41:17 -07:00
Pawel Kozlowski 4a426696c9 fix(common): properly take className changes into account (#21937)
Fixes #21932

PR Close #21937
2018-04-04 09:41:16 -07:00
Alex Eagle 46eadb5cfb build: fix common locales in npm package (#23153)
PR Close #23153
2018-04-04 08:23:07 -07:00
Alan Agius 7ca772060b fix(common): `locales` are not being shipped (#23136)
Closes: #23140, #23103

PR Close #23136
2018-04-03 10:47:51 -07:00
Igor Minar 92724b396b build: update to rxjs@6.0.0-rc.0 (#23106)
PR Close #23106
2018-04-03 10:00:24 -07:00
Alex Eagle 15278784fc release(bazel): change publish-next script to publish bazel artifacts (#23097)
PR Close #23097
2018-03-30 14:03:05 -07:00
Igor Minar 6f7d14064c build: update to rxjs@6.0.0-beta.4 (#23084)
PR Close #23084
2018-03-30 13:07:03 -07: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
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
sergeome 7966744a44 fix(common): titlecase pipe (#22600)
PR Close #22600
2018-03-23 13:42:51 -04:00
Igor Minar 8768665587 fix: correct peerDependencies declaration on rxjs 2018-03-20 22:48:41 -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
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
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
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
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
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
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
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
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
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
Ricardo M 9e6268ba59 docs(http): fix a typo in code comment (#22327)
PR Close #22327
2018-02-21 11:06:06 -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
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
Trotyl Yu 2639b4bffb fix(common): correct mapping of Observable methods (#20518)
fixes #20516
PR Close #20518
2018-02-16 15:10:31 -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
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
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
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
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
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
Olivier Combe 64ae6d206e test(common): disable deprecated date pipe tests on chrome mobile (#21933)
Closes #21907
PR Close #21933
2018-02-07 12:07:31 -08:00
Alex Rickabaugh 8b14488827 fix(common): don't convert null to a string when flushing a mock request (#21417)
A bug in TestRequest caused null response bodies to be stringified. This
change causes null to be treated faithfully.

Fixes #20744

PR Close #21417
2018-02-01 08:32:43 -08:00
Olivier Combe b62739a989 fix(common): generate closure-locale data file with exported plural functions (#21873)
Fixes #21870
PR Close #21873
2018-01-30 11:42:31 -08:00
Olivier Combe bb577c624b ci: unblock master by ignoring date pipe tests while we fix it (#21906)
PR Close #21906
2018-01-30 11:33:46 -08:00
Alex Rickabaugh 120bdeecdc fix(common): allow HttpInterceptors to inject HttpClient (#19809)
Previously, an interceptor attempting to inject HttpClient directly
would receive a circular dependency error, as HttpClient was
constructed via a factory which injected the interceptor instances.
Users want to inject HttpClient into interceptors to make supporting
requests (ex: to retrieve an authentication token). Currently this is
only possible by injecting the Injector and using it to resolve
HttpClient at request time.

Either HttpClient or the user has to deal specially with the circular
dependency. This change moves that responsibility into HttpClient
itself. By utilizing a new class HttpInterceptingHandler which lazily
loads the set of interceptors at request time, it's possible to inject
HttpClient directly into interceptors as construction of HttpClient no
longer requires the interceptor chain to be constructed.

Fixes #18224.

PR Close #19809
2018-01-29 16:12:32 -08:00
Eli Sadoff 6e8bc310f0 docs: change ”it's" to "its" as needed in several docs. (#21867)
Most of them are in content but one is in common and needs special approval.

PR Close #21867
2018-01-29 11:34:46 -08:00
vsavkin c40ae7f7cf feat(router): add navigationSource and restoredState to NavigationStart event (#21728)
Currently, NavigationStart there is no way to know if an navigation was triggered imperatively or via the location change. These two use cases should be handled differently for a variety of use cases (e.g., scroll position restoration). This PR adds a navigation source field and restored navigation id (passed to navigations triggered by a URL change).

PR Close #21728
2018-01-29 10:22:59 -08:00
Jason Aden ede9cb7c2f Revert: "feat(router): add navigationSource and restoredState to NavigationStart event (#21728)"
This reverts commit 3b7bab7d22. Will be re-merged after fixing integration of minor breaking change.
2018-01-26 16:24:56 -08:00
vsavkin 3b7bab7d22 feat(router): add navigationSource and restoredState to NavigationStart event (#21728)
Currently, NavigationStart there is no way to know if an navigation was triggered imperatively or via the location change. These two use cases should be handled differently for a variety of use cases (e.g., scroll position restoration). This PR adds a navigation source field and restored navigation id (passed to navigations triggered by a URL change).

PR Close #21728
2018-01-26 10:25:32 -08:00
Filipe Silva fac4d8d42a build(common): specify explicit locales dir in package.json (#21016)
PR Close #21016
2018-01-25 22:18:35 -08:00
Victor Berchet 7d49443060 fix(common): A null value should remove the style on IE (#21679)
fixes #21064

PR Close #21679
2018-01-22 12:54:49 -08:00
Olivier Combe 97b18b2a5c fix(common): extract plural function from i18n locale data files for TS 2.6 (#21626)
Fixes #21608

PR Close #21626
2018-01-19 13:23:34 -08:00
Olivier Combe 135a2822ea fix(common): don't remove special characters when extracting CLDR data (#21626)
PR Close #21626
2018-01-19 13:23:34 -08:00
Alex Eagle a1492a73ce build: Remove angular_src nested workspace (#21096)
PR Close #21096
2018-01-19 10:17:37 -08:00
Trotyl 879756d44c fix(common): fallback to last defined value for named date and time formats (#21299)
closes #21282

PR Close #21299
2018-01-18 13:39:00 -06:00
Olivier Combe 246de65140 test(common): make date pipe tests work in more timezones (#21379)
Fixes #21112
PR Close #21379
2018-01-12 13:49:46 -08:00
Olivier Combe 05208b8513 fix(common): set correct timezone for ISO8601 dates in Safari (#21506)
Fixes #21491
PR Close #21506
2018-01-12 13:20:48 -08:00
Alex Eagle c4f02e21dd build: move repeated tsconfig attributes to a macro (#20964)
This helps ensure we use the same tsconfig.json file for all compilations.
Next steps are to make it the same tsconfig.json file used by the editor

PR Close #20964
2018-01-10 12:30:19 -08:00
Olivier Combe fecf768f43 fix(common): export currencies via `getCurrencySymbol` (#20983)
PR Close #20983
2018-01-05 14:24:26 -08:00
Olivier Combe a0ffdf1ef2 build(common): generate ts declarations for i18n locale files (#21127)
Fixes #21120
PR Close #21127
2017-12-22 21:34:03 -08:00
Chuck Jazdzewski 83d207d0a7 build: upgrade to TypeScript 2.6 (#21144)
Fixes #20653

PR Close #21144
2017-12-22 20:15:47 -08:00
Miško Hevery ae97920fe2 build: move _testing_init into tools; limit web_test concurrency (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Misko Hevery 3d50fd7cac build: add bazel test rules for remainder of packages (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Misko Hevery cc1058f6e1 build: add bazel test rules for more packages (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Misko Hevery 47e251a80a build: remove `main()` from specs (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Olivier Combe 07b81ae741 fix(common): handle JS floating point errors in percent pipe (#20329)
Fixes #20136
PR Close #20329
2017-12-22 09:02:49 -08:00
Chuck Jazdzewski 82bcd83566 feat(compiler): allow ngIf to use the ngIf expression directly as a guard
Allows a directive to use the expression passed directly to a property
as a guard instead of filtering the type through a type expression.

This more accurately matches the intent of the ngIf usage of its template
enabling better type inference.

Moved NgIf to using this type of guard instead of a function guard.

Closes: #20967
2017-12-18 12:09:21 -08:00
Martin Probst 2e7e935b02 fix(common): fix a Closure compilation issue.
Closure Compiler cannot infer that the swtich statement is exhaustive,
which causes it to complain that the method does not always return a
value.

Work around the problem by throwing an exception in the default case,
and using the `: never` type to ensure the code is unreachable.
2017-12-15 07:51:30 -08:00
Olivier Combe cbe7e39bbe build(common): don't generate .d.ts & .metadata.json files for i18n locales
Fixes #20880
2017-12-14 08:29:36 -08:00
Olivier Combe 3ce3b4d2af refactor(common): update i18n locale data to CLDR v32 (#20830)
List of changes between v31.0.1 and v32: http://cldr.unicode.org/index/downloads/cldr-32
PR Close #20830
2017-12-08 10:24:33 -08:00
Chuck Jazdzewski e7d9cb3e4c feat(compiler): narrow types of expressions used in *ngIf (#20702)
Structural directives can now specify a type guard that describes
what types can be inferred for an input expression inside the
directive's template.

NgIf was modified to declare an input guard on ngIf.

After this change, `fullTemplateTypeCheck` will infer that
usage of `ngIf` expression inside it's template is truthy.

For example, if a component has a property `person?: Person`
and a template of `<div *ngIf="person"> {{person.name}} </div>`
the compiler will no longer report that `person` might be null or
undefined.

The template compiler will generate code similar to,

```
  if (NgIf.ngIfTypeGuard(instance.person)) {
    instance.person.name
  }
```

to validate the template's use of the interpolation expression.
Calling the type guard in this fashion allows TypeScript to infer
that `person` is non-null.

Fixes: #19756?

PR Close #20702
2017-12-08 10:24:26 -08:00
Yuan Gao e544742156 refactor(core): Removed readonly getters and changed to readonly (#19842)
variables

PR Close #19842
2017-12-08 10:24:19 -08:00
Alex Eagle ef534c0cc1 build: upgrade bazel rules to latest (#20768)
Add enough BUILD files to make it possible to
`bazel build packages/core/test`

Also re-format BUILD.bazel files with Buildifier.
Add a CI lint check that they stay formatted.

PR Close #20768
2017-12-07 11:27:50 -08:00
Alex Rickabaugh aafa75da84 fix(common): don't strip XSSI prefix for if error isn't JSON (#19958)
This changes XhrBackend to not strip the XSSI prefix from error text
if such a prefix is present but the remaining body does not parse as
JSON.

PR Close #19958
2017-11-28 22:27:10 -06:00
Alex Rickabaugh 503be69af6 fix(common): treat an empty body as null when parsing JSON in HttpClient (#19958)
Previously, XhrBackend would call JSON.parse('') if the response body was
empty (a 200 status code with content-length 0). This changes the XhrBackend
to attempt the JSON parse only if the response body is non-empty. Otherwise,
the body is left as null.

Fixes #18680.
Fixes #19413.
Fixes #19502.
Fixes #19555.

PR Close #19958
2017-11-28 22:27:10 -06:00
Alex Rickabaugh eb01ad583f fix(common): remove useless guard in HttpClient (#19958)
An invalid "if" condition is always true, and is thus useless. This
change removes it. No behavior changes.

Fixes #19223.

PR Close #19958
2017-11-28 22:27:10 -06:00
Alex Rickabaugh 15a54df7d3 fix(common): accept falsy values as HTTP bodies (#19958)
Previously, HttpClient used the overly clever test "body || null"
to determine when a body parameter was provided. This breaks when
the valid bodies '0' or 'false' are provided.

This change tests directly against 'undefined' to detect the presence
of the body parameter, and thus correctly allows falsy values through.

Fixes #19825.
Fixes #19195.

PR Close #19958
2017-11-28 22:27:10 -06:00
Olivier Combe 24bf3e2a25 feat(common): add locale id parameter to `registerLocaleData` (#20623)
PR Close #20623
2017-11-27 17:00:06 -06:00
Jason Aden 437a0446e2 fix(common): return ISubscription from Location.subscribe() (#20429)
Fix #20406

PR Close #20429
2017-11-22 08:55:10 -06:00
Derek 401ead07b8 docs(common): update default display value for CurrencyPipe (#20246)
PR Close #20246
2017-11-10 11:51:17 -08:00
Maxime Robert b489259a34 docs(common): fix mis-ordered lines (#20221) 2017-11-06 11:28:39 -08:00
Dhyey Thakore d156e72ad7 docs: Add 0 in padding of 'dd' (#20107) 2017-11-02 14:36:22 -07:00
Hans Larsen 13f8648a00 fix: add missing globals from each rollup configuration (#20028)
PR Close #20028
2017-10-30 23:09:17 -04:00
Hans Larsen b6abcb2500 refactor: make all rollup config ES5 compatible (#20028)
So they can be required by other Node scripts.

PR Close #20028
2017-10-30 23:09:17 -04:00
vsavkin 82fed62af2 fix(router): navigating to the current location works (#19463)
Closes #13340

PR Close #19463
2017-10-23 20:56:52 -04:00
Alex Rickabaugh 04ab9f1917 fix(common): attempt to JSON.parse errors for JSON responses (#19773)
PR Close #19773
2017-10-18 11:18:58 -07:00
Jason Aden 7d1abd9adb build: update to rxjs@5.5.0 (#19345)
PR Close #19345
2017-10-18 11:17:43 -07:00
Chuck Jazdzewski d7eac7ee56 Revert "fix(router): navigating to the current location works (#19463)"
This reverts commit 43c5b638b9.
2017-10-09 16:38:12 -07:00
vsavkin 43c5b638b9 fix(router): navigating to the current location works (#19463)
Closes #13340

PR Close #19463
2017-10-09 11:45:13 -07:00
Chuck Jazdzewski 8e5b582b61 Revert "fix(router): navigating to the current location works (#19463)"
This reverts commit b67d574a95.
2017-10-06 18:15:19 -07:00
vsavkin b67d574a95 fix(router): navigating to the current location works (#19463)
Closes #13340

PR Close #19463
2017-10-06 15:35:24 -07:00
Victor Berchet 14e8e88022 Revert "refactor(core): Change `abstract get` to `readonly` (#19226)"
This reverts commit 3aa3d5c548.
2017-09-28 13:36:56 -07:00