21885 Commits

Author SHA1 Message Date
Bjarki 2f47de82af build(docs-infra): send CSP reports for Trusted Types violations (#43406)
Configure Firebase to serve a CSP header on angular.io that enables
Trusted Types in report-only mode. This causes any Trusted Types
violations that may occur as users browser angular.io to generate a CSP
report that is sent to csp.withgoogle.com, where it is processed by
Google's CSP report collector.

This is a non-breaking change that allows us to evaluate whether
angular.io is fully compatible with Trusted Types, at which point we can
start enforcing Trusted Types.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki d86e1aba0d build(docs-infra): enable Trusted Types enforcement in angular.json (#43406)
Configure angular.json to serve a CSP header that enabled Trusted Types
in enforcement mode, both in e2e tests and when running the local
development server. This should help prevent regressions related to
Trusted Types in the angular.io app.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki e5ee5a26eb fix(docs-infra): pass a TrustedScriptURL to ServiceWorkerModule (#43406)
Fix a Trusted Types violation in ServiceWorkerModule that occurs when
initializing the service worker from a string URL, by passing a
TrustedScriptURL instead.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki 586302ab2b fix(docs-infra): make doc-viewer compatible with Trusted Types (#43406)
Change DocumentContents.contents to a TrustedHTML and update users
accordingly.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki 02c514e670 fix(docs-infra): make custom icon registry compatible with Trusted Types (#43406)
Change SvgIconInfo.svgSource to be a TrustedHTML and update all its
users accordingly. Also introduce the svg template tag function for
building TrustedHTML from constant SVG sources.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki 501cbc59cc fix(docs-infra): make pretty-printer compatible with Trusted Types (#43406)
Change the PrettyPrinter interface to accept a TrustedHTML and patch
prettify.js so that it makes use of that value without modification.
Update all users of the service to produce, and pass in a TrustedHTML.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki ae1387440b fix(docs-infra): fix simple Trusted Types violations (#43406)
Also introduce a dependency on the Trusted Types type definitions and a
Trusted Types polyfill, safevalues. Create a security module for common,
security-reviewed transformations into Trusted Types.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki 93bb2dde3e fix(docs-infra): fix Trusted Types violation in Analytics snippet (#43406)
The Google Analytics snippet loads its runtime by dynamically creating a
script element and assigning a URL to its src attribute. This causes a
Trusted Types violation.

To fix this, create an inline Trusted Types policy called 'aio#analytics'
to bless the script URL, which is a trusted constant.

PR Close #43406
2021-09-10 09:24:48 -07:00
mgechev b4a551c7f4 docs: add ngUpgrade maintenance timeline (#43379)
Add details about the maintenance timeline for ngUpgrade, reflecting
the deprecation of AngularJS.

PR Close #43379
2021-09-10 09:23:12 -07:00
dario-piotrowicz 08528e9f71 docs: amend code related to string-expressions for property binding (#43366)
resolves #43287

PR Close #43366
2021-09-10 09:22:14 -07:00
Aristeidis Bampakos cbf360ddba docs: add Architect Training to resources (#43327)
PR Close #43327
2021-09-09 14:54:00 -07:00
Andrew Scott ea30979187 docs: Add documentation and TODOs for cleanup (#43391)
* Document `currentUrlTree`, `browserUrlTree`, and `rawUrlTree`
* Add a couple `TODO` comments to investigate changes based on understanding

PR Close #43391
2021-09-09 14:53:27 -07:00
Andrew Kushnir 134e4f5f6a Revert "refactor(router): clean up unnecessary flag in restoreHistory function" (#43409)
This reverts commit 061a456e39.

PR Close #43409
2021-09-09 14:23:31 -07:00
Aristeidis Bampakos 8cc93b723c docs: add Angular Projects book in resources (#43130)
PR Close #43130
2021-09-09 11:33:37 -07:00
David Shevitz a0f0dee25b docs: update the reviewed tag for what-is-angular topic (#43213)
PR Close #43213
2021-09-09 11:30:31 -07:00
Amadou Sall 0cc7ef658c docs: remove extraneous word in the Dependency injection in action guide (#43255)
PR Close #43255
2021-09-09 11:27:31 -07:00
Michele Stieven 565b749713 docs: add Michele Stieven to GDE resources (#43233)
PR Close #43233
2021-09-09 11:21:03 -07:00
Andrew Scott 2658219f7a refactor(router): clean up unnecessary flag in restoreHistory function (#43382)
This restores the `finalize` function to directly call
`resetUrlToCurrentUrlTree`, as it was before efb440eb2f.
This allows us to simplify the `restoreHistory` function because it no
longer needs to handle the call from `finalize` where it should not
reset the internal router state.

PR Close #43382
2021-09-09 09:22:06 -07:00
Alan Agius 141fde1632 fix(animations): emit pure annotations to static property initializers (#43344)
Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
2021-09-09 09:21:25 -07:00
Alan Agius ca510c87c5 fix(core): emit pure annotations to static property initializers (#43344)
Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}a
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
2021-09-09 09:21:24 -07:00
George Kalpakas 0e14deeb92 docs(bazel): fix outdated redirect URL for /guide/bazel (#43376)
The file we are redirecting `/guide/bazel` to was moved from
`bazel/src/schematics/README.md` to `bazel/docs/BAZEL_SCHEMATICS.md` in
commit 71b8c9ab29.

Update the Firebase configuration to use the new path in the redirect
URL.

PR Close #43376
2021-09-09 09:17:40 -07:00
Andrew Scott e726a63cdd release: cut the v12.2.5 release (#43392) 12.2.5 2021-09-08 09:28:03 -07:00
dario-piotrowicz c02e5e15b6 refactor(common): removed TODO no longer considered necessary (#43378)
The TODO comment suggesting to verify that the target element to
scroll to needs to be an anchor does not longer seems under consideration
so it can be removed

resolves #43348

PR Close #43378
2021-09-07 23:05:32 +00:00
Paul Gschwendtner 01d2f03d3d ci: avoid failures when yarn unlinks bazelisk in windows jobs (#43365)
Windows disallows removal of files which are currently being used.
i.e. have active handles. This currently can result in permission denied
failures on the Windows CI jobs where `yarn bazel` resolves to the local
bazelisk installation that can be unlinked by `yarn_install` repository
fetching as part of the Bazel invocation, resulting in errors like:

```
ERROR: An error occurred during the fetch of repository 'npm':
   yarn_install failed: $ node tools/yarn/check-yarn.js
...
[4/5] Linking dependencies...
info If you think this is a bug, please open a bug report with the information provided in "C:\\users\\circleci\\ng\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
 (warning " > tsickle@0.34.3" has incorrect peer dependency "typescript@~3.3.1".
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\users\\circleci\\ng\\node_modules\\@bazel\\bazel-win32_x64\\bazel-0.27.0-windows-x86_64.exe'".
Process stalled
Active handles:
  - Socket
  - Socket
  - Socket
)
```

We workarund this in order to improve CI stability in case the node modules are
being invalidated by Bazel, or through Yarns integrity checking.

PR Close #43365
2021-09-07 21:29:58 +00:00
Paul Gschwendtner e5f9d2d046 build: check .ng-dev tool configuration in CI (#43365)
Checks the `.ng-dev` tool configuration in CI, compared
to doing it locally when the caretaker intends to perform
a merge and then realizes the config is broken.

PR Close #43365
2021-09-07 21:29:58 +00:00
Paul Gschwendtner 68a7cc12e4 build: update bazel setup to latest versions (#43365)
Updates the overall Bazel setup to their latest versions:

* rules_nodejs is updated to stable 4.0.0
* rules_sass is updated to the latest version containing a fix
  for the `@bazel/worker` bug we had a workaround for.
* dev-infra-private is updated to avoid duplicated dependencies.
  We should use a version that also relies on stable rules_nodejs v4.

Note: We are not set on how dependencies for the `bazel/` folder
of the dev-infra package are managed, but we removed `@types/`
packages from the transitive dependencies, so we now need to
manually include `@types/uuid` for building the benchmark driver
utilties. We need to revisit this in the future.

PR Close #43365
2021-09-07 21:29:58 +00:00
Charles Barnes 0bfb5b1f00 docs: remove Angular 9 from support table (#43350)
PR Close #43350
2021-09-07 21:29:32 +00:00
dario-piotrowicz 1bc1971d15 docs: fix app-hero-detaill typo (#43349)
PR Close #43349
2021-09-07 21:25:03 +00:00
George Kalpakas 4e11347a25 build: update feature request template to include core package (#43323)
Update the dropdown list to include core in the list of packages.
PR Close #43323
2021-09-07 21:24:15 +00:00
William Sedlacek 3b4f121caf docs(common): correct typos in jsdoc of http client (#43352)
This corrects four typos in the HttpClient JSDoc
capabilites => capabilities
reuested => requested
wuth => with
responmse => response
PR Close #43352
2021-09-07 18:45:16 +00:00
Ikko Ashimine d8f9e6131f refactor: fix typo in postinstall-patches.js (#43362)
refering -> referring
PR Close #43362
2021-09-07 18:44:47 +00:00
Enea Jahollari aa1782cee6 docs: enhance spacings in dynamic component loader section examples (#43241)
PR Close #43241
2021-09-02 16:45:10 +00:00
Enea Jahollari 4e4a198b3f docs: enhance spacings in content projection section examples (#43241)
PR Close #43241
2021-09-02 16:45:10 +00:00
Enea Jahollari 5af952491a docs: enhance spacings in inputs outputs section examples (#43241)
PR Close #43241
2021-09-02 16:45:10 +00:00
Enea Jahollari d7711d0510 docs: enhance spacings in component interaction section examples (#43241)
PR Close #43241
2021-09-02 16:45:10 +00:00
Enea Jahollari f5d0c889ab docs: enhance spacings in component lifecycle section examples (#43241)
PR Close #43241
2021-09-02 16:45:09 +00:00
Enea Jahollari dc46cc4b37 docs: enhance spacings in component overview section examples (#43241)
PR Close #43241
2021-09-02 16:45:09 +00:00
Enea Jahollari 39c50b577e docs: enhance spacings in try it section examples (#43241)
PR Close #43241
2021-09-02 16:45:09 +00:00
Enea Jahollari 8e1c309e52 docs: enhance what is angular section spacing (#43241)
PR Close #43241
2021-09-02 16:45:09 +00:00
Pete Bacon Darwin a6e22c4b8e build(docs-infra): update dgeni-packages to improve checkLinks messages (#43317)
This update should make the list of files with broken links more readable.

Fixes #43214

PR Close #43317
2021-09-02 16:44:47 +00:00
Alan Agius a0bd6e90f9 fix(router): add more context to Unhandled Navigation Error (#43291)
Previously, the error message was not added to `Unhandled Navigation Error`

Before
```
main.js:1 Unhandled Navigation Errors:
```

After
```
main.js:1 Unhandled Navigation Errors: SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://localhost:4200/' cannot be created in a document with origin 'http://127.0.0.1:8080' and URL 'http://127.0.0.1:8080/'.
```

PR Close #43291
2021-09-01 21:15:00 +00:00
Jessica Janiuk caecd1889b release: cut the v12.2.4 release (#43308) 12.2.4 2021-09-01 13:30:13 -05:00
George Kalpakas d8f637ab43 docs: add step to declare ProductAlertsComponent in tutorial (#43229)
The getting-started tutorial at angular.io/start instructs users to
generate a `ProductAlertsComponent` using the "Angular generator"
feature in [StackBlitz](https://stackblitz.com/). However, unlike the
Angular CLI, generating a component in StackBlitz does not automatically
declare it in `AppModule`, which is a requirement for the component to
be used in the application. This resulted in a compile error when
following the tutorial instructions.

This commit fixes this by adding a step to manually import and declare
the newly generated component in `app.module.ts`.

Fixes #43020
Closes #43212

PR Close #43229
2021-08-30 13:37:46 -07:00
Joey Perrott 46bd8f2495 ci: update pullapprove config to reflect kyliau's departure (#43230)
Update pullapprove configuration to remove kyliau from groups.

PR Close #43230
2021-08-30 08:23:41 -07:00
Joey Perrott d84a4eb90f docs: remove recent departures from contributors page (#43230)
PR Close #43230
2021-08-30 08:23:40 -07:00
Daniel Trevino 692e8ab21e test(compiler-cli): add tests for NullishCoalescingNotNullableCheck (#43232)
Add tests to make sure the nullish coalescing check is generating the
correct diagnostics.

Refs #42966

PR Close #43232
2021-08-26 16:36:33 -07:00
Daniel Trevino 5d64d17a52 refactor(compiler-cli): add NullishCoalescingNotNullableCheck (#43232)
Add a template check that returns diagnostics if the left side of a
nullish coalescing operation is not nullable.

Refs #42966

PR Close #43232
2021-08-26 16:36:33 -07:00
Daniel Trevino 9c6399926a refactor(compiler-cli): use TemplateCheckWithVisitor in InvalidBananaInBoxCheck (#43232)
Modify the existing template check to use the new abstract class. This
makes template checks easier to read and understand.

Refs #42966

PR Close #43232
2021-08-26 16:36:32 -07:00
Daniel Trevino 75fc846745 refactor(compiler-cli): add abstract TemplateCheckWithVisitor class (#43232)
Add an abstract class that has a default implementation of the run
function and visits all nodes. Authors of template checks can extend
this class and override the `visitNode` method to return diagnostics.

Refs #42966

PR Close #43232
2021-08-26 16:36:32 -07:00
Daniel Trevino debe517d4f refactor(compiler-cli): move component out of TemplateContext (#43232)
Move `component` out of the `TemplateContext` so the context can be
reused for multiple components.

Refs #42966

PR Close #43232
2021-08-26 16:36:32 -07:00