2950 Commits

Author SHA1 Message Date
Piotr Tomiak
8b1d28ff48 docs(core): close tags in example (#29474)
PR Close #29474
2019-03-22 13:15:04 -07:00
Cameron Steffen
a677d8b330 docs(core): indicate OnPush applies to children (#28320)
Indicate the OnPush change detection strategy applies to all child directives.
Resolves confusion from #12480.
PR Close #28320
2019-03-21 15:48:47 -07:00
Rob Gregorius
280ea13342 docs(core): fix typo in NgModule imports example description (#29272)
PR Close #29272
2019-03-19 13:11:35 -04:00
John Reese
3b1e539bab docs(forms): fix small typo in forms documentation (#29370)
PR Close #29370
2019-03-19 13:11:11 -04:00
Paul Gschwendtner
cf8d934ba9 fix(compiler-cli): incorrect metadata bundle for multiple unnamed re-exports (#29360)
Currently if an Angular library has multiple unnamed module re-exports, NGC will
generate incorrect metdata if the project is using the flat-module bundle option.

e.g.

_public-api.ts_
```ts
export * from '@mypkg/secondary1';
export * from '@mypkg/secondary2';
```

There are clearly two unnamed re-exports in the `public-api.ts` file. NGC right now
accidentally overwrites all previous re-exports with the last one. Resulting in the
generated metadata only containing a reference to `@mypkg/secondary2`.

This is problematic as it is common for primary library entry-points to have
multiple re-exports (e.g. Material re-exporting all public symbols; or flex-layout
exporting all public symbols from their secondary entry-points).

Currently Angular Material works around this issue by manually creating
a metadata file that declares the re-exports from all unnamed re-exports.

(see: https://github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85)

This workaround works fine currently, but is no longer easily integrated when
building the package output with Bazel. In order to be able to build such
libraries with Bazel (Material/flex-layout), we need to make sure that NGC
generates the proper flat-module metadata bundle.

PR Close #29360
2019-03-18 15:08:43 -04:00
zackarychapple
08f6a64893 docs: updating url for jsonp reference (#29247)
PR Close #29247
2019-03-15 12:41:38 -04:00
Sarun Intaralawan
e8ed37a0e7 docs(core): deprecate ViewEncapsulation.Native (#26361) (#28423)
PR Close #26361

PR Close #28423
2019-03-14 16:56:13 -04:00
Greg Magolan
6ba1cd4365 build(bazel): fix tsconfig extends for //packages/bazel/test/protractor-2:ts_spec (#29280)
PR Close #29280
2019-03-13 10:39:22 -07:00
Riley Littlefield
b4ee74667b docs: fix typo in directive decorator description (#29207)
PR Close #29207
2019-03-12 10:51:13 -07:00
Ivan Tham
67444e70ab docs: update enableIvy link (#29238)
PR Close #29238
2019-03-12 10:35:00 -07:00
Judy Bogart
190330a612 docs: clarify intro and examples (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
Judy Bogart
9417086f6c docs: add publicapi flag (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
Judy Bogart
535ff0564a docs: route interface and types doc example (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
Greg Magolan
ea495d958f build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#29063)
* removed /tools/http_server and uses http_server from rules_nodejs
* updated bazel schematics to use angular bundles

PR Close #29063
2019-03-07 08:57:24 -08:00
WilliamKoza
24a1e146da refactor(language-service): clean up imports language-service and misspellings in public API (#29097)
PR Close #29097
2019-03-05 09:46:47 -08:00
José Toledo Navarro
2256920292 docs(router): align examples in interfaces docs (#29093)
* Use exclusively `TeamComponent` class for examples, as currently there are at least 3 different component classes being used, one of which is actually as a type argument for a `Resolve<T>` implementation.
PR Close #29093
2019-03-05 09:45:53 -08:00
Maxim Mazurok
2a25ac2ac9 fix(router): removed obsolete TODO comment (#29085)
PR Close #29085
2019-03-05 09:44:41 -08:00
George Kalpakas
56693339c2 fix(service-worker): detect new version even if files are identical to an old one (#26006)
Previously, if an app version contained the same files as an older
version (e.g. making a change, then rolling it back), the SW would not
detect it as the latest version (and update clients).

This commit fixes it by adding a `timestamp` field in `ngsw.json`, which
makes each build unique (with sufficiently high probability).

Fixes #24338

PR Close #26006
2019-03-05 09:41:45 -08:00
Judy Bogart
c976b88dcf docs: fix and add decorator api doc (#28986) (#29112)
PR Close #28986

PR Close #29112
2019-03-04 17:51:42 -08:00
George Kalpakas
b598e884f6 fix(service-worker): ignore passive mixed content requests (#25994)
Although [passive mixed content][1] requests (like images) only produce
a warning without a ServiceWorker, fetching it via a ServiceWorker
results in an error. See
https://github.com/angular/angular/issues/23012#issuecomment-376430187
for more details.

This commit makes the ServiceWorker ignore such requests and let them be
handled by the browser directly to avoid breaking apps that would work
without the ServiceWorker.

[1]: https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content#passive_mixed_content

Fixes #23012

PR Close #25994
2019-03-04 11:51:06 -08:00
Pete Bacon Darwin
cf916a03d3 docs(core): tidy up the description of resolveComponentResources() (#28055) (#28736)
There were a number of typos and some of the sentences did not
read well.

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Pete Bacon Darwin
ee6498f37e refactor(compiler): remove unnecessary ! operators from lexer (#28055) (#28736)
When we added the strict null checks, the lexer had some `!`
operators added to prevent the compilation from failing.

This commit resolves this problem correctly and removes the
hacks.

Also the comment

```
// Note: this is always lowercase!
```

has been removed as it is no longer true.

See #24571

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Pete Bacon Darwin
1a0b2ff4fb refactor(compiler): use options argument for parsers (#28055) (#28736)
This commit consolidates the options that can modify the
parsing of text (e.g. HTML, Angular templates, CSS, i18n)
into an AST for further processing into a single `options`
hash.

This makes the code cleaner and more readable, but also
enables us to support further options to parsing without
triggering wide ranging changes to code that should not
be affected by these new options.  Specifically, it will let
us pass information about the placement of a template
that is being parsed in its containing file, which is essential
for accurate SourceMap processing.

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Alex Eagle
c938fb4619 build: update to bazel 0.23 2019-03-01 15:40:50 -08:00
Matias Niemelä
2f49a23d64 test(animations): fix unit-based delays within the animation DSL (#28993)
Closes #24291

PR Close #28993
2019-03-01 15:16:49 -08:00
Wassim Chegham
9226b421e8 style: enforce buildifier lint rules (#29019)
PR Close #29019
2019-02-28 02:57:35 -08:00
Rado Kirov
b06847f43d refactor: Consistently use index access on index signature types. (#28937)
This change helps highlight certain misoptimizations with Closure
compiler. It is also stylistically preferable to consistently use index
access on index sig types.

Roughly, when one sees '.foo' they know it is always checked for typos
in the prop name by the type system (unless 'any'), while "['foo']" is
always not.

Once all angular repos are conforming this will become a tsetse.info
check, enforced by bazel.

PR Close #28937
2019-02-28 02:52:19 -08:00
Matias Niemelä
86981b395d fix(animations): ensure position and display styles are handled outside of keyframes/web-animations (#28911)
When web-animations and/or CSS keyframes are used for animations certain
CSS style values (such as `display` and `position`) may be ignored by a
keyframe-based animation. Angular should special-case these styles to
ensure that they get applied as inline styles throughout the duration of
the animation.

Closes #24923
Closes #25635

Jira Issue: FW-1091
Jira Issue: FW-1092

PR Close #28911
2019-02-27 11:57:31 -08:00
Greg Magolan
feec963106 style: format (#28995)
PR Close #28995
2019-02-27 08:47:27 -08:00
Greg Magolan
09fc669b4f build(bazel): allow a user to control a subset of angularCompilerOption in their tsconfig file when using ng_module (#28995)
PR Close #28995
2019-02-27 08:47:27 -08:00
George Kalpakas
fdcf877f83 fix(core): traverse and sanitize content of unsafe elements (#28804)
In the past, the sanitizer would remove unsafe elements, but still
traverse and sanitize (and potentially preserve) their content. This was
problematic in the case of `<style></style>` tags, whose content would
be converted to HTML text nodes.

In order to fix this, the sanitizer's behavior was changed in #25879 to
ignore the content of _all_ unsafe elements. While this fixed the
problem with `<style></style>` tags, it unnecessarily removed the
contents for _any_ unsafe element. This was an unneeded breaking change.

This commit partially restores the old sanitizer behavior (namely
traversing content of unsafe elements), but introduces a list of
elements whose content should not be traversed if the elements
themselves are considered unsafe. Currently, this list contains `style`,
`script` and `template`.

Related to #25879 and #26007.

Fixes #28427

PR Close #28804
2019-02-26 13:32:10 -08:00
Brandon
0977d95802 docs(core): export the ...Decorator interfaces to ensure they are documented (#28836) (#28961)
If an interface is not exported publicly from its package, then the doc-gen
does not see it, and so cannot include it in the generated documentation.

This was the case for a number of `...Decorator` interfaces, such as
`PipeDecorator` and `InputDecorator.

This commit adds these interfaces to the public export to fix this problem.

PR Close #28836

PR Close #28961
2019-02-25 12:53:50 -08:00
Sarun Intaralawan
4bc0084e5a docs(router): reword relativeLinkResolution docs to not mention version numbers (#26991)
PR Close #26991
2019-02-22 14:35:55 -08:00
Greg Magolan
b6864494a1 fix(bazel): pin browser repositories using @npm_bazel_karma//:browser_repositories.bzl in bazel schematics (#28896)
PR Close #28896
2019-02-22 12:19:00 -08:00
Greg Magolan
0021437ee1 build: fixes (#28896)
PR Close #28896
2019-02-22 12:19:00 -08:00
Greg Magolan
d91ecd2c8b build: update to rules_typescript 0.25.1 (#28896)
* build_bazel_rules_typescript renamed to npm_bazel_typescript
* build_bazel_rules_karma renamed to npm_bazel_karma
* browser_repositories.bzl removed and now using @npm_bazel_karma//:browser_repositories.bzl
* includes some fixes for future ts_library devmode es2015 support but some failure still remain when devmode is es2015 so this PR keeps it as es5 using the bazelOptions.devmodeTargetOverride tsconfig setting

PR Close #28896
2019-02-22 12:18:59 -08:00
Keen Yee Liau
d0018e6bf6 fix(language-service): Fix completions for input/output with alias (#28904)
This PR fixes a bug in autocompletion for @Input/@Output decorator with
an alias. The current implementation ignores the alias.

Credit for this work is attributed to @edgardmessias
The original work fixed the bug, but was lacking test.

PR Close #27959

PR Close #28904
2019-02-22 12:02:18 -08:00
Vani
ce219ccfa2 docs(common): update docs for HttpClient methods (#26143)
PR Close #26143
2019-02-21 20:56:13 -08:00
Greg Magolan
c6741bf36a build: no //package/bazel/src/api-extractor on the patch branch (#28901)
PR Close #28901
2019-02-21 17:54:04 -08:00
Alex Eagle
cc06bf50f3 build: Add .bzl/BUILD files to @angular/bazel package (#28901)
It's now possible to use it as a hybrid package in latest rules_nodejs, so no WORKSPACE dep is needed

PR Close #28901
2019-02-21 17:53:56 -08:00
Greg Magolan
21e78ad022 build: no //package/bazel/src/api-extractor on the patch branch (#28901)
PR Close #28901
2019-02-21 16:34:37 -08:00
Alex Eagle
05e855092b build: Add .bzl/BUILD files to @angular/bazel package (#28901)
It's now possible to use it as a hybrid package in latest rules_nodejs, so no WORKSPACE dep is needed

PR Close #28901
2019-02-21 16:34:37 -08:00
Greg Magolan
3eb327b67b build(bazel): do not build rxjs from source under Bazel (#28869)
PR Close #28869
2019-02-21 08:05:25 -08:00
Paul Gschwendtner
abc3cbb33f build: run example unit tests with bazel (#28703)
With #28402 we updated the `examples` package to be
built and tested with Bazel. This PR was only intended
for the e2e integration tests, and there still seem to be
a few unit tests that need to be migrated to Bazel until
we can remove the legacy local unit tests job.

PR Close #28703
2019-02-20 16:31:50 -08:00
Igor Minar
843fc7df9f Revert "feat(router): add hash-based navigation option to setUpLocationSync (#28609)"
This reverts commit fc895ba1893d08813f931c8794c7db97782f1c36.

This is change is a feature and doesn't belong on the patch branch.
2019-02-20 12:07:16 -08:00
Jason Aden
fc895ba189 feat(router): add hash-based navigation option to setUpLocationSync (#28609)
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes #24429 #21995

PR Close #28609
2019-02-19 16:20:36 -08:00
Trevor Karjanis
01b05b3f7c docs(platform-browser): fix a grammatical error in the BrowserModule documentation (#28808)
The browser module is not included by defaults, it is included by default. Default should be singular.

There is no associated issue.
PR Close #28808
2019-02-19 12:54:53 -08:00
George Kalpakas
3b78f9eb0f build(compiler-cli): upgrade chokidar to latest version (#28797)
Fixes #28771

PR Close #28797
2019-02-19 12:54:12 -08:00
Paul Gschwendtner
ab69c31fc5 fix(compiler-cli): incorrect bundled metadata for static class member call expressions (#28762)
Currently if developers use call expressions in their static
class members ([like we do in Angular](https://github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/keyvalue_differs.ts#L121)),
the metadata that is generated for flat modules is invalid. This
is because the metadata bundler logic currently does not handle
call expressions in static class members and the symbol references
are not rewritten to avoid relative paths in the bundle.

Static class members using a call expression are not relevant for
the ViewEngine AOT compilation, but it is problematic that the
bundled metadata references modules using their original relative
path. This means that the bundled metadata is no longer encapsulated
and depends on other emitted files to be emitted in the proper place.

These incorrect relative paths can now cause issues where NGC
looks for the referenced symbols in the incorrect path. e.g.

```
src/
 | lib/
    | index.ts -> References the call expression using `../../di`
```

Now the metadata looks like that:

```
node_modules/
  | @angular/
  -- | core/
  -- -- | core.metadata.json -> Says that the call expr. is in `../../di`.
  | di/
```

Now if NGC tries to use the metadata files and create the summary files,
NGC resolves the call expression to the `node_modules/di` module. Since
the "unexpected" module does not contain the desired symbol, NGC will
error out.

We should fix this by ensuring that we don't ship corrupted metadata
to NPM which contains relative references that can cause such
failures (other imports can be affected as well; it depends on what
modules the developer has installed and how we import our call
expressions).

Fixes #28741.

PR Close #28762
2019-02-19 12:53:20 -08:00
Cody Schroeder
bf25165354 build(bazel): specify tsconfig-test dependency (#28696)
PR Close #28696
2019-02-16 20:57:34 -08:00