Compare commits

...

430 Commits

Author SHA1 Message Date
Joey Perrott 35f4799ebd release: cut the v12.2.17 release 2022-11-22 17:24:47 +00:00
Andrew Kushnir ac284dbe68 docs(core): add an error details page for unsafe <iframe> bindings (#48027)
PR Close #48027
2022-11-21 12:24:37 -08:00
Andrew Kushnir b871db57da fix(core): hardening attribute and property binding rules for <iframe> elements
This commit updates the logic related to the attribute and property binding rules for <iframe> elements. There is a set of <iframe> attributes that may affect the behavior of an iframe and this change enforces that these attributes are only applied as static attributes, making sure that they are taken into account while creating an <iframe>.

If Angular detects that some of the security-sensitive attributes are applied as an attribute or property binding, it throws an error message, which contains the name of an attribute that is causing the problem and the name of a Component where an iframe is located.

BREAKING CHANGE:

Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.
2022-11-21 12:24:37 -08:00
Joey Perrott 64b8a8d067 docs: update security guide (#47296)
Update the security guide to our new vulnerability intake process.

PR Close #47296
2022-08-30 18:03:46 +00:00
Joey Perrott ac7fdbd93e build: update saucelabs key (#46089)
Update the saucelabs key for the newly generated key

PR Close #46089
2022-05-21 20:21:43 +00:00
Joey Perrott 68981ccc09 build: update saucelabs key (#46088)
Update the saucelabs key for the newly generated key

PR Close #46088
2022-05-21 20:11:06 +00:00
Paul Gschwendtner beda8f490c build: updates to account for github primary branch rename (#45717)
This is the commit accounting for the Github primary branch
rename when we actually perform the update.

We have three change phases: Prepare, Direct, Cleanup. This commit
is for the `direct` phase.

PR Close #45717
2022-04-28 17:27:37 +00:00
Paul Gschwendtner 0131f2438e build: preparation for primary branch rename in the Angular repos [v12] (#45697)
Preparation for the framework repo as outlined our planning
document.

PR Close #45697
2022-04-20 10:04:27 -07:00
Joey Perrott 68901bf0f3 fix(docs-infra): prevent framing of AIO with X-Frame-Options
Prevent the docs site from being place in an iframe.
2022-03-23 15:11:13 -07:00
Andrew Kushnir b2a081a19d release: cut the v12.2.16 release (#44847) 2022-01-26 16:10:13 -08:00
Andrew Kushnir c18e1d11d6 ci: bump the cache key version for components unit tests CI job (#44843)
Yarn 1.x sometimes does not clean up unneeded nested node modules, and this breaks some strict assumption in the Bazel NodeJS yarn install. This commit bumps the version in the cache key to make sure there is no stale cache that is used in CI jobs (that is causing issues with that CI job).

PR Close #44843
2022-01-26 12:57:47 -08:00
JoostK 460befd693 fix(ngcc): support element accesses for export declarations (#44824)
Bundlers like Rollup may use an element access expression for an export
declaration, which causes ngcc to ignore those export declarations possibly
resulting in incomplete processing of packages.

Element access syntax may be used when the declared name is not considered
as valid JS identifier, but bundlers may be conservative in determining whether
an identifier can be used (to emit a property access) and opt for a string
literal in an element access instead.

The element access syntax introduces a problem for ngcc, where it wouldn't
consider such export as class declaration, causing them to be skipped. The
ngtsc compiler is implemented with the assumption that all class declarations
use a `ts.Identifier` as name, whereas the element access is using a string
literal for the declared name. This makes it troublesome for ngcc to support
this syntax form in UMD bundles.

To work around the problem, this function transforms these access expressions
into regular property accesses. The source text is parsed to an AST to allow
finding the element accesses in a robust way, after which the affected text
ranges are replaced with property accesses in the original source text.

Closes #44037

PR Close #44824
2022-01-25 14:16:41 -08:00
Alex Rickabaugh 9616b086ea release: cut the v12.2.15 release (#44432)
PR Close #44432
2021-12-10 13:56:04 -05:00
Alex Rickabaugh d245c34333 release: cut the v12.2.15 release (#44406)
PR Close #44406
2021-12-08 14:08:01 -05:00
George Kalpakas b6554d75cd fix(ngcc): correctly resolve UMD dependencies (#44382)
Previously, when processing UMD, ngcc assumed that the `exports`
argument of the CommonJS factory call (if present) would be the first
argument of the call. This is generally true for the supported UMD
formats, but can change if ngcc prepends more imports (and thus factory
arguments) while processing the module. This could lead to errors when
trying to collect dependencies of an already processed module.
(This was accidentally broken in #44245 (commit 2bc3522e16).)

This commit fixes it by not making any assumptions about the position of
an `exports` argument in the CommonJS factory call.

Fixes #44380

PR Close #44382
2021-12-07 08:33:35 -05:00
Dylan Hunn 4cf1a81265 release: cut the v12.2.14 release (#44341)
Joey told me to merge the LTS release cut directly on Github. 🤞
2021-12-01 15:08:56 -08:00
George Kalpakas a1bd9d7eb1 test(ngcc): use main property in test package.json files for UMD tests (#44245)
Previously, the mock packages created for `UmdDependencyHost`'s tests,
specified the entry-point as `esm2015`. This does not matter in tests,
since the packages are explicitly passed to the `UmdDependencyHost`
(while in reality the appropriate host would be determined based on the
name of the entry-point property - in this case, detecting the
entry-point as ES2015 and not UMD).

However, in order to avoid confusion, this commit updates the test
packages to use `main` (the default property used for the UMD format in
`package.json` files).

PR Close #44245
2021-11-30 17:24:43 +02:00
George Kalpakas a8be244113 fix(ngcc): correctly report error when collecting dependencies of UMD module (#44245)
Previously, the ngcc `UmdReflectionHost` would throw a misleading error
when trying to collect dependencies of an invalidly formatted UMD
module. This happened because an error would be thrown while trying to
construct the error message for the actual error, by calling `getText()`
on certain TypeScript AST nodes. See
https://github.com/angular/angular/issues/44019#issuecomment-959954121
for a more in-depth explanation.

This commit ensures `getText()` can be safely called on TypeScript AST
nodes when collecting dependencies of UMD modules.

PR Close #44245
2021-11-30 17:24:43 +02:00
George Kalpakas ee855b8b73 test(ngcc): run more tests against more supported UMD formats (#44245)
This commit utilizes the infrastructure added in the previous commit to
run more tests against more of the supported UMD formats. This shall
give us more confidence that all aspects of UMD processing work
correctly with the various formats.

PR Close #44245
2021-11-30 17:24:43 +02:00
George Kalpakas 6b1a69e583 test(ngcc): use helper function for generating UMD modules for tests (#44245)
Previously, several ngcc test suites used their own helper to generate
test UMD modules.

This commit switches to using the same helper for generating UMD modules
across test suites. This improves DRYness (ensuring changes/fixes to the
UMD format need only be applied once) and makes it easier to test
different UMD formats in all test suites.

PR Close #44245
2021-11-30 17:24:43 +02:00
George Kalpakas fc072935ee fix(ngcc): support the UMD wrapper function format emitted by Webpack (#44245)
Previously, ngcc could only handle UMD modules whose wrapper function
was implemented as a `ts.ConditionalExpression` (i.e. using a ternary
operator). This is the format emitted by popular bundlers, such as
Rollup.

This commit adds support for a different format, that uses `if/else`
statements, which is what is [emitted by Webpack][1].

[1]: https://webpack.js.org/configuration/output/#type-umd

Fixes #44019

PR Close #44245
2021-11-30 17:24:43 +02:00
George Kalpakas 2e31f92a69 refactor(ngcc): make it easy to support more UMD wrapper function formats (#44245)
Previously, ngcc could only handle UMD modules whose wrapper function
was implemented as a `ts.ConditionalExpression` (i.e. using a ternary
operator). This is the format emitted by popular bundlers, such as
Rollup. However, this failed to account for a different format, using
`if/else` statements, such as the one [emitted by Webpack][1].

This commit prepares ngcc for supporting different UMD wrapper function
formats by decoupling the operation of parsing the wrapper function body
to capture the various factory function calls and that of operating on
the factory function calls (for example, to read or update their
arguments). In a subsequent commit, this will be used to add support for
the Webpack format.

[1]: https://webpack.js.org/configuration/output/#type-umd

PR Close #44245
2021-11-30 17:24:42 +02:00
Pete Bacon Darwin e3db0385b6 fix(compiler): ensure that partially compiled queries can handle forward references (#44124)
When a partially compiled component or directive is "linked" in JIT mode, the body
of its declaration is evaluated by the JavaScript runtime. If a class is referenced
in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the
file, then the reference must be wrapped in a `forwardRef()` call.

Previously, query predicates were not wrapped correctly in partial declarations
causing the code to crash at runtime. In AOT mode, this code is never evaluated
but instead transformed as part of the build, so this bug did not become apparent
until Angular Material started running JIT mode tests on its distributable output.

This change fixes this problem by noting when queries are wrapped in `forwardRef()`
calls and ensuring that this gets passed through to partial compilation declarations
and then suitably stripped during linking.

See angular/components#23882 and angular/components#23907

PR Close #44124
2021-11-16 09:50:05 -08:00
Pete Bacon Darwin 8354e23e9a refactor(compiler): rename R3ProviderExpression and associated helpers (#44124)
This interface will be used in other situations so this change renames it to be more general as `MaybeForwardRefExpression`.

PR Close #44124
2021-11-16 09:50:04 -08:00
iRealNirmal f6045f7566 docs: move deprecations example snippets to external file (#43700) (#43916)
Moving angular depreciation examples to external project

closes #43337

PR Close #43700

PR Close #43916
2021-11-11 11:08:38 -08:00
Alex Rickabaugh 8a99ef18b4 release: cut the v12.2.13 release (#44038)
PR Close #44038
2021-11-03 13:19:34 -07:00
JoostK 656f574962 refactor(compiler-cli): extract error documentation base url into separate file (#43965)
Prior refactorings caused unexpected g3 sync issues due to a patch that
changes the error documentation URL. This commit moves the base url into
a separate file to make this more apparent.

PR Close #43965
2021-11-02 16:38:54 -07:00
JoostK 9a89db790f fix(compiler-cli): avoid broken references in .d.ts files due to @internal markers (#43965)
The `ErrorCode` enum in the `error_code.ts` file is governed by public
api guards but the other top-level exports from that file are exempt
from public api documentation and are therefore marked as `@internal`.
However, TypeScript is configured with the `stripInternal` compiler
option such that declarations with `@internal` markers are not emitted
into the `.d.ts` files, but this means that the reexports in the barrel
file end up referring to missing declarations.

The `stripInternal` option is considered internal and its documentation
states to use at your own risk (as per https://github.com/microsoft/TypeScript/issues/45307).
Having the option enabled is desirable for us as it works well for
hiding class fields that are marked `@internal`, which is an effective
way to hide members from the .d.ts file. As a workaround for the issue
with top-level symbols, the declarations with `@internal` markers are
moved to dedicated files for which no public api guard is setup,
therefore allowing their `@internal` markers to be dropped.

Fixes #43097

PR Close #43965
2021-11-02 16:38:54 -07:00
Alan Agius 8d060dd2f2 fix(docs-infra): search box input line-height (#43983)
This fixes an issue on Safari which caused the text to be pushed down when blurring out of the search input field. The root cause of the problem appears to be that previously the computed line height was that of 32px, which caused a shift in content.

Closes #43935

PR Close #43983
2021-10-29 15:47:08 -07:00
Joe Martin (Crowdstaffing) 09ee0af280 docs: update note (#43979)
Update the note for hierarchy of locale identifiers.

PR Close #43979
2021-10-29 15:46:35 -07:00
Joe Martin (Crowdstaffing) 6e89e1d757 docs: remove link (#43979)
Remove redundant link.

PR Close #43979
2021-10-29 15:46:35 -07:00
George Kalpakas 156927de9e refactor(docs-infra): remove obsolete way of disabling DocViewer animations (#43977)
Previously, there were two ways to disable view transition animations in
`DocViewerComponent`: Using a `.no-animations` CSS class on the
`<aio-doc-viewer>` element and setting the static
`DocViewerComponent.animationsEnabled` property to `false`. The latter
was only used to disable animations for testing purposes.

With the recent introduction of `AppComponent.reducedMotion`, there is
now an easy way to disable animations in tests using the
`.no-animations` class (which is applied by `AppComponent` based on the
value of `AppComponent.reducedMotion`). Therefore, it is no longer
necessary to have `DocViewerComponent.animationEnabled`.

This commit removes the now obsolete `animationsEnalbed` property.

PR Close #43977
2021-10-29 15:45:00 -07:00
George Kalpakas 84f71ed723 fix(docs-infra): improve accessibility by respecting prefers-reduced-motion (#43977)
Make the app easier to use for people with motion sensitivities by
disabling several animations (esp. ones involving moving things around)
when the user prefers reduced motion. The user's preference is detected
using the [prefers-reduced-motion][1] CSS media feature.

Disabled animations include:
- View fade in/out transitions.
- Sidenav open/close animations.
- Top-menu color and size changes.
- Contributor cards flip animations.

For more details on using `prefers-reduced-motion` and disabling
Angular animations see:
- [Designing with reduced motion for motion sensitivities][2]
- [Disabling Angular animations at runtime][3]

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
[2]: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
[3]: https://dev.to/this-is-angular/disabling-angular-animations-at-runtime-9a6

PR Close #43977
2021-10-29 15:45:00 -07:00
George Kalpakas e9c228b76d ci: improve angular.io deployment process for the master branch (#43963)
Previously, the master branch was only deployed to the
`next-angular-io-site` Firebase site, which is connected to the
`next.angular.io` domain. However, if the master major version was
higher than the stable major version (or the RC major version in case
there was an active RC), we also had to manually configure (via the
Firebase console and/or DNS records) the `v<X>.angular.io` domain to
redirect to `next.angular.io`. Then, once `<X>` became the new stable or
RC version, we had to manually remove the redirect (to let
`v<X>.angular.io` be redirected to `angular.io` or `rc.angular.io`).

This commit is part of a new process that reduces the manual steps as
follows (the steps below only apply when the master major version is
higher than the current stable and RC (if applicable)):
- A `v<X>-angular-io-site` Firebase site will be created as soon as the
  version in the `master` branch's `package.json` is updated to a new
  major.
- The `v<X>.angular.io` domain will be connected to that new Firebase
  site.
- When deploying from the master branch, we will deploy to both
  `next-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `next.angular.io`.
- When the master version becomes the new stable/RC, we will start
  deploying to `v<X>-angular-io-site` from the stable/RC branch, which
  will update the Firebase config to stop redirecting to
  `next.angular.io` and redirect to `(rc.)angular.io` instead (without
  requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas ce1cf929c3 ci: improve angular.io deployment process for the RC branch (#43963)
Previously, (when there was an active RC) the RC branch was only
deployed to the `rc-angular-io-site` Firebase site, which is connected
to the `rc.angular.io` domain. However, if the RC major version was
higher than the stable major version, we also had to manually configure
(via the Firebase console and/or DNS records) the `v<X>.angular.io`
domain to redirect to `rc.angular.io`. Then, once `<X>` became the new
stable version, we had to manually remove the redirect (to let
`v<X>.angular.io` be redirected to `angular.io`).

This commit is part of a new process that reduces the manual steps as
follows (the steps below only apply to RC versions that have a higher
major version than the current stable):
- A `v<X>-angular-io-site` Firebase site will be created for the new RC
  version.
- The `v<X>.angular.io` domain will be connected to that new Firebase
  site.
- When deploying from the RC branch, we will deploy to both
  `rc-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `rc.angular.io`.
- When the RC version becomes the new stable, we will start deploying to
  `v<X>-angular-io-site` from the stable branch, which will update the
  Firebase config to stop redirecting to `rc.angular.io` and redirect to
  `angular.io` instead (without requiring changes in the Firebase
  console or DNS).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 3295cd5914 ci: improve angular.io deployment process for the stable branch (#43963)
Previously, the stable branch was always deployed to the
`v<X>-angular-io-site` Firebase site, which was connected to the
`angular.io` domain. Whenever a new major version was released (and
became the new stable version), the `angular.io` domain had to be
disconnected from the previous Firebase site and be connected to the new
`v<Y>-angular-io-site` Firebase site. This was a manual process that
involved making changes in the Firebase console and the DNS records.

This commit is part of a new process that reduces the manual steps as
follows:
- A new `stable-angular-io-site` Firebase site is created.
- The `angular.io` domain will be connected to that new Firebase site.
- When deploying from the stable branch, we will deploy to both
  `stable-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `angular.io`.
- When a new major version is released, we will start deploying from the
  new stable branch to `stable-angular-io-site`, but there will be no
  need to connect/disconnect the `angular.io` domain. Also,
  `v<X>.angular.io` will stop redirecting to `angular.io` by means of
  updating the Firebase config file (without requiring changes in the
  Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 3bb878be00 feat(docs-infra): add post-deploy actions for testing more redirect configs (#43963)
Add `deploy-to-firebase` post-deploy actions to allow testing various
redirect configs.
In a future commit, this will allow testing redirects for the `stable`,
`rc` and `next` deployments via the Firebase config file (without
requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 30b3af8f15 refactor(docs-infra): make it easier to configure Firebase redirects at deployment (#43963)
Refactor the `deploy-to-firebase` post-deploy actions by extracting
logic to separate helper functions. This makes it easier to create more
functions for testing various redirect configs (in a future commit).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 91f46dd0ac feat(docs-infra): add more granular support for configuring Firebase redirects at deployment (#43963)
Previously, there was a `deploy-to-firebase` pre-deploy action for
configuring Firebase to redirect non-file requests to `angular.io`. This
is used for ensuring that `rc.angular.io` is correctly redirected to
`angular.io`, even when people have previously visited (and have a
ServiceWorker activated on) `rc.angular.io`.

This commit adds pre-deploy actions for configuring Firebase to redirect
a deployment to any of `angular.io`, `rc.angular.io` or
`next.angular.io` and also configure whether all requests or only
non-file requests will be redirected.
In a future commit, this will allow managing redirects for the `stable`,
`rc` and `next` deployments via the Firebase config file (without
requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas c12b64d7f9 feat(docs-infra): create undo functions for all pre-deploy actions (#43963)
Create functions to undo the changes made by any pre-deploy action.
In a future commit, this will allow deploying a build to multiple
projects/sites with different small tweaks for each.

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 5f06fea90b test(docs-infra): avoid running expensive operations when focusing/skipping tests (#43963)
Previously, the pre-computation of branch version info for the
`deploy-to-firebase` tests would always take place even when the tests
that used that info were skipped. This pre-computation involves network
access and may add a noticeable delay.

This commit refactors the tests to not do the pre-computation if the
corresponding tests are skipped. This allows for a faster iteration
when focusing on a different set of tests.

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas d7b25db874 refactor(docs-infra): move deploy-to-firebase post-deploy actions to a separate file (#43963)
Move some functions that are used as post-deploy actions from
`deploy-to-firebase/index.mjs` to a separate file
(`deploy-to-firebase/post-deploy-actions.mjs`) to keep `index.mjs` small
and easier to maintain.

NOTE:
While not strictly necessary atm, `post-deploy-actions.mjs` uses the
same default export pattern for consistency with `utils.mjs`.

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 1374b63566 refactor(docs-infra): move deploy-to-firebase pre-deploy actions to a separate file (#43963)
Move some functions that are used as pre-deploy actions from
`deploy-to-firebase/index.mjs` to a separate file
(`deploy-to-firebase/pre-deploy-actions.mjs`) to keep `index.mjs` small
and easier to maintain.

Also, rename the `removeServiceWorker()` function to
`disableServiceWorker()`, which is a little more accurate.

NOTE:
While not strictly necessary atm, `pre-deploy-actions.mjs` uses the same
default export pattern for consistency with `utils.mjs`.

PR Close #43963
2021-10-29 15:05:08 -07:00
George Kalpakas 2d6815b3b1 refactor(docs-infra): move deploy-to-firebase util functions to a separate file (#43963)
Move some util functions from `deploy-to-firebase/index.mjs` to a
separate file (`deploy-to-firebase/utils.mjs`) to keep `index.mjs` small
and easier to maintain.

NOTE:
To make it easier to mock functions in tests, `utils.mjs` uses a default
export (instead of multiple named exports) and references local
functions through the default exported object.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas bcec9667a2 refactor(docs-infra): create logSectionHeader() helper in deploy-to-firebase script (#43963)
Create a `logSectionHeader()` helper function to avoid duplicating code.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas ee73ba77c0 refactor(docs-infra): convert deploy-to-firebase script to ESM (#43963)
Convert the `deploy-to-firebase` script (and corresponding tests) from
CommonJS format to ESM.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas 073cd1c4e8 build(docs-infra): validate computed deployments in deploy-to-firebase script (#43963)
The `deploy-to-firebase` script might have to deploy a single AIO build
to multiple projects/sites (potentially with small tweaks between each).

This commit adds a step to validate the computed deployments to ensure
they are compatible with each other (for example, that there is exactly
one primary deployment that builds the app and sets the theme/mode and
that all secondary deployments are compatible with the primary one).

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas 6864f0aa6b refactor(docs-infra): add name and type to deployment info (#43963)
This commit adds two new properties, `name` and `type`, to deployment
info data. This will make it easier to differentiate between deployment
targets (e.g. primary vs secondary) and will provide more informative
log messages.

In a subsequent commit, this new data can be used to validate the
computed deployments list.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas 326abdfb69 fix(docs-infra): improve an error message in deploy-to-firebase script (#43963)
This commit fixes a typo in an error message thrown in the
`deploy-to-firebase` script (`but it was but it was` --> `but it was`).

It also makes the error clearer when the request was not redirected.

Old error:
> Expected '<original-url>' to be redirected to '<expected-url>', but it
> was but it was redirected to 'undefined'.

New error:
> Expected '<original-url>' to be redirected to '<expected-url>', but it
> was not redirected.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas 760e741a47 build(docs-infra): enable linting for deploy-to-firebase scripts (#43963)
This commit enables linting for the scripts in
`aio/scripts/deploy-to-firebase/`. It also makes the necessary changes
to the files to make linting pass.

PR Close #43963
2021-10-29 15:05:07 -07:00
George Kalpakas 491a84d0ad refactor(docs-infra): move deploy-to-firebase.js into a dedicated directory (#43963)
This commit moves the `aio/scripts/deploy-to-firebase.js` script into a
new directory, `aio/scripts/deploy-to-firebase/`. This will make it
easier to break it up into multiple smaller files to better organize the
code (without polluting the `aio/scripts/` directory).

PR Close #43963
2021-10-29 15:05:07 -07:00
Jochen Kraushaar 25959f9e14 docs(common): describe behavior when reference changes (#42863)
PR Close #42863
2021-10-28 11:34:24 -07:00
vthinkxie 8f402c9d06 fix(core): support InjectFlags argument in NodeInjector.get() (#41592)
The `InjectFlags` argument was defined for both `getOrCreateInjectable()` and `Injector`, but was ignored in `NodeInjector`.
This PR adds support for getting parent token via `NodeInjector.get()`.

close #31776

PR Close #41592
2021-10-28 11:20:00 -07:00
Jessica Janiuk 515ba60b6f release: cut the v12.2.12 release (#43966) 2021-10-27 11:19:33 -07:00
Mladen Jakovljević 7af9900c35 fix(docs-infra): fix heritage links (#43956)
Fix incorrect escape of special characters when rendering member heritage docs. Example: DefaultIterableDiffer docs incorrectly renders what this class implements - it does not fully display generic types of implemented interfaces.

PR Close #43956
2021-10-27 16:13:35 +00:00
Virginia Dooley 515949e7e6 docs: review tag added (#43465)
PR Close #43465
2021-10-27 16:13:02 +00:00
Virginia Dooley dec1ebf56d docs: reviewed tag added (#43487)
PR Close #43487
2021-10-26 23:57:44 +00:00
Jessica Janiuk e25ebb6058 Revert "fix(compiler-cli): avoid broken references in .d.ts files due to @internal markers" (#43961)
This reverts commit 69821fcef6.

PR Close #43961
2021-10-26 23:51:22 +00:00
Jessica Janiuk 728926412d Revert "refactor(compiler-cli): extract error documentation base url into separate file" (#43961)
This reverts commit bd5acf60f2.

PR Close #43961
2021-10-26 23:51:22 +00:00
Jessica Janiuk 2d9d270ed8 Revert "fixup! refactor(compiler-cli): extract error documentation base url into separate file" (#43961)
This reverts commit 3d82d566d2.

PR Close #43961
2021-10-26 23:51:21 +00:00
Virginia Dooley 52c37eab9b docs: reviewed tag added (#43488)
PR Close #43488
2021-10-26 22:57:20 +00:00
Joey Perrott 8fcfd87d99 ci: update commit-message-based-labels job to be called labels (#43944)
Using the job name labels results in a more readable and better looking Github status.

PR Close #43944
2021-10-26 20:20:04 +00:00
Joey Perrott ea6667cadc build: create issue selector configuration (#43923)
Create a configuration file to set up the new issue selector page.

PR Close #43923
2021-10-26 20:19:06 +00:00
JoostK bf59401473 refactor(compiler-cli): extract error documentation base url into separate file (#43527)
Prior refactorings caused unexpected g3 sync issues due to a patch that
changes the error documentation URL. This commit moves the base url into
a separate file to make this more apparent.

PR Close #43527
2021-10-26 18:22:33 +00:00
JoostK 112557497c fix(compiler-cli): avoid broken references in .d.ts files due to @internal markers (#43527)
The `ErrorCode` enum in the `error_code.ts` file is governed by public
api guards but the other top-level exports from that file are exempt
from public api documentation and are therefore marked as `@internal`.
However, TypeScript is configured with the `stripInternal` compiler
option such that declarations with `@internal` markers are not emitted
into the `.d.ts` files, but this means that the reexports in the barrel
file end up referring to missing declarations.

The `stripInternal` option is considered internal and its documentation
states to use at your own risk (as per https://github.com/microsoft/TypeScript/issues/45307).
Having the option enabled is desirable for us as it works well for
hiding class fields that are marked `@internal`, which is an effective
way to hide members from the .d.ts file. As a workaround for the issue
with top-level symbols, the declarations with `@internal` markers are
moved to dedicated files for which no public api guard is setup,
therefore allowing their `@internal` markers to be dropped.

Fixes #43097

PR Close #43527
2021-10-26 18:22:33 +00:00
dirk diebel 5f32863a74 docs(docs-infra): change deprecated keyboardEvent.keyCode example to use keyboardEvent.code (#43934)
PR Close #43934
2021-10-26 00:05:23 +00:00
amayer42 5e482c4f0c docs(localize): fix spelling of documentation link (#43941)
Fixes the spelling of 'i18n' in a documentation link.
PR Close #43941
2021-10-25 22:05:17 +00:00
Andrew Kushnir c831c67c00 test(platform-browser): complete component bootstrap before switching to the next test (#43933)
The bootstrap tests that reused the same component (the `HelloRootCmp` one) were randomly failing due to the incomplete cleanup between tests. This commit ensures that the component bootstrap is fully cimpleted and there are no pending async actions before going to the next test.

PR Close #43933
2021-10-25 17:58:26 +00:00
George Kalpakas 067ae54d46 fix(ngcc): support alternate UMD layout when adding new imports (#43931)
In #43879, `UmdReflectionHost` was updated to deal with the new UMD
format used by Rollup, where the parenthesis is around the wrapper
function and not the wrapper function call.
For reference, this caused failures in the `ngcc-validation` repo
([example 1][1], [example 2][2]).

This commit updates `UmdRenderingFormatter` to also handle both UMD
formats. In order to validate the change, this commit also updates the
`UmdRenderingFormatter` tests to run against both UMD formats.

[1]: https://circleci.com/gh/angular/ngcc-validation/65916
[2]: https://circleci.com/gh/angular/ngcc-validation/65758

PR Close #43931
2021-10-25 17:56:27 +00:00
ericcheng2005 7817892684 refactor(core): made comment structure consistent in index.ts (#43684)
changed second big block of comments to use multi-line comment structure instead of multiple single-line comments

PR Close #43684
2021-10-21 18:39:59 +00:00
ericcheng2005 9a12530685 docs: added commas to sentences in .vscode/README.md (#43684)
PR Close #43684
2021-10-21 18:39:59 +00:00
ericcheng2005 78d94c1fb5 docs: fixed minor grammar mistakes in CONTRIBUTING (#43684)
PR Close #43684
2021-10-21 18:39:59 +00:00
Alan Agius cef01b804a ci: update angular/dev-infra/github-actions sha (#43904)
Consume latest version of `angular/dev-infra/github-actions`.

PR Close #43904
2021-10-21 16:26:35 +00:00
Alan Agius 718814c6ae ci: replace breaking-changes-label with commit-message-based-labels (#43904)
See: https://github.com/angular/dev-infra/pull/269 for more context

PR Close #43904
2021-10-21 16:26:35 +00:00
George Kalpakas e09556fe2b refactor(service-worker): avoid unnecessary writes to cache when version fails (#43680)
When an app version is detected as broken, the SW calls the
`Driver#versionFailed()` method. Previously, this method would in turn
call the `Driver#sync()` method, which writes some metadata about the
SW's state to the `ngsw:/:db:contol` cache. More specifically,
`Driver#sync()` persists info about all known app versions, which one is
the latest and also what version each client is assigned to.

However, no relevant info is changed inside `Driver#versionFailed()`, so
the call to `Driver#sync()` is redundant (since there are no changes
that need to be synced with the cache). This is a left-over from
before #43518, when `Driver#versionFailed()` used to update version
assignments and thus did require synchronization with the cache.

This commit removes the redundant `Driver#sync()` call to avoid an
unnecessary write to the cache.

PR Close #43680
2021-10-21 14:20:51 +00:00
Andrew Kushnir d10f143b1a release: cut the v12.2.11 release (#43909) 2021-10-20 09:42:14 -07:00
Andrew Kushnir 9f350a8473 ci: update payload size limit (#43885)
This commit updates the payload size limit for one of the test apps.

PR Close #43885
2021-10-18 17:14:53 -07:00
Pete Bacon Darwin cab21cea7a fix(ngcc): support alternate wrapper function layout for UMD (#43879)
Recently rollup, used by ng-packagr, changed the position of parentheses
around its generated UMD wrapper functions.

This commit ensures that ngcc can handle both.

Fixes #43870

PR Close #43879
2021-10-18 14:57:01 -07:00
Andrew Kushnir 242a09998a Revert "fix(compiler): support i18n interpolated only attribute bindings (#43815)" (#43882)
This reverts commit bba0a87055.

The reason for rollback: this change is breaking some targets in Google's codebase when there is no attribute value is displayed (attr.aria-label) when translated.

PR Close #43882
2021-10-18 13:15:59 -07:00
George Kalpakas e88ab20119 docs: fix a couple of random typos (#43878)
PR Close #43878
2021-10-18 10:41:33 -07:00
Andrew Scott 58c11865ac fix(router): Do not clear currentNavigation if already set to next one (#43852)
Experimentation with the Router URL management exposed a situation where
the `currentNavigation` was being cleared in the `finalize` after the
`currentNavigation` was already set to the next one.

This change ensures that the `currentNavigation` is only cleared if the
id of the finalized transition matches the one on the
`currentNavigation` object.

PR Close #43852
2021-10-18 10:30:52 -07:00
David Shevitz 39636834be docs: update getting started links to provide a more consistent user experience (#43872)
PR Close #43872
2021-10-18 09:25:34 -07:00
Pete Bacon Darwin b9c885b960 fix(compiler): support i18n interpolated only attribute bindings (#43815)
While fully dynamic bound properties (and attributes) cannot be marked for localization, properties that only contain interpolation can.

This commit ensure that attribute bindings that only contain interpolation can also be marked for localization.

Closes #43260

PR Close #43815
2021-10-18 09:24:41 -07:00
dario-piotrowicz 1315f635ea fix(docs-infra): add paddings to docs-card titles (#43859)
improve the aio docs-card title by adding some padding
so that it doesn't get too close to the card's edges

PR Close #43859
2021-10-18 09:23:17 -07:00
dario-piotrowicz 48c20141fb fix(docs-infra): move security anchors outside callout elements (#43865)
two callout elements in the security guide have anchors
as their first child element instead of the callout's header
causing ugly/unwanted spacing, move the anchors above the
callout elements to fix such issue

PR Close #43865
2021-10-18 09:22:37 -07:00
Pete Bacon Darwin ead2f1db3e build(docs-infra): add a box around CLI command line reference syntax (#43850)
This commit helps to make the section that describes an overview of the syntax of a CLI command stand out from the surrounding text.

Closes #26574

PR Close #43850
2021-10-15 11:35:45 -07:00
Younes Jaaidi a255e6c792 docs: add younes jaaidi to GDE resources (#43721)
PR Close #43721
2021-10-15 10:49:24 -07:00
dario-piotrowicz 278db4a4f1 fix(docs-infra): apply minor style fixes to aio contributor cards (#43844)
improve the aio contributors card by aligning centrally the
contributor's name and adding some padding so that it doesn't
get too close to the card's edges

Note: the name's aligning was already present by wrongly removed in
PR #43355

PR Close #43844
2021-10-15 10:12:57 -07:00
Joe Martin (Crowdstaffing) 6cc6036fb6 docs: internationalization topics (#43819)
Update links and code-examples.  Remove redundant comments.

PR Close #43819
2021-10-14 15:53:25 -07:00
Alan Agius 65c37f46c7 docs: add missing value types to optimization configuration (#43839)
It appears that when the tables were changed from HTML to markdown some value types were lost. With this change we add the missing types and remove the commented out HTML content.

PR Close #43839
2021-10-14 10:01:55 -07:00
Natalia Venditto 2d85000c5a docs: add natalia venditto to GDE resources (#43825)
PR Close #43825
2021-10-14 10:00:01 -07:00
Andrew Scott c7c285cec7 release: cut the v12.2.10 release (#43826) 2021-10-13 10:59:37 -07:00
dario-piotrowicz 2a5eb8e7a0 refactor(docs-infra): remove unnecessary tsconfig.json file (#43818)
the tsconfig.json file in aio/content/examples does not seem necessary
anymore as it was only used for tslinting and tslint has been removed
from the examples in PR #43592 and PR #43746

PR Close #43818
2021-10-13 16:51:10 +00:00
dario-piotrowicz d050b57478 docs(core): apply minor improvements to the InjectionToken's api docs (#43693)
PR Close #43693
2021-10-13 16:46:27 +00:00
Joe Martin (Crowdstaffing) 7878a6e987 docs: update internationalization topics (#43722)
Add new $localize and Ivy content.  Clean up navigation.

PR Close #43722
2021-10-12 21:38:38 +00:00
dario-piotrowicz fced3e88cf docs(animations): fix wrong code links present in the animations guide (#43787)
fix the links present in the animations guide under td elements written as
`<code>[text](link)()</code>` which are not rendered properly

Note:
  - the bug was introduced in PR #42885
  - the bug is only present for code blocks inside html block elements,
    the aforementioned format can be used in the inline html elements without issues

PR Close #43787
2021-10-12 17:47:59 +00:00
mgechev e907ad728d docs: update ngUpgrade support message (#43704)
PR Close #43704
2021-10-12 17:46:15 +00:00
Alan Agius c1586a1360 docs: update how to remove a configuration item (#43795)
To remove a configuration item, `undefined` needs to be used as value.
PR Close #43795
2021-10-12 17:44:55 +00:00
Alan Agius 9e2af9da2e docs: update config path in per user tracking section (#43795)
`cli.analyticsSharing.user` is not a valid config path. `cli.analyticsSharing.uuid` is the correct one.

Partially addresses https://github.com/angular/angular-cli/issues/21916

PR Close #43795
2021-10-12 17:44:55 +00:00
David Shevitz 12fa7dce93 docs: add redirect from angular.io/guide to angular.io/docs (#43341)
PR Close #43341
2021-10-12 17:41:48 +00:00
Daniel Díaz 82b4a1dec0 docs: fix typo in hierarchical injectors file (#43652)
PR Close #43652
2021-10-12 17:41:25 +00:00
Thomas Turrell-Croft 95b93e40da docs: Formalize language describing HttpClient (#43778)
PR Close #43778
2021-10-11 16:43:15 +00:00
Tanguy Nodet 7bd0d5f0ee docs: add missing declaration of CartComponent in tutorial (#43774)
PR Close #43774
2021-10-11 16:42:35 +00:00
dario-piotrowicz dbc17be3e2 refactor(docs-infra): remove linting from i18n example angular.json (#43747)
remove linting from the i18n angular.json example as that is no longer
present in the boilerplace angular.json (and the two should be kept in
sync)

note: the linting was removed from the boilerplate angular.json file in PR #43592

PR Close #43747
2021-10-08 20:42:00 +00:00
Doug Parker 08c4a269de docs: update CSP section to mention Angular's minimum requirements (#43553)
Closes angular/angular-cli#21711.
Refs #6361, #37631.

PR Close #43553
2021-10-08 20:40:53 +00:00
George Kalpakas 8b33232215 fix(docs-infra): ensure SwUpdatesService is instantiated (#43766)
In 305d05545a, we accidentally stopped
instantiating the `SwUpdatesService` service, which meant that we were
no longer subscribing to ServiceWorker update events and proactively
checking for updates. We would still gets updates, because the
ServiceWorker automatically checks on each navigation request and when a
new ServiceWorker instance is created, but we would not proactively
fetch updates and also miss `unrecoverable` errors.

This commit fixes this by exposing an `enable()` method from
`SwUpdatesService`, which has to be explicitly called for the service to
be enabled, and ensures that the method is called when `AppComponent` is
initialized.
The commit also gets rid of the `SwUpdatesModule` (whose only purpose
was to provide `SwUpdatesService`) in favor of using `providedIn`.

Fixes #43695

PR Close #43766
2021-10-08 20:39:45 +00:00
markostanimirovic d1b5692df3 docs: fix forms in template examples (#43772)
PR Close #43772
2021-10-08 20:39:12 +00:00
hchiam d35447d06a docs(docs-infra): fix a11y of external links (#43725)
prevent screen readers from falsely announcing "open_in_new" since they may not actually open new tabs/windows but simply send the current page to a domain outside angular.io

Fixes #43512

PR Close #43725
2021-10-07 20:55:24 +00:00
Dylan Hunn ca3b552af2 release: cut the v12.2.9 release (#43749)
PR Close #43749
2021-10-06 15:47:55 -07:00
dario-piotrowicz a0cf71717b fix(docs-infra): convert button-like elements to actual buttons (#43601)
some elements in the aio application are anchors or divs but behave
like buttons, it is semantically (and a11y) more correct to convert
them to actual button elements instead

PR Close #43601
2021-10-06 09:22:05 -07:00
Kristiyan Kostadinov df7fd87084 refactor(language-service): fix typo in method name (#43698)
The `fineRenameLocations` method should be called `findRenameLocations`.

PR Close #43698
2021-10-06 09:21:34 -07:00
Pete Bacon Darwin c9e21d080f build(docs-infra): ensure all overloads are shown in interfaces (#43734)
In the API docs, concrete classes do not list the "implementation" overload on a method, since this is not strictly part of its API.

We recently fixed the rendering of interfaces to display all the overloads, since there is no "implementation" overload.

This commit also fixes the rendering of "pseudo-classes", which are a combination of an interface
and a constant.

Fixes #43001

PR Close #43734
2021-10-06 09:21:09 -07:00
Alan Agius f45c692dd9 ci: change ownership of goldens/public-api/manage.js (#43664)
With this change we change ownership of `goldens/public-api/manage.js` from `public-api` to `dev-infra`. This file is a script to manage public-api golden files and therefore it should fall under the dev-infra umbrella.

PR Close #43664
2021-10-05 13:36:37 -07:00
George Kalpakas c4ecc07838 fix(service-worker): make ngsw.json generation deterministic and correct (#43679)
Previously, all asset-groups from `ngsw-config.json` were processed in
parallel. For each asset-group, we retrieved all files for the current
build, filtered out files that were already matched by other
asset-groups, determined which of the remaining files belonged to the
current asset-group and generated entries for the `ngsw.json` manifest.
This process was susceptible to race conditions when there were files
that would be matched by multiple asset-groups. This made the generation
of the `ngsw.json` manifest non-deterministic and violated the rule that
each file would belong to the first asset-group that matched it (based
on the asset-groups' order of appearance in `ngsw-config.json`), thus
leading to broken ServiceWorker behavior.

This commit fixes it by ensuring that the generation process is
deterministic and that asset-groups are processed in the proper order.

NOTE 1:
The generation process has been broken since the beginning, but we have
only noticed this recently. This is possibly related to the CLI's
switching from a virtual file system host (which has more consistent
timing characteristics) to the Node.js built-in `fs.promises` in
angular/angular-cli@d3bc530c10.

NOTE 2:
This commit also ensures that files in the `ngsw.json` hash-table are in
alphabetic order. Previously, the files were added to the hash-table in
blocks corresponding to each asset-group.
This change is not necessary (i.e. the order of keys in the hash-table
makes no difference in behavior), but it makes it easier to scan for a
file (for example, for debugging purposes).

PR Close #43679
2021-10-05 13:34:31 -07:00
George Kalpakas 307da62cd9 build(docs-infra): ensure ngsw.json generation is correct and deterministic (#43687)
As explained in #43679, currently the generation of the `ngsw.json` SW
manifest is non-deterministic and often incorrect. Until we can update
to an `@angular/service-worker` version that includes the fix from
PR #43679, we temporarily work-around the issue by re-generating the
`ngsw.json` manifest after `ng build` using the `ngsw-config` binary
exposed by `@angular/service-worker`.

NOTE:
This works around the issue, because the [FileSystem][1] class used by
the `ngsw-config` binary happens to be synchronous (unlike the
implementation provided by the Angular CLI), thus avoiding the race
conditions described in #43679.

[1]: https://github.com/angular/angular/blob/c721135e370b34c840756bcfb22c8119b4c8c452/packages/service-worker/cli/filesystem.ts#L15

PR Close #43687
2021-10-05 09:49:15 -07:00
George Kalpakas fb29da27cb build(docs-infra): update Angular Material to version 12.2.8 (#43687)
This commit updates angular.io to the latest stable version of Angular
CDK/Material (v12.2.8).

NOTE:
The payload size changes in styles are not entriely caused by this
commit, since the limits where outdated. The actual size changes caused
by this commit are ~100B per theme:
- `light-theme`: 79217 --> 79320
- `dark-theme`:  79116 --> 79216

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 087c37cc5c build(docs-infra): update Angular framework to version 12.2.8 (#43687)
This commit updates angular.io to the latest stable version of the
Angular framework (v12.2.8). Among other benefits, this version also
includes the ServiceWorker fix from #43518, which fixes #28114.

NOTE:
This commit also makes the necessary changes to more closely align
angular.io with new apps created with the latest stable Angular CLI.

Fixes #28114

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 04372247b6 refactor(docs-infra): prefix error messages with Angular version info (#43687)
Prefix error messages with the Angular version currently used in the
angular.io app. This applies to both errors logged to the console and
reported to Google Analytics and makes debugging certain errors easier.

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 5344dfecfe build(docs-infra): use $schema in ngsw-config.template.json to provide intellisense (#43687)
Add an appropriate `$schema` property in `ngsw-config.template.json` to
allow IDEs to provide intellisense about the various fields of the
config.

PR Close #43687
2021-10-05 09:49:14 -07:00
Wey-Han Liaw 7f6050587d fix(router): unset attachRef when router-outlet is destroyed to avoid mounting a destroyed component (#43697)
Previously, when a router-outlet is conditionally shown with an ngIf, and a sub-route was re-attached
via a custom RouteReuseStrategy, router-outlet would try to mount a destroyed component into the view
if the router-outlet is destroyed and re-initialized.

This commit fixes it by unsetting context.attachRef when router-outlet is destroyed, so when the
router-outlet is being initialized again, it no longer sees an attachRef that it needs to mount to the
view.

Fixes #43696

PR Close #43697
2021-10-05 09:48:41 -07:00
dario-piotrowicz 7bc46a877d fix(docs-infra): amend color of code links inside single anchors (#43586)
when some auto code links fail to happen they can be added manually
with the md ``[`code text`](link)``, these generate anchor elements which
contain a code element, such code element does not get the correct text
color, this commit fixes such issue

PR Close #43586
2021-10-04 16:31:17 -07:00
iRealNirmal dc885ebae4 docs: move angular-compiler-options tsconfig snippets to external file (#43545)
Moving angular-compiler-options docs inline code to external file of tsconfig.json and tsconfig.app.json.

closes #43336

PR Close #43545
2021-10-04 10:55:05 -07:00
ultrasonicsoft 12c1b9fcc5 docs: add balram chavan to GDE resources (#43658)
PR Close #43658
2021-10-04 10:53:59 -07:00
mgechev 04f2fd6d15 docs: add developer survey 2021 (#43670)
PR Close #43670
2021-10-04 10:24:59 -07:00
JoostK b4b441077a fix(core): handle invalid constructor parameters in partial factory declarations (#43619)
This commit fixes an oversight in the JIT compilation of partial factory
declarations, where the literal `'invalid'` was not accounted for
(unlike the AOT linker).

Fixes #43609

PR Close #43619
2021-10-01 12:24:31 -04:00
Daniel Díaz 75f74ded5f docs: fix typo in AOT compiler (#43640)
PR Close #43640
2021-10-01 12:24:01 -04:00
little-pinecone 74f71b483f docs: add button type in form array example (#43666)
add a button type in the example of creating a dynamic form so that the button that adds the alias control does not submit the entire form

PR Close #43666
2021-10-01 12:23:10 -04:00
George Kalpakas f3b2c717e5 docs: update commit message guidelines to reflect current requirements (#43650)
Update the commit message guidelines in `CONTRIBUTING.md` to reflect
recent changes in our dev-infra tooling:
- Remove the mention of the 100 chars/line limit, since that is
  [no longer in effect][1].
- Mention Deprecation sections:
  According to our [Deprecation practices][2], we should document
  deprecations in the Changelog, which our tooling supports via
  [DEPRECATED][3] sections in commit messages. Yet this was not
  mentioned in the commit message guidelines.

[1]: https://github.com/angular/angular/blob/a07cb097e9124738880f7978658a2972d25b892e/.ng-dev/commit-message.ts#L7
[2]: https://angular.io/guide/releases#deprecation-practices
[3]: https://github.com/angular/dev-infra/blob/b51360a7cc39cb3deb5ae1bf0bfb121fe7ee0a4e/ng-dev/commit-message/parse.ts#L77

PR Close #43650
2021-10-01 08:55:02 -07:00
xiaohanxu-nick fa0c57bc21 docs: fix missing step in get started example (#43646)
PR Close #43646
2021-10-01 08:46:02 -07:00
dario-piotrowicz c13f7cd1c3 docs: disable erroneous "browser" code links (#43554)
fix the keyword "browser" present in code segments being incorrectly
generated as a link to "api/animations/browser" by applying the
no-auto-link class

PR Close #43554
2021-10-01 08:36:08 -07:00
dario-piotrowicz 7a6cd8866a docs(animations): improve the aio animations introduction (#42885)
improve slightly the angular.io animation introduction guide, such
improvement are styling, information and clarity related

PR Close #42885
2021-10-01 08:34:20 -07:00
Alex Rickabaugh d6679e2969 release: cut the v12.2.8 release (#43654)
PR Close #43654
2021-09-30 13:02:15 -07:00
Alex Rickabaugh ca6bcb7d66 Revert "fix(language-service): provide dom event completions (#43299)"
This reverts commit c8f8d7d3b1.

This commit breaks in IE11, which is still supported by v12, likely due to
the usage of `Array.from()`.
2021-09-30 10:15:56 -07:00
Andrew Scott ca0f057491 test(router): refactor tests to not use deprecated loadChildren (#43578)
Many of the tests in the router code use the deprecated loadChildren as a string. This
has been deprecated for years and can easily be changed to just a function that
returns the module.

PR Close #43578
2021-09-29 11:14:09 -07:00
Chris e3e424e7ca docs: clarify description of :host and :host-context selectors (#41332)
Fixes #39466

PR Close #41332
2021-09-29 10:00:07 -07:00
Daniel Díaz 7a68cd75f2 docs: fix typo in observables file (#43630)
PR Close #43630
2021-09-29 09:59:39 -07:00
Pete Bacon Darwin 59ad3997bc build(docs-infra): ensure all overloads are shown in interfaces (#43614)
In the API docs, concrete classes do not list the "implementation" overload on a method, since this is not strictly part of its API.
There is already a special case for abstract methods that do not have such an implementation overload.

But we were missing the case where the method was part of an interface. In interfaces none of the methods have implementation overloads.

Fixes #43001

PR Close #43614
2021-09-29 09:58:48 -07:00
dario-piotrowicz 8da56d78d9 docs: amend wrong links to async pipe (#43576)
PR Close #43576
2021-09-29 09:57:59 -07:00
Raj Sekhar c9cbe6e7d8 docs: fix broken link to measure performance (#43628)
* "Chrome DevTools Network Performance page" was pointing to a broken link, that was giving 404 error
* The new link points to the right article where it explains the resource timing & network analysis
PR Close #43628
2021-09-28 14:43:47 -07:00
Bobby Galli cfca3d0a5e docs: fix typos in .vscode/README.md (#43621)
PR Close #43621
2021-09-28 14:28:15 -07:00
wszgrcy c1338bf837 fix(compiler-cli): correctly interpret token arrays in @Injectable deps (#43226)
When specifying the `deps` array in the `@Injectable` decorator to
inject dependencies into the injectable's factory function, it should
be possible to use an array literal to configure how the dependency
should be resolved by the DI system.

For example, the following example is allowed:

```ts
@Injectable({
  providedIn: 'root',
  useFactory: a => new AppService(a),
  deps: [[new Optional(), 'a']],
})
export class AppService {
  constructor(a) {}
}
```

Here, the `'a'` string token should be injected as optional. However,
the AOT compiler incorrectly used the array literal itself as injection
token, resulting in a failure at runtime. Only if the token were to be
provided using `[new Optional(), new Inject('a')]` would it work
correctly.

This commit fixes the issue by using the last non-decorator in the
array literal as the token value, instead of the array literal itself.

Note that this is a loose interpretation of array literals: if a token
is omitted from the array literal then the array literal itself is used
as token, but any decorator such as `new Optional()` would still have
been applied. When there's multiple tokens in the list then only the
last one will be used as actual token, any prior tokens are silently
ignored. This behavior mirrors the JIT interpretation so is kept as is
for now, but may benefit from some stricter checking and better error
reporting in the future.

Fixes #42987

PR Close #43226
2021-09-28 14:15:49 -07:00
Ricardo Chavarria 4cc9c397dc docs: Add Ricardo Chavarria to GDE resources (#43571)
update size image
update preview
docs: replace an avatar with smaller size
Change order


PR Close #43571
2021-09-27 14:25:57 -07:00
JoostK 69299f7d4d fix(ngcc): do not fail for packages which correspond with Object members (#43589)
Prior to this commit ngcc stored its package configuration in JavaScript
objects, which caused the builtin `Object` members to be found as
package configuration. This would subsequently crash as their shape was
not as expected.

This commit moves away from using raw JavaScript objects in favor of a
Map. To code was refactored such that `PartiallyProcessedConfig` is
now a class.

Fixes #43570

PR Close #43589
2021-09-27 14:21:54 -07:00
Adrien Crivelli 9d3c2d517d docs(router): params or queryParams are not advised against (#43562)
According to @atscott:

> We no longer speculate about future deprecations. There are no current plans to remove
> `params` or `queryParams` and there's no benefit to advising against their use.

PR Close #43562
2021-09-27 14:21:11 -07:00
Rafael Santana a8e84f6920 docs: close tags properly (#43610)
PR Close #43610
2021-09-27 10:54:56 -07:00
enisfr dac84dd9e1 docs: links added for each builder schema (#43564)
closes #43542

Signed-off-by: enisfr <enisfurkane@gmail.com>

docs: links pointed to the schema files.

closes angular#43542

docs: tslint removed.

closes angular#43542

docs: typo.

closes angular#43542

PR Close #43564
2021-09-27 10:51:49 -07:00
Andrew Scott c8f8d7d3b1 fix(language-service): provide dom event completions (#43299)
Native DOM events were previously not included in the completions
because the dom schema registry would filter out events completely. This
change updates the registry to include events in the private
element->property map and excludes events from lookups outside of the
new `allKnownEventsOfElement` function.

fixes https://github.com/angular/vscode-ng-language-service/issues/1479

PR Close #43299
2021-09-27 10:45:59 -07:00
Teri Glover 28b7f79a63 docs: Edits to remove jargon (#43000)
PR Close #43000
2021-09-27 10:44:22 -07:00
George Kalpakas cadef4caa8 ci: correctly handle commit message with carriage returns in payload-size.sh (#43569)
Previously, if a commit message contained a carriage return in its
header, the `payload-size.sh` script would fail to upload the payload
size data to Firebase, because the JSON payload would be messed up when
trying to concatenate the commit message headers. See an example
[here][1].

This commit avoids this problem by replacing carriage returns before
concatenating the commit message headers with the JSON payload string.

[1]: https://app.circleci.com/pipelines/github/angular/angular/37437/workflows/d0fa4adf-43bb-464e-a2fd-d87da15226dd

PR Close #43569
2021-09-24 10:56:41 -07:00
George Kalpakas 9a5086e9fe fix(docs-infra): display deprecation notes for properties (#43566)
Previously, deprecation notes for deprecated class/interface properties
were not shown in the API docs. This commit fixes it by ensuring that
deprecation notes are shown for properites (similar to how it works for
methods).

PR Close #43566
2021-09-24 10:56:05 -07:00
George Kalpakas 3cf41354ae fix(service-worker): do not unassign clients from a broken version (#43518)
Previously, when a version was found to be broken, any clients assigned
to that version were unassigned (and either assigned to the latest
version or to none if the latest version was the broken one). A version
could be considered broken for several reasons, but most often it is a
response for a hashed asset that eiher does not exist or contains
different content than the SW expects. See
https://github.com/angular/angular/issues/28114#issuecomment-923122967
for more details.

However, assigning a client to a different version (or the network) in
the middle of a session, turned out to be more risky than keeping it on
the same version. For angular.io, for example, it has led to #28114.

This commit avoids making things worse when identifying a broken version
by keeping existing clients to their assigned version (but ensuring that
no new clients are assigned to the broken version).

NOTE:
Reloading the page generates a new client ID, so it is like a new client
for the SW, even if the tab and URL are the same.

PR Close #43518
2021-09-24 10:54:22 -07:00
George Kalpakas 70b194abe3 test(service-worker): use correct assertion in tests (#43518)
Previously, a ServiceWorker test was using the
`MockServerState#sawRequestFor()` method. This method, however, only
returns a boolean indicating whether a request had been seen, but would
not throw an error in either case.

Since the intention was to assert that a specific request was made, this
commit switches to the correct `MockServerState#assertSawRequestFor()`
method.

PR Close #43518
2021-09-24 10:54:22 -07:00
Virginia Dooley d585c78ab3 docs: reviewed tag added (#43472)
PR Close #43472
2021-09-24 10:51:40 -07:00
Virginia Dooley 62e982d7e0 docs: review tag added (#43469)
PR Close #43469
2021-09-24 10:50:21 -07:00
Joe Martin (Crowdstaffing) 1c7545559d docs: update review date (#43245)
docs: Update review date for last content update.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 406abf2372 docs: add subtopics for internationalization (#43245)
Add subtopics for internationalization guide.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 579b05a43c docs: update content (#43245)
Update content per review.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 035b3f7ddb docs: update punctuation (#43245)
Update punctuation per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 2dfe4ecda5 docs: update content (#43245)
Update content per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 38ba02cbdc docs: update link (#43245)
Update link per review.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 3609f90899 docs: update content (#43245)
Update content per review.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 73a5b9e8ed docs: update punctuation (#43245)
Update punctuation per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) 719f2b11a8 docs: update grammar (#43245)
Update grammar per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) ee98c134c0 docs: update content (#43245)
Update content per review.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) 5922763786 docs: update spelling (#43245)
Update spelling per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) c3f8ee35b8 docs: add new internationalization links (#43245)
Update link for subtopics of internationalization guide.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) 0cf60a8f72 docs: add new internationalization links (#43245)
Update link for subtopics of internationalization guide. Clean up markdown.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) ffe4b90c36 docs: add subtopics for internationalization to PR (#43245)
Add subtopics for internationalization guide to PR.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) 6cbb79c421 docs: add redirect for internationalization (#43245)
Add redirect for internationalization guide. Add test for redirect.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) a03b8e42d7 docs: add subtopics for internationalization to toc (#43245)
Add subtopics for internationalization guide to toc.

PR Close #43245
2021-09-23 15:40:35 -07:00
Joe Martin (Crowdstaffing) 587091d993 docs: add subtopics for internationalization (#43245)
Add subtopics for internationalization guide.

PR Close #43245
2021-09-23 15:40:35 -07:00
Daniel Díaz 2306a3250f docs(router): fix typo in router event API documentation (#43555)
PR Close #43555
2021-09-23 14:45:28 -07:00
Dario Piotrowicz e9beccb672 docs: fix typo in dynamic forms page (#43543)
resolves #43536
PR Close #43543
2021-09-23 14:43:35 -07:00
Teri Glover 85a0cb3082 docs: Edits to remove jargon (#43023)
PR Close #43023
2021-09-23 14:41:17 -07:00
Teri Glover 54050e5927 docs: Edits to remove jargon (#42965)
PR Close #42965
2021-09-23 14:35:54 -07:00
Teri Glover e9e85919bf docs: Edits to remove jargon (#42950)
PR Close #42950
2021-09-23 14:35:22 -07:00
Teri Glover 9bd6fd62ff docs: Edits to remove jargon (#42904)
PR Close #42904
2021-09-23 14:34:42 -07:00
Teri Glover 6e109c7323 docs: amend links in content-projection guide (#43009) (#42904)
PR Close #43009

PR Close #42904
2021-09-23 14:34:42 -07:00
Teri Glover 1849ed1631 docs: Edits to remove jargon (#42904)
PR Close #42904
2021-09-23 14:34:42 -07:00
Teri Glover 0201593c66 docs: Edits to remove jargon (#42904)
PR Close #42904
2021-09-23 14:34:42 -07:00
Jessica Janiuk dad213e8c7 release: cut the v12.2.7 release (#43537) 2021-09-22 11:58:36 -07:00
dario-piotrowicz 19c61bf859 docs(service-worker): improve service worker guides (#43508)
improve slightly the angular.io guides related to service workers, by
means of fixes, styling, information and clarity changes

PR Close #43508
2021-09-22 17:48:39 +00:00
George Kalpakas d5881329cd build(docs-infra): upgrade cli command docs sources to eb7fba335 (#43533)
Updating [angular#12.2.x](https://github.com/angular/angular/tree/12.2.x) from
[cli-builds#12.2.x](https://github.com/angular/cli-builds/tree/12.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/56c5962df...eb7fba335):

**Modified**
- help/new.json

PR Close #43533
2021-09-22 16:56:54 +00:00
Daniel Díaz 9b7cdaefe8 docs(http): get rid of not needed space at the end of the sentence (#43528)
PR Close #43528
2021-09-22 16:18:08 +00:00
Xiaohanxu1996 1e03bed706 docs: remove duplicate import from @angular/core (#43530)
PR Close #43530
2021-09-22 16:16:05 +00:00
Andrew Scott c73e000243 test(compiler-cli): rename test files to be more descriptive (#43419)
The test files simply named `spec.ts` are hard to find when searching
for files by name.

PR Close #43419
2021-09-22 16:01:57 +00:00
Andrew Scott 9bd17e8c55 refactor(compiler-cli): Add test to document use-case for invalid pipe argument nullish coallesce (#43419)
Adds a test to the nullish coalescing diagnostic check to serve as
self-documentation on how it works with nullish coalescing on pipes that
are often misconfigured.

This also removes that non null assertion operator, which is incorrect
because there _are_ situations where a symbol cannot be retrieved.

PR Close #43419
2021-09-22 16:01:57 +00:00
George Kalpakas 3cc8c7ee25 fix(docs-infra): add a "skip to content" link for better accessibility (#43460)
Add a link at the top of the page that allows skipping directly to the
main content area. This allows people using assistive technologies to
skip navigation-related parts of the page which are presented before the
main content.

Related resources:
- [www.w3.org](https://www.w3.org/TR/WCAG20-TECHS/G1.html)
- [accessibility.oit.ncsu.edu](https://accessibility.oit.ncsu.edu/it-accessibility-at-nc-state/developers/accessibility-handbook/mouse-and-keyboard-events/skip-to-main-content)
- [css-tricks.com](https://css-tricks.com/how-to-create-a-skip-to-content-link)

---
Example implementations on other websites:

- **[accessibility.oit.ncsu.edu](https://accessibility.oit.ncsu.edu/)**:
  ![accessibility.oit.ncsu.edu](https://user-images.githubusercontent.com/8604205/133285834-db1314e6-ff71-4862-8f80-c8a9f69083d9.png)

- **[smile.amazon.com](https://smile.amazon.com/)**:
  ![smile.amazon.com](https://user-images.githubusercontent.com/8604205/133285854-1163e733-8de3-4244-bc23-5cd5a943001d.png)

- **[chase.com](https://chase.com/)**:
  ![chase.com](https://user-images.githubusercontent.com/8604205/133293396-ade9d95f-56ce-4cdc-8926-b4cd2dc6c3a5.png)

- **[css-tricks.com](https://css-tricks.com/)**:
  ![css-tricks.com](https://user-images.githubusercontent.com/8604205/133285845-702045ee-088a-40f1-bb26-21adebb02505.png)

- **[github.com/angular/angular](https://github.com/angular/angular)**:
  ![github.com/angular/angular](https://user-images.githubusercontent.com/8604205/133921259-9fd759b9-f862-47c3-b069-643912df17a1.png)

- **[news.sky.com](https://news.sky.com/)**:
  ![news.sky.com](https://user-images.githubusercontent.com/8604205/133285863-89946096-5353-4b2b-ab69-eb748bdcfe06.png)

- **[youtube.com](https://youtube.com/)**:
  ![youtube.com](https://user-images.githubusercontent.com/8604205/133921261-a68a12c1-1aea-4ad0-8457-b4eaf8ed3497.png)

---
Angular.io implementation:

- **[angular.io](https://angular.io/)**:
  ![angular.io](https://user-images.githubusercontent.com/8604205/133409634-0054625c-d14b-4ebe-bb4c-142cfc524d98.png)

Fixes #42936

PR Close #43460
2021-09-21 16:12:40 +00:00
George Kalpakas 875bbd3d4e fix(docs-infra): correctly handle in-page anchor links (#43460)
Previously, anchor links that were supposed to point to fragments inside
the current page (e.g. `href="#something"`) would end up navigating to
the homepage (`/`). This was due to them being resolved relative to the
base URL, which is set to `/` (via `<base href="/">`). See also
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base#in-page_anchors.

This commit fixes this issue by handling such links specially in
`LocationService#handleAnchorClick()` and prepending the current path to
the URL.

This will also be useful for implementing a "skip to content" link as
described in #42936.

PR Close #43460
2021-09-21 16:12:40 +00:00
George Kalpakas cea9d04330 fix(docs-infra): focus elements when scrolling to them (if focusable) (#43460)
When using `ScrollService#scrollToElement()` to scroll to a specific
element, also focus the element if it is focusable (i.e. if it has a
`focus()` method).

This will be useful for implementing a "skip to content" link as
described in #42936.

PR Close #43460
2021-09-21 16:12:40 +00:00
George Kalpakas b07642cf57 fix(docs-infra): improve accessibility of contributor cards (#43460)
Improve the accessibility of contributor cards (in `/about`) by making
them easier to navigate via keyboard:

- Show the (otherwise hidden) contributor info links on focus.
- Make the "View bio" link focusable via keyboard (to give a clearer
  indication that users can click to view the bio - although technically
  the click is handled by an ancestor).
- Make the flipped cards focusable via keyboard (so it is possible to
  click them to unflip).

PR Close #43460
2021-09-21 16:12:40 +00:00
George Kalpakas b9900cea7e fix(docs-infra): improve accessibility of button groups (#43460)
Improve the accessibility of button groups (such as those seen in
`/about` and `/resources` to choose between the different categories)
by making them easier to navigate via keyboard:

- Make the individual buttons focusable via keyboard.
  (Previously, they were not focusable - despite being anchor elements,
  because they were lacking an `href` attribute.)

- Give focused buttons a different style.

PR Close #43460
2021-09-21 16:12:40 +00:00
Teri Glover aa8e8db047 docs: Edits to remove jargon (#42928)
PR Close #42928
2021-09-20 22:50:59 +00:00
Teri Glover 8e283cb24c docs: Edits to remove jargon (#42918)
PR Close #42918
2021-09-20 22:50:15 +00:00
Teri Glover 859e53b465 docs: Edits to remove jargon (#42912)
PR Close #42912
2021-09-20 22:49:26 +00:00
Kristiyan Kostadinov 2bb4bf1468 fix(common): titlecase pipe incorrectly handling numbers (#43476)
Fixes that the `titlecase` pipe wasn't picking up numbers which meant that cases like `1st` would be tranformed to `1St`.

Fixes #43459.

PR Close #43476
2021-09-20 21:56:46 +00:00
JoostK defb02f11e fix(compiler-cli): handle directives that refer to a namespaced class in a type parameter bound (#43511)
The template type-checker has to emit type constructors for the
directives that are used in a template, where a type constructor's
declaration has to mirror the type parameter constraints as they were
originally declared. Therefore, the compiler analyzes whether a type
parameter constraint can be recreated, e.g. by generating imports for
any type references. Some type references cannot be recreated, in which
case the compiler has to fall back to a strategy where the type
constructor is created inline in the original source file (which comes
with a performance penalty).

There used to be an issue for type references to namespaced declarations.
The compiler is unable to emit such references such that an inline
type constructor should be used as fallback, but this did not happen.
This caused the attempt to emit the type reference to fail, as the
namespaced declaration cannot be located by the reference emitters.

This commit fixes the issue by using a stricter check to determine if a
type parameter requires an inline type constructor. The TypeScript
reflection host's `isStaticallyExported` logic was expanded to work for
any declaration instead of just classes, as e.g. type declarations can
also be referenced in a type parameter constraint.

Closes #43383

PR Close #43511
2021-09-20 19:56:32 +00:00
Virginia Dooley 2690315b3e docs: reviewed tag added (#43493)
PR Close #43493
2021-09-20 17:09:50 +00:00
Virginia Dooley 41d6f3caee docs: reviewed tag added (#43490)
PR Close #43490
2021-09-20 17:09:21 +00:00
Kristiyan Kostadinov 6ad195909c docs: fix graphic in safari (#43502)
Fixes that the "Loved by millions" graphic doesn't look correctly on Safari.

Note that this fix is somewhat repetitive, but I couldn't find a better one. These are the other things I tried:
* Setting units on the size of `#angular-logo`.
* Setting the size of `#angular-logo` inside the `style` tag.
* Setting the size with inline styles.

Fixes #43498.

PR Close #43502
2021-09-20 17:07:11 +00:00
dario-piotrowicz 020f0d3858 fix(docs-infra): improve aio contributors page responsiveness (#43355)
Improve the aio contributors page responsiveness regarding the browser's
font-size so that the page looks good regarding on font-size settings
(no cropped or cramped content)

PR Close #43355
2021-09-20 16:02:24 +00:00
Virginia Dooley 909c7060f0 docs: reviewed tag added (#43492)
PR Close #43492
2021-09-17 18:46:09 +00:00
Virginia Dooley 96cb91c5eb docs: review tag added (#43471)
PR Close #43471
2021-09-17 18:35:42 +00:00
Teri Glover 326e3796c9 docs: Edits to remove jargon (#42986)
PR Close #42986
2021-09-17 18:35:10 +00:00
Teri Glover 4e30381afd docs: Edits to remove jargon (#43017)
PR Close #43017
2021-09-17 18:10:40 +00:00
Virginia Dooley 4c9346b7be docs: reviewed tag added (#43491)
PR Close #43491
2021-09-17 17:57:56 +00:00
Mwiku 84ec3c3cb6 docs: describe your change... (#43455)
Use the --defaults option when creating the application to make CSS the default styling processor.
PR Close #43455
2021-09-17 17:54:24 +00:00
Teri Glover 5a888f1b30 docs: Edits to remove jargon (#43045)
PR Close #43045
2021-09-17 16:39:19 +00:00
Teri Glover ed235bdce9 docs: Edits to remove jargon (#42999)
PR Close #42999
2021-09-17 16:07:03 +00:00
Virginia Dooley 9231c5d513 docs: reviewed tag added (#43479)
PR Close #43479
2021-09-17 01:32:54 +00:00
Pete Bacon Darwin 05e1adba48 test(compiler): add a test for parsing multiline expressions in attributes (#43132)
This tests a scenario that was failing in an internal project.

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin 4cbeee79dd refactor(compiler): define interfaces for each lexer token (#43132)
These token interfaces will make it easier to reason about tokens in the
parser and in specs.

Previously, it was never clear what items could appear in the `parts`
array of a token given a particular `TokenType`. Now, each token interface
declares a labelled tuple for the parts, which helps to document the token
better.

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin 9c8a1f8a71 fix(compiler): include leading whitespace in source-spans of i18n messages (#43132)
Previously, the way templates were tokenized meant that we lost information
about the location of interpolations if the template contained encoded HTML
entities. This meant that the mapping back to the source interpolated strings
could be offset incorrectly.

Also, the source-span assigned to an i18n message did not include leading
whitespace. This confused the output source-mappings so that the first text
nodes of the message stopped at the first non-whitespace character.

This commit makes use of the previous refactorings, where more fine grain
information was provided in text tokens, to enable the parser to identify
the location of the interpolations in the original source more accurately.

Fixes #41034

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin 6c54a0a8a9 test(compiler): check fullStart source-span (#43132)
The tests were checking that the source-span of parsed HTML nodes were
accurate, but they were not checking the span when it includes the
"leading trivia", which are given by the `fullStart` rather than `start`
location.

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin 8ed452bbe1 refactor(compiler): expose token parts in Text nodes (#43132)
When it was tokenized, text content is split into parts that can include
interpolations and encoded entities tokens.

To make this information available to downstream processing, this commit
adds these tokens to the `Text` AST nodes, with suitable processing.

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin 50002282a6 refactor(compiler): support encoded entity tokens when lexing markup (#43132)
The lexer now splits encoded entity tokens out from text and attribute value tokens.

Previously encoded entities would be decoded and the decoded value would be
included as part of the text token of the surrounding text. Now the entities
have their own tokens. There are two scenarios: text and attribute values.

Previously the contents of `<div>Hello &amp; goodbye</div>` would be a single
TEXT token. Now it will be three tokens:

```
TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
TEXT: " goodbye"
```

Previously the attribute value in `<div title="Hello &amp; goodbye">` would be
a single text token. Now it will be three tokens:

```
ATTR_VALUE_TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
ATTR_VALUE_TEXT: " goodbye"
```

- ENCODED_ENTITY tokens have two parts: "decoded" and "encoded".
- ENCODED_ENTITY tokens are always preceded and followed by either TEXT tokens
  or ATTR_VALUE_TEXT tokens, depending upon the context, even if they represent
  an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #43132
2021-09-16 18:15:52 +00:00
Pete Bacon Darwin a40297553e refactor(compiler): support interpolation tokens when lexing markup (#43132)
The lexer now splits interpolation tokens out from text tokens.

Previously the contents of `<div>Hello, {{ name}}<div>` would be a single
text token. Now it will be three tokens:

```
TEXT: "Hello, "
INTERPOLATION: "{{", " name", "}}"
TEXT: ""
```

- INTERPOLATION tokens have three parts, "start marker", "expression"
  and "end marker".
- INTERPOLATION tokens are always preceded and followed by TEXT tokens,
  even if they represent an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #43132
2021-09-16 18:15:52 +00:00
George Kalpakas b43f21bb15 refactor(compiler): improve regular expression for stripping comments (#43456)
Previously, the regular expression used by the compiler's ShadowDOM CSS
shim to strip comments from CSS text was susceptible to [catastrophic
backtracking][1], which could lead to exponential (O(2^n)) increase in
complexity/execution time. More specifically, this would be triggered if
the processed text contained an unterminated comment with lots of
leading whitespace (i.e. `/*`, followed by lots of whitespace characters
and no closing `*/`).

Although such input is unlikely in real-world scenarios, this commit
improves the regular expression to not be susceptible to this issue.

[1]: https://www.regular-expressions.info/catastrophic.html

PR Close #43456
2021-09-16 16:50:50 +00:00
Pete Bacon Darwin a50d77c898 docs: remove http example dependency on 3rd party service (#43475)
Previously the `http` example did accessed the npmsearch.com website to demonstrate response caching.
But if this service became unavailable then the example (and its e2e tests) would fail.

This commit changes the example to use the in-memory-web-api for this lookup, which will not be affected by 3rd party outages.

The guide that references this example has been updated to avoid references to the original npm search service.

PR Close #43475
2021-09-16 15:59:05 +00:00
Teri Glover b28ddae8a8 docs: Edits to remove jargon (#43067)
PR Close #43067
2021-09-15 22:53:15 +00:00
Teri Glover c9884b612e docs: Edits to remove jargon (#43052)
PR Close #43052
2021-09-15 22:49:49 +00:00
Virginia Dooley efec149ba7 docs: review tag added (#43466)
PR Close #43466
2021-09-15 21:44:19 +00:00
kirjs adc7c56ede fix(platform-browser): improve error message for missing animation trigger (#41356)
There are two reasons why this error can be called, but only one was covered before.

Fixes #15581

PR Close #41356
2021-09-15 21:09:22 +00:00
Virginia Dooley def6315a76 docs: update reviewed tag (#43452)
PR Close #43452
2021-09-15 10:49:06 -07:00
Andrew Scott afeaf1ea13 test(router): Add tests to document expected behavior (#43450)
This is a patch port of the tests from #43449

PR Close #43450
2021-09-15 10:48:15 -07:00
dario-piotrowicz 10b16d8498 refactor(docs-infra): introduce max-len 120 eslint rule (#43439)
add the max-len rule to the aio eslintrc and fix what code
breaks such rule

PR Close #43439
2021-09-15 10:47:35 -07:00
dario-piotrowicz f08e4dba56 refactor(docs-infra): fix typos in app component (and its tests) (#43439)
fix some minor typos found in the app.component.ts and
app.component.spec.ts files

PR Close #43439
2021-09-15 10:47:35 -07:00
Pete Bacon Darwin ba80ab31f2 docs: move i18n angular.json snippets to external file (#43216)
Note that because `angular.json` is a "boilerplate" file we cannot
just add comments to the one that is actually used in the application.

Instead this commit makes a copy, which is annotated with docregions.
To ensure that this file is not ignored by the example-collector, we had to
update the `.gitignore` to not ignore this file. (This also allows the file to be
easily stored tracked in git).

PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 5f3abd257b build(docs-infra): support overriding boilerplate files in examples (#43216)
It is now possible to specify file paths in the `"boilerplate-override"`
property of `example-config.json` files to tell the example boilerplate
system to use the file in the example directory rather than overwriting the
example file with that from the boilerplate directory.

PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin d6a3078097 build(docs-infra): indent docplaster markers to the level of the docregion (#43216)
This change makes docplaster markers fit better with the surrounding code
that is being rendered.  Instead of:

```
{
  "a": 100,
// ...
  "b": 200,
// ...
}
```

you can now get

```
{
  "a": 100,
  // ...
  "b": 200,
  // ...
}
```

PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 3d2dc18f57 build(docs-infra): switch JSON examples to use inline docregion comments (#43216)
Now JSON files should be commented using

```
// #docregion
```

rather than

```
/* #docregion */
```

There are currently no JSON files with either kind of comments so this change
has no impact yet.

But when we add some examples with such comments, they will also benefit
from `// ... ` style docplasters to join docregion fragments.

PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 14f5f58fbf docs: move duplicate custom id snippets to external examples (#43216)
PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 88f5957c71 docs: move nginx and apache config blocks to external files (#43216)
PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin d25fbc3f22 build(docs-infra): support docregions in .conf files (#43216)
This commit tells the docregion parser how to process files that end in `.conf`.

PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 6461ef7a67 docs: move plural function example to external file (#43216)
PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin aca61ad1dd docs: move global locale import to external example file (#43216)
PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 5d36ceb276 docs: move shell snippets to external example files (#43216)
PR Close #43216
2021-09-15 10:46:46 -07:00
Pete Bacon Darwin 35f1d2b91e build(docs-infra): support docregions in .sh example files (#43216)
This commit tells the docregion parser how to process `.sh` files.

PR Close #43216
2021-09-15 10:46:46 -07:00
Andrew Kushnir 9b8f056604 release: cut the v12.2.6 release (#43462) 2021-09-15 10:26:25 -07:00
Joe Martin (Crowdstaffing) 2050b0898b docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) 5af9404cba docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) d5c58414ab docs: update link (#43451)
Update link per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) 69035dd52d docs: update punctuation (#43451)
Update punctuation per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) 1a3a87057a docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) 75abf868c0 docs: update spelling (#43451)
Update spelling per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Joe Martin (Crowdstaffing) f099d9c0ea docs: update capitalization (#43451)
Update capitalization per review.

PR Close #43451
2021-09-14 15:51:31 -07:00
Andrew Scott 24cf4eaa4d refactor(router): Remove TODO and slightly adjust eager browserUrlTree update (#43426)
No test was added for this case because I can't think of a test case to
write that would work.

This change updates the code for a consistent mental model of setting
the `browserUrlTree`. It's only meant to track the `UrlTree` that the
`UrlHandlingStrategy` is set to extract, not the full `rawUrl`. Notice
that everywhere else, the `browserUrlTree` is set to
`urlAfterRedirects`, which is computed based on the extracted URL, _not_
the `rawUrl`.

PR Close #43426
2021-09-14 11:11:43 -07:00
David Shevitz 2f94ac374a docs: add guidelines for localizing angular documentation (#43314)
PR Close #43314
2021-09-14 08:32:51 -07:00
George Kalpakas d2bee44951 perf(docs-infra): reduce unnecessary whitespace in API docs (#43435)
The HTML for the docs pages is generated by Dgeni based on some
[Nunjucks][1] templates.

Previously, these templates were set up in a way that introduced a lot
excess whitespace in the generated HTML, unnecessarily bloating the
corresponding JSON files that need to be downloaded in order to view a
certain docs page. This has been discussed in #28105 and was again
observed while investigating #43285.

This commit refactors some of the templates related to API docs (which
seem to be the most affected ones) to drastically reduce the amount of
excess whitespace. More specifically, the total size of all files in
`generated/docs/api/` was reduced from ~13MB to ~7MB.

Besides the reduced payload size for each API page, this change will
also reduce the amount of memory needed by the ServiceWorker to cache
the API pages that have been visited by a user.

NOTE:
The affected files are not eagerly downloaded when navigating to
angular.io. Instead, each file is downloaded individually, as soon as a
user visits the corresponding API docs page. Therefore, the impact of
this change will be relatively small for most users.

[1]: https://mozilla.github.io/nunjucks/

PR Close #43435
2021-09-14 08:29:51 -07:00
George Kalpakas 7f23958c73 build(docs-infra): update remark-html to 13.0.2 (#43435)
NOTE:
This [version][1] includes a breaking fix ([commit b0b1ba5c5][2]), which
turns sanitization on by default. Since, we don't need sanitization (the
HTML is authored by docs authors and tooling and should be safe), this
commit restores the old behavior by setting the [sanitize][3] option to
`false`.

[1]: https://github.com/remarkjs/remark-html/releases/tag/13.0.2
[2]: https://github.com/remarkjs/remark-html/commit/b0b1ba5c55a58b26bbe1ca3b6def18e95dbbd89e
[3]: https://github.com/remarkjs/remark-html#optionssanitize

PR Close #43435
2021-09-14 08:29:50 -07:00
George Kalpakas e74eac2368 build(docs-infra): update github-slugger to 1.4.0 (#43435)
NOTE:
This [version][1] includes a breaking fix ([commit af59f343d][2]). More
specifically `github-slugger` will no longer trim the text of a heading
before generating an ID and (with whitespace converted to `-`) this
results in different heading IDs:
**Before:** `<h3>  foo bar  </h3>` --> `<h3 id="foo-bar">...`
**After:** `<h3>  foo bar  </h3>` --> `<h3 id="--foo-bar--">...`

The different IDs now break some of our anchor-links, becuase
`github-slugger` is used by [rehype-slug][3], which is in turn used by
our [autolinkHeadings][4] dgeni post-processor.

To avoid the issue with broken anchor links, we update the
`renderMethodDetail()` nunjucks macro to omit excess whitespace in
headings.

[1]: https://github.com/Flet/github-slugger/releases/tag/v1.4.0
[2]: https://github.com/Flet/github-slugger/commit/af59f343dc7fe88a94a79c721fb3225a275a095d
[3]: https://github.com/rehypejs/rehype-slug
[4]: https://github.com/angular/angular/blob/75a3c778b1f7be913f0287423d40fade68ee9adc/aio/tools/transforms/angular-base-package/post-processors/autolink-headings.js#L3

PR Close #43435
2021-09-14 08:29:50 -07:00
Andrew Scott 4034f252c9 fix(router): Allow renavigating to failed URLs (#43424)
There are situations where the Router does not currently clean up failed navigations
correctly. While this is problematic on its own, we can mitigate some of
the damage by processing any URL when we get a navigation request when
the internal router state is out of sync.

Each of the added tests would fail without this change.

fixes #34795

PR Close #43424
2021-09-13 14:48:01 -07:00
Naveed Ahmed a102b27641 fix(service-worker): clear service worker cache in safety worker (#43324)
clear angular service worker cache in safety worker to ensure stale
or broken contents are not served in future requests

Fixes #43163

PR Close #43324
2021-09-13 14:34:33 -07:00
mezhik91 baf8145ee0 docs: add Dmytro Mezhenskyi to GDE resources (#43282)
PR Close #43282
2021-09-13 12:57:00 -07:00
dario-piotrowicz 52c320fda6 docs: remove unnecessary "https://angular.io/" from aio links (#43425)
PR Close #43425
2021-09-13 09:24:07 -07:00
Renovate Bot 176aa999bd build: update dependency karma to v6 (#43422)
Updates the dependency for Karma to v6. This is a patch port PR.

PR Close #43422
2021-09-13 09:23:24 -07:00
Bjarki c8179353ce fix(docs-infra): bump aio size limit (#43406)
Increase the aio size tracking limit as a result of Trusted Types
refactoring.

PR Close #43406
2021-09-10 09:24:48 -07:00
Bjarki 604965bdde build(docs-infra): enable tsec security checker (#43406)
tsec is a TypeScript compiler wrapper for restricting use of
security-sensitive DOM APIs, in particular those that could lead to XSS
or Trusted Types violations. Add it as a linter to aio to prevent future
Trusted Types regressions on angular.io.

Also introduces security_exemptions.json, which lists the known,
security-reviewed tsec security violations. New entries can only be
added to this file after a security review, in particular making sure
that the corresponding code does not cause XSS vulnerabilities or
Trusted Types violations.

PR Close #43406
2021-09-10 09:24:48 -07:00
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) 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) 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
Daniel Trevino e29f1d9cf8 refactor(compiler-cli): change checks folder structure (#43232)
Change template checks into `extended/checks` instead of
`extended/src/template_checks`.

Refs #42966

PR Close #43232
2021-08-26 16:36:32 -07:00
Daniel Trevino 553eb2cc9f refactor(compiler-cli): remove whitespace (#43232)
Remove extra whitespace introduced in a previous PR.

PR Close #43232
2021-08-26 16:36:32 -07:00
Joey Perrott 30d959a48a build: update issue template to include core package (#43272)
Update the dropdown list to include core in the list of packages.

PR Close #43272
2021-08-26 19:43:14 +00:00
Andrew Scott fdcb420bd7 docs(router): Fix incorrect name for url match options (#43268)
fixes #43123

PR Close #43268
2021-08-26 10:07:24 -07:00
Kristiyan Kostadinov 524b4d5a1f refactor(forms): make error messages easier to tree shake (#43223)
Currently the error message functions are defined as static methods on a class which means that as soon as one of them is used somewhere, all of them have to be retained. This isn't a problem at the moment, because all of them are behind `ngDevMode` checks, but it's error prone and it's easy to fix.

These changes move them out into functions so that they can be imported individually. It also has the advantage of allowing Webpack to minify the function names.

PR Close #43223
2021-08-26 10:05:36 -07:00
segunb fb64f711f8 docs: Close #View tag to avoid confusion (#43256)
PR Close #43256
2021-08-26 09:44:08 -07:00
nickreid e7e78e6709 refactor(zone.js): Rename class ZoneDelegate to _ZoneDelegate to differentiate it from the ZoneDelgate interface (#43019)
The current naming causes tsickle to emit `/** @implements {ZoneDelegate} */ class ZoneDelegate ...`, which is a cyclic definition error in Closure Compiler. Additionally, the name shadowing is also confusing to humans.

PR Close angular#43019

PR Close #43019
2021-08-25 15:12:01 -07:00
nickreid 8233906be2 fix(compiler-cli): Emit type annotations for synthesized decorator fields (#43021)
Previously, the decorator transformer was annotating the synthesized properties with TS type annotations. However, because it ran after the JSDoc transformer, the TS types were just dropped from the emitted JS. Attempting to move the decorator transformer before the JSDoc transformer causes tsickle crashes because synthetic AST fragments are not attached to a SourceFile node.

PR Close #43021
2021-08-25 15:05:29 -07:00
Alex Rickabaugh b8183614f5 release: cut the v12.2.3 release (#43257)
PR Close #43257
2021-08-25 14:20:31 -07:00
George Kalpakas b46ce7d42f build(docs-infra): upgrade cli command docs sources to 56c5962df (#43239)
Updating [angular#12.2.x](https://github.com/angular/angular/tree/12.2.x) from
[cli-builds#12.2.x](https://github.com/angular/cli-builds/tree/12.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/7c2d76d9e...56c5962df):

**Modified**
- help/lint.json

PR Close #43239
2021-08-25 10:48:04 -07:00
Daniel Trevino 36bf0ae985 test(language-service): add test for extended diagnostics (#43134)
Add a test to make sure extended template diagnostics are being correctly
generated in the language service for non-ts files.

Refs #42966

PR Close #43134
2021-08-25 10:43:02 -07:00
Daniel Trevino 3b317dcf87 refactor(compiler-cli): integrate extended diagnostics with the language service (#43134)
Add the call to get the extended template diagnostics in
the compiler's `getDiagnosticsForComponent`. This makes showing
extended diagnostics in non-ts files posible.

Refs #42966

PR Close #43134
2021-08-25 10:43:02 -07:00
Daniel Trevino 3ad527d86e refactor(compiler-cli): rename ExtendedTemplateChecker get diagnostics fucntion (#43134)
Rename `getExtendedTemplateDiagnosticsForComponent` to
`getDiagnosticsForComponent` since it's implied they are extended
diagnostics.

Refs #42966

PR Close #43134
2021-08-25 10:43:02 -07:00
Daniel Trevino b6ff762e36 refactor(compiler-cli): move getDiagnosticsForComponent to compiler (#43134)
Change the language service to call `getDiagnosticsForComponent` from
the compiler instead of the `TemplateTypeChecker`.

Refs #42966

PR Close #43134
2021-08-25 10:43:02 -07:00
Daniel Trevino e196311e5c refactor(compiler-cli): move ExtendedTemplateChecker to LazyCompilationState (#43134)
Create the `ExtendedTemplateChecker` during `makeCompilation`, that way
it's avaiblable in the whole compiler.

Refs #42966

PR Close #43134
2021-08-25 10:43:01 -07:00
Daniel Trevino 3cf8f66f3a refactor(compiler-cli): use TemplateDiagnostic in extended package (#43134)
Return `TemplateDiagnostic` instead of `ts.Diagnostic` when getting the
extended template diagnostics. This makes the integration with the
language service easier. This also fixes the error code and now uses the
`ngErrorCode` for extended template diagnostics.

Refs #42966

PR Close #43134
2021-08-25 10:43:01 -07:00
dario-piotrowicz d7b6416fcf refactor(common): fix emiting typos (#43221)
fix some of the aio examples which log strings containing "emiting" instead of "emitting"

PR Close #43221
2021-08-23 13:30:29 -07:00
shlasouski fc7f92159d fix(service-worker): NPE if onActionClick is undefined (#43210)
Previously, it leads to fail if notification.data.onActionClick is undefined

PR Close #43210
2021-08-23 13:29:59 -07:00
Daniel Trevino cb8e51f8cf test(language-service): add extended diagnostics test (#43107)
Add a test in the langauge-service to make sure the extended template
diagnostics are being correctly generated.

Refs #42966

PR Close #43107
2021-08-19 11:55:28 -07:00
Daniel Trevino e6b2bedd70 test(compiler-cli): add extended template diagnostics end-to-end tests (#43107)
This commit adds extended template diagnostics end-to-end tests, to make
sure the diagnostics are generated correctly. Template checks are
already tested with unit tests.

Refs #42966

PR Close #43107
2021-08-19 11:55:28 -07:00
Daniel Trevino 58a19a3021 refactor(compiler-cli): add extendedTemplateCheck phase to compiler (#43107)
This commit integrates extended template checks with the compiler, by
adding another phase of diagnostics generation. This integration is
under the `_extendedTemplateDiagnostics` flag.

Refs #42966

PR Close #43107
2021-08-19 11:55:28 -07:00
Daniel Trevino f70d2a2981 refactor(compiler-cli): export ExtendedTemplateCheckerImpl and template checks (#43107)
This commit exports the implementation of `ExtendedTemplateChecker` to
generate extended template diagnostics and all the template checks.

Refs #42966

PR Close #43107
2021-08-19 11:55:28 -07:00
Daniel Trevino 3bbf00fdd4 refactor(compiler-cli): add ExtendedTemplateChecker (#43107)
Change the current way to run template checks to the
`ExtendedTemplateChecker` instead of just the
`getExtendedTemplateDiagnosticsForComponent` function. Refactored the
tests that used the previous function to use the new class.

Refs #42966

PR Close #43107
2021-08-19 11:55:28 -07:00
dario-piotrowicz 19fa033f79 refactor(docs-infra): use tslint in aio's tools-lint script (#43010)
Instead of the deprecated tslint use eslint in the aio's tools-lint
script

PR Close #43010
2021-08-19 11:20:06 -07:00
Erik Slack 513b17043e docs: fix typo (#43190)
Fix typo in description of ngxp and link for angular community meetup

PR Close #43190
2021-08-18 10:52:19 -07:00
Dylan Hunn c501e86fd2 release: cut the v12.2.2 release (#43195) 2021-08-18 10:15:31 -07:00
Kirk Larkin e849e57059 docs: tidy up description of NgComponentOutlet (#43159)
PR Close #43159
2021-08-18 09:17:44 -07:00
Joe Martin (Crowdstaffing) e31ed3d0dc docs: update links and formatting (#43066)
Update links and formatting prior to creating sub-topics.

Update links to reference links for consistency.  Update formatting for code sections.  Updated list alignment for consistent formatting.

PR Close #43066
2021-08-17 20:00:58 -07:00
Pete Bacon Darwin 545972e5e9 docs(upgrade): add @extensible to the UpgradeComponent class (#42807)
This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close #42807
2021-08-17 09:23:09 -07:00
Pete Bacon Darwin 38d51e4926 build(docs-infra): add sealed markers to classes in API pages (#42807)
This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes #42802

PR Close #42807
2021-08-17 09:23:09 -07:00
Kristiyan Kostadinov 535837e617 perf(platform-browser): avoid intermediate arrays in server transition (#43145)
The server transition initializer looks for some `style` tags and clears them based on their `ng-transition` ID. The way we currently have the logic creates a couple of intermediate arrays just so we can call `forEach` at the end.

These changes use a regular `for` loop with an `if` statement instead. This isn't a _massive_ performance improvement, but the logic does run during app initialization which is performance-sensitive and it's an easy change to make on our end.

PR Close #43145
2021-08-17 09:22:05 -07:00
Charles Lyding bb6555979d fix(animations): add pure annotations to static property initializers (#43064)
Class static properties with initializers that cause code execution (for example, call expressions or new expressions) have the potential to cause side effects at module evaluation. This is similar in effect to module level code. As a result, optimizers can not safely remove a class with such a static property as the potential side effects may have meaningful effects on the state of the application execution. To allow classes with these type of static properties to be optimized and removed if unused, the initializer expressions for the static properties can be annotated as pure. This annotation provides a signal to an optimizer that the expression does not have any potential side effects and is useful in cases where static analysis can not currently prove that there are, in fact, no side effects caused by the initializer.

PR Close #43064
2021-08-16 17:20:21 -07:00
Charles Lyding 738b23347e fix(core): add pure annotations to static property initializers (#43064)
Class static properties with initializers that cause code execution (for example, call expressions or new expressions) have the potential to cause side effects at module evaluation. This is similar in effect to module level code. As a result, optimizers can not safely remove a class with such a static property as the potential side effects may have meaningful effects on the state of the application execution. To allow classes with these type of static properties to be optimized and removed if unused, the initializer expressions for the static properties can be annotated as pure. This annotation provides a signal to an optimizer that the expression does not have any potential side effects and is useful in cases where static analysis can not currently prove that there are, in fact, no side effects caused by the initializer.

PR Close #43064
2021-08-16 17:20:21 -07:00
dario-piotrowicz cd8b1a5087 refactor(compiler-cli): remove unused closureCompilerEnabled from NgtscProgram (#43148)
remove the NgtscProgram's private field closureCompilerEnabled as that
is not being used in the class itself

PR Close #43148
2021-08-16 17:19:54 -07:00
Joey Perrott c9def401f8 ci: update circle cache key (#43175)
Update the prefix used for the circle cache key to use new cache base.

PR Close #43175
2021-08-16 17:19:08 -07:00
Joey Perrott dfd6337bc9 build: add mainBranchName to github configuration (#43175)
Update the ng-dev config for Github to include the main branch name.

PR Close #43175
2021-08-16 17:19:08 -07:00
Joey Perrott fe6a5acd17 build: remove dev-infra directory and migrate to relying on @angular/dev-infra-private-builds (#43175)
Remove the dev-infra directory and complete the migration to using the code generated by the
angular/dev-infra repository.

PR Close #43175
2021-08-16 17:19:08 -07:00
George Kalpakas 768a6698a0 docs(router): use the correct live-example name in routing-overview.md (#43180)
The previously used code (`<live-example stackblitz="router">`) would
try to target the `router.stackblitz.json` file inside the
(non-existent) `routing-overview` example (same as the guide's name).

This commit fixes the code to correctly express the original intention
of targeting the default `stackblitz.json` file of the `router` example
with `<live-example name="router">`.

Fixes #43167

PR Close #43180
2021-08-16 17:18:29 -07:00
Pete Bacon Darwin cd10a4cc13 test(compiler): add a test for parsing multiline expressions in attributes (#43129)
This tests a scenario that was failing in an internal project.

PR Close #43129
2021-08-16 13:07:25 -07:00
Pete Bacon Darwin 1e811df79f test(compiler): check that the parser supports prematurely terminated interpolations (#43129)
Such interpolations turned up during internal testing at Google, so this
commit adds a test to prevent regressions.

PR Close #43129
2021-08-16 13:07:24 -07:00
Pete Bacon Darwin a701c10b77 refactor(compiler): use === rather than == in the ml_parser (#43129)
This is a simple tidy up commit to move to the more specific `===`
comparison operator in the HTML lexer/parser.

PR Close #43129
2021-08-16 13:07:24 -07:00
Pete Bacon Darwin 510931a7ab refactor(compiler): share isQuote() via chars.ts (#43129)
This function is general purpose and by moving it into the
`chars.ts` file along with similar helpers, it can be reused
in the lexer, for instance.

PR Close #43129
2021-08-16 13:07:24 -07:00
Pete Bacon Darwin 92fa1a6cc0 refactor(compiler): remove cyclic dependencies (#43129)
This commit removes 9 cycles in the dependency graph of the compiler code.

PR Close #43129
2021-08-16 13:07:24 -07:00
Pete Bacon Darwin 616133c704 test(compiler-cli): clarify source-map expectations in compliance tests (#43129)
The compliance tests can check source-map segments against expectations
encoded into the expectation files. Previously, the encoding of the expected
segment was only delimited by whitespace, but this made it difficult to identify
segments that started or ended with whitespace.

Now these segment expectations are wrapped in double-quotes which makes
it easier to read and understand the expectation files.

PR Close #43129
2021-08-16 13:07:24 -07:00
Pete Bacon Darwin c792dd739a refactor(ngcc): remove unused import (#43129)
This import is not used in the file, so can be removed.

PR Close #43129
2021-08-16 13:07:24 -07:00
TIffany Davis 83fa3ee581 docs: add tmdavis to contributors (#43135)
PR Close #43135
2021-08-16 10:47:09 -07:00
Renovate Bot 304c85edd0 build: update dependency entities to v3 (#43095)
PR Close #43095
2021-08-16 10:46:28 -07:00
Edoardo Dusi 1e39e11ba0 refactor(common): change encoding function in httpparams for better performances and coding standards (#42998)
HttpParams uses custom encoding function "standardEncoding" to encode query string preserving specific charachters. This refactoring aims to improve performances and code quality of that function by using a RegExp and a Map object instead of a chain of replace functions.

PR Close #42998
2021-08-16 10:44:53 -07:00
Aristeidis Bampakos e0a8ca7eee docs: update Aristeidis bio in GDE list (#43164)
PR Close #43164
2021-08-16 09:39:06 -07:00
Andrew Scott 6449590ec8 fix(router): eagerly update internal state on browser-triggered navigations (#43102)
The management of `browserUrlTree` currently has several problems with
correctly tracking the actual state of the browser.

This change makes the Router eagerly update the `browserUrlTree` when
handling navigations triggered by browser events (i.e., not 'imperative'). This
is because with those types of navigations, the browser URL bar is
_already_ updated. If we do not update the internal tracking of the
`browserUrlTree`, we will be out of sync with the real URL if the
navigation is rejected.

It would be best if we could remove `browserUrlTree` completely, but doing that
would require a lot more investigation and is blocked by #27059 because
the SpyLocation used in tests does not emulate real browser behavior.

fixes #43101

PR Close #43102
2021-08-16 09:33:24 -07:00
ali 1939613f71 docs: add example for template local variable (#43137)
PR Close #43137
2021-08-16 09:24:12 -07:00
dario-piotrowicz 6d6638c1e9 refactor(compiler-cli): remove extra 'diagnostic' from readResource comment (#43147)
remove the extra 'diagnostic' present in the comment for the
ResourceHost's readResource method

PR Close #43147
2021-08-16 09:23:40 -07:00
dario-piotrowicz cda9d16838 refactor(compiler): fix lateron typo in i18n ExtractorHost (#43160)
fix typo put in the ExtractorHosts's resourceNameToFileName comment
in which "later on" is spelled "lateron"

PR Close #43160
2021-08-16 09:23:14 -07:00
Joey Perrott 19fd2f4125 ci: add breaking changes auto labeling action (#43141)
Automatically add/remove `breaking changes` label to PRs as needed based on whether
the PR contains a commit with a breaking change.

PR Close #43141
2021-08-13 14:58:46 -07:00
pichuser 7a67597d01 docs: fix description: "property decorator" (not parameter) (#43068) (#43128)
PR Close #43068

PR Close #43128
2021-08-12 15:36:59 -07:00
Andrew Scott ec0a3007c6 refactor(compiler): Remove compileUndecoratedClasses config file (#43043)
This config file was added to support g3 patches. Now that the patch is removed internally,
we can remove the file completely

PR Close #43043
2021-08-12 15:35:08 -07:00
Theoklitos Bampouris 67ae442edc docs: adjust description to code example (#43127)
Remove promise's then(...) callback from description to match the code example's async/await syntax.
PR Close #43127
2021-08-12 15:32:47 -07:00
Andrew Kushnir 9136dbd65c release: cut the v12.2.1 release (#43117) 2021-08-11 10:13:33 -07:00
Daniel Trevino 4a1d9a78fa refactor(compiler-cli): add test for BananaInBoxCheck (#42984)
Create the test package for extended_template_diagnostics and add a unit
test for the `BananaInBoxCheck`.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino 0f8ae8bf7f refactor(compiler-cli): add BananaInBoxCheck to the template checks (#42984)
Add the implementation of a Template Check that ensures the correct
use of two-way binding syntax. Generates a warning when
'([foo])="bar"' is found instead of '[(foo)]="bar"'.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino c42b50cfbe refactor(compiler-cli): visit inputs and outputs for elements and templates (#42984)
This commit adds to the exisiting `RecursiveVisitor` and visits inputs
and outputs for elements and templates.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino a3bc29bbb2 refactor(compiler-cli): move getSourceCodeForDiagnostic to utils (#42984)
Export `getSourceCodeForDiagnostic` from `ngtsc/testing` to make it
available for other packages. This will help confirm that the source
code is correct in other tests.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino 387dcc6621 refactor(compiler-cli): move typecheck test utils into its own package (#42984)
This commit moves the test utils used in the typechecking tests into its
own package. This makes them available to be used in the tests of a
different package.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino 029060f2d6 refactor(compiler-cli): introduce getExtendedTemplateDiagnosticsForComponent function (#42984)
Add function to get extended template diagnostics generated by all the template checks.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino a53d26847c refactor(compiler-cli): make makeTemplateDiagnostic wrapper error (#42984)
specific

This commit makes the wrapper function `makeTemplateDiagnostic` take an
ErrorCode as a type for the `ts.Diagnostic`s to be generated.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Daniel Trevino 21e2b93046 refactor(compiler-cli): introduce extended package to typecheck with it's API (#42984)
This commit introduces //packages/compiler-cli/src/ngtsc/typecheck/extended
as a container for a new phase of diagnostics generation. The API provides an
interface for new template checks to implement and generate template diagnostics.

Refs #42966

PR Close #42984
2021-08-10 15:55:50 -07:00
Tim Gates 92012ec4fd docs: Fix a few typos (#43051)
There are small typos in:
- aio/content/guide/universal.md
- aio/content/guide/upgrade.md
- aio/content/guide/workspace-config.md
- dev-infra/ng-dev.js
- integration/check-dependencies.js

Fixes:
- Should read `mergeable` rather than `mergable`.
- Should read `upgradeable` rather than `upgradable`.
- Should read `thresholds` rather than `threshholds`.
- Should read `lease` rather than `leage`.
- Should read `ignore` rather than `ingore`.
- Should read `bootstrapping` rather than `bootstraping`.

PR Close #43051
2021-08-10 11:59:29 -07:00
Erik Slack 6ca81a706c docs: add angular community meetup and ngxp to community resources (#43103)
Invite people to get more involved with Angular's community via these

PR Close #43103
2021-08-10 11:56:22 -07:00
Amadou Sall 0baabcb7da docs: remove the mention of Stylus (#43013)
Stylus is not supported anymore by Angular, so it should be removed from the Angular docs

PR Close #43013
2021-08-10 11:55:35 -07:00
Andrew Kushnir dc6cb5a3d4 Revert "build(dev-infra): exlude commit message filter from formatting (#43091)" (#43105)
This reverts commit 7da3570be8.

The reason for the revert is the breakage of the merge tooling (`dev-infra/commit-message-filter.js: No such file or directory`).

PR Close #43105
2021-08-10 11:49:42 -07:00
Vugar_Abdullayev 7da3570be8 build(dev-infra): exlude commit message filter from formatting (#43091)
exlude commit-message-filter.js from clang format and tslint

PR Close #43091
2021-08-10 10:44:35 -07:00
Andrew Kushnir ec192b2b71 refactor(core): replace references to goog.LOCALE with goog.getLocale() (#43089)
It is necessary in order to distinguish 2 different reasons for referencing the compiled-in locale.

1. Some code just needs to pass the locale value on to logic that actually uses it.
2. Other code uses the locale value to select locale-specific user-visible data and behavior.

Code modified by this change is of the first kind and should use `goog.getLocale()` in the future.

Note: there are still references to the `goog.LOCALE` in Angular codebase, but they are of second type.

PR Close #43089
2021-08-10 10:35:26 -07:00
George Kalpakas 55fe2c667d build(docs-infra): upgrade cli command docs sources to 7c2d76d9e (#43094)
Updating [angular#12.2.x](https://github.com/angular/angular/tree/12.2.x) from
[cli-builds#12.2.x](https://github.com/angular/cli-builds/tree/12.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/18b20d67b...7c2d76d9e):

**Modified**
- help/generate.json

PR Close #43094
2021-08-10 10:34:17 -07:00
George Kalpakas 8a3d2aad30 fix(docs-infra): correctly detect chunk load errors (#43088)
It seems that at some point (potentially with the switch to Webpack 5)
Webpack started using the full chunk name (instead of just a numeric
identifier) in `ChunkLoadError` messages. So the error messages changed
from:
```
ChunkLoadError: Loading chunk 2 failed.
```

...to:
```
ChunkLoadError: Loading chunk src_app_something_some_module_ts failed.
```

This commit updates the regex that is used to detect such errors (in
order to print ServiceWorker-related debug info) to correctly recognize
the new error message format.

PR Close #43088
2021-08-09 12:25:42 -07:00
Andrew Scott dd3abdb9d9 fix(router): ensure check for match options is compatible with property renaming (#43086)
After renaming, 'paths' is not in routerLinkOptions since it's been renamed.

PR Close #43086
2021-08-09 10:26:07 -07:00
Jeroen van Warmerdam d93427b806 docs: fix cli link (#43085)
PR Close #43085
2021-08-09 09:41:41 -07:00
George Kalpakas 032e65c895 build(docs-infra): update docs examples to Angular v12.1.3 (#42949)
This commit updates the docs examples to Angular v12.1.3. In addition to
updating the dependencies versions, it also updates the projects'
structure and configs to more closely match what a new v12 CLI app would
look like. See, also, the [diff][1] between a basic v11.2.11 CLI app and
a v12.1.3 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.11..12.1.3

PR Close #42949
2021-08-09 09:41:01 -07:00
George Kalpakas ee05a285f9 docs: fix typo in Compiler Options guide (#42949)
PR Close #42949
2021-08-09 09:41:01 -07:00
Joey Perrott 4371ff9092 fix(dev-infra): search since HEAD on the local branch for version tags when creating stamps (#43065)
Using `HEAD~100` was errantly left in the snapshot stamping logic.

PR Close #43065
2021-08-06 08:54:22 -07:00
Joey Perrott a26b0dcc72 ci: stop publishing snapshots to angular/dev-infra-private-builds (#43059)
We no longer publish to angular/dev-infra-private-builds as the dev-infra
content has been moved to angular/dev-infra.

PR Close #43059
2021-08-05 16:05:03 -07:00
Fabien BERNARD 30c5b9c144 docs: fix interval type in the example (#43042)
`window.setInterval` returns a `number`, let's fix this example.

PR Close #43042
2021-08-05 15:33:14 -07:00
George Kalpakas 673f7a7954 build(docs-infra): upgrade cli command docs sources to 18b20d67b (#43026)
Updating [angular#12.2.x](https://github.com/angular/angular/tree/12.2.x) from
[cli-builds#12.2.x](https://github.com/angular/cli-builds/tree/12.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/a57976b98...18b20d67b):

**Modified**
- help/e2e.json

PR Close #43026
2021-08-04 12:10:46 -07:00
Andrew Scott cdc8c7cad0 release: cut the v12.2.0 release (#43047) 2021-08-04 10:24:49 -07:00
Kristiyan Kostadinov bd7f0d8b70 fix(core): incorrect error reported when trying to re-create view which had an error during creation (#43005)
Currently if a view throws an error during creation mode, we mark it as `incompleteFirstPass` so that we can try to recover later. The recovery is only possible inside component views.

The problem is that when this was introduced, I forgot to flip the `firstCreatePass` when an error is thrown which meant that calling `renderView` on the same component again is allowed. It will eventually hit an assertion which can be confusing for the end user. This issue only manifests itself when rendering views "manually" through `ViewContainerRef` (e.g. using `NgIf`).

These changes flip the `firstCreatePass` back to false on errors so that trying to re-render the same view will throw an error which is consistent to the one that broke the view during creation.

Fixes #41383.

PR Close #43005
2021-08-04 08:58:29 -07:00
atscott 3a9ce61ea4 Revert "refactor(ngcc): remove unused import (#42062)" (#43033)
This reverts commit 42265cca1c.

PR Close #43033
2021-08-03 15:39:00 -07:00
atscott ae98b24eb7 Revert "test(compiler-cli): clarify source-map expectations in compliance tests (#42062)" (#43033)
This reverts commit 29f9888a98.

PR Close #43033
2021-08-03 15:39:00 -07:00
atscott 4997a3f692 Revert "refactor(compiler): remove cyclic dependencies (#42062)" (#43033)
This reverts commit 75855196e3.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 6a59e6b009 Revert "refactor(compiler): support interpolation tokens when lexing markup (#42062)" (#43033)
This reverts commit c8a46bfdcd.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 6f80c55dbd Revert "refactor(compiler): share isQuote() via chars.ts (#42062)" (#43033)
This reverts commit 3d3b69ff81.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 07846e550c Revert "refactor(compiler): support interpolation tokens when lexing attribute values (#42062)" (#43033)
This reverts commit c516e252fc.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott f18131f372 Revert "refactor(compiler): support encoded entity tokens when lexing markup (#42062)" (#43033)
This reverts commit 942b24d5ea.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott f24b94f5d9 Revert "refactor(compiler): expose token parts in Text nodes (#42062)" (#43033)
This reverts commit 8a54896a91.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 6caafc2062 Revert "test(compiler): check fullStart source-span (#42062)" (#43033)
This reverts commit 973f9b8d19.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott f883aaeb89 Revert "fix(compiler): include leading whitespace in source-spans of i18n messages (#42062)" (#43033)
This reverts commit f08516db09.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 2215af252c Revert "refactor(compiler): define interfaces for each lexer token (#42062)" (#43033)
This reverts commit 9b3d4f5575.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott db4147b4d2 Revert "test(compiler): check that the parser supports prematurely terminated interpolations (#42062)" (#43033)
This reverts commit 11ebe21d0d.

PR Close #43033
2021-08-03 15:38:59 -07:00
atscott 2dc6efed4e Revert "refactor(compiler): use === rather than == in the ml_parser (#42062)" (#43033)
This reverts commit 28b0c45fde.

PR Close #43033
2021-08-03 15:38:58 -07:00
atscott 1d307bc5bf Revert "test(compiler): add a test for parsing multiline expressions in attributes (#42062)" (#43033)
This reverts commit fe12651580.

PR Close #43033
2021-08-03 15:38:58 -07:00
ivanwonder aace1e71d8 fix(language-service): global autocomplete doesn't work when the user tries to modify the symbol (#42923)
When the user tries to trigger suggestions from an interruption,
the LS should provide the global completions. For example,
`[input]="t¦"`, the `t` can be the `true` or the symbol from
the component context.

PR Close #42923
2021-08-02 17:08:30 -07:00
dario-piotrowicz fbfec946a7 docs: amend links in content-projection guide (#43009)
PR Close #43009
2021-08-02 15:36:52 -07:00
Kristiyan Kostadinov 0e47334db8 refactor(core): update peerDependencies to allow rxjs7 (#42991)
We can't update the framework to rxjs7 until version 13, because it contains breaking changes, but we can allow users to opt into it since all of our code should be compatible.

These changes expand the allowed version range of rxjs and add an integration test to verify that we don't get compilation errors. Note that we also have a test that runs the AIO examples against rxjs 7 already (#42660).

Fixes #41897.

PR Close #42991
2021-08-02 13:55:01 -07:00
Pete Bacon Darwin e4f62c12f5 test(compiler): add a test for parsing multiline expressions in attributes (#42062)
This tests a scenario that was failing in an internal project.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin ea3a14805e refactor(compiler): use === rather than == in the ml_parser (#42062)
This is a simple tidy up commit to move to the more specific `===`
comparison operator in the HTML lexer/parser.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin a96f9c91a2 test(compiler): check that the parser supports prematurely terminated interpolations (#42062)
Such interpolations turned up during internal testing at Google, so this
commit adds a test to prevent regressions.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin a8c0f4f1ba refactor(compiler): define interfaces for each lexer token (#42062)
These token interfaces will make it easier to reason about tokens in the
parser and in specs.

Previously, it was never clear what items could appear in the `parts`
array of a token given a particular `TokenType`. Now, each token interface
declares a labelled tuple for the parts, which helps to document the token
better.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 11ef03b36f fix(compiler): include leading whitespace in source-spans of i18n messages (#42062)
Previously, the way templates were tokenized meant that we lost information
about the location of interpolations if the template contained encoded HTML
entities. This meant that the mapping back to the source interpolated strings
could be offset incorrectly.

Also, the source-span assigned to an i18n message did not include leading
whitespace. This confused the output source-mappings so that the first text
nodes of the message stopped at the first non-whitespace character.

This commit makes use of the previous refactorings, where more fine grain
information was provided in text tokens, to enable the parser to identify
the location of the interpolations in the original source more accurately.

Fixes #41034

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 8e798effe4 test(compiler): check fullStart source-span (#42062)
The tests were checking that the source-span of parsed HTML nodes were
accurate, but they were not checking the span when it includes the
"leading trivia", which are given by the `fullStart` rather than `start`
location.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 54f73530a8 refactor(compiler): expose token parts in Text nodes (#42062)
When it was tokenized, text content is split into parts that can include
interpolations and encoded entities tokens.

To make this information available to downstream processing, this commit
adds these tokens to the `Text` AST nodes, with suitable processing.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 61080ea4bc refactor(compiler): support encoded entity tokens when lexing markup (#42062)
The lexer now splits encoded entity tokens out from text and attribute value tokens.

Previously encoded entities would be decoded and the decoded value would be
included as part of the text token of the surrounding text. Now the entities
have their own tokens. There are two scenarios: text and attribute values.

Previously the contents of `<div>Hello &amp; goodbye</div>` would be a single
TEXT token. Now it will be three tokens:

```
TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
TEXT: " goodbye"
```

Previously the attribute value in `<div title="Hello &amp; goodbye">` would be
a single text token. Now it will be three tokens:

```
ATTR_VALUE_TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
ATTR_VALUE_TEXT: " goodbye"
```

- ENCODED_ENTITY tokens have two parts: "decoded" and "encoded".
- ENCODED_ENTITY tokens are always preceded and followed by either TEXT tokens
  or ATTR_VALUE_TEXT tokens, depending upon the context, even if they represent
  an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 4116d5d18f refactor(compiler): support interpolation tokens when lexing attribute values (#42062)
The lexer now splits interpolation tokens out from attribute value tokens.
Previously the attribute value of `<div attr="Hello, {{ name}}">` would be a single
token. Now it will be three tokens:

```
ATTR_VALUE_TEXT: "Hello, "
ATTR_VALUE_INTERPOLATION: "{{", " name", "}}"
ATTR_VALUE_TEXT: ""
```

- ATTR_VALUE_INTERPOLATION tokens have three parts, "start marker",
  "expression" and "end marker".
- ATTR_VALUE_INTERPOLATION tokens are always preceded and followed
  by TEXT tokens, even if they represent an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 5572278826 refactor(compiler): share isQuote() via chars.ts (#42062)
This function is general purpose and by moving it into the
`chars.ts` file along with similar helpers, it can be reused
in the lexer, for instance.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin b442c4991d refactor(compiler): support interpolation tokens when lexing markup (#42062)
The lexer now splits interpolation tokens out from text tokens.

Previously the contents of `<div>Hello, {{ name}}<div>` would be a single
text token. Now it will be three tokens:

```
TEXT: "Hello, "
INTERPOLATION: "{{", " name", "}}"
TEXT: ""
```

- INTERPOLATION tokens have three parts, "start marker", "expression"
  and "end marker".
- INTERPOLATION tokens are always preceded and followed by TEXT tokens,
  even if they represent an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:18 -07:00
Pete Bacon Darwin 014763e42c refactor(compiler): remove cyclic dependencies (#42062)
This commit removes 9 cycles in the dependency graph of the compiler code.

PR Close #42062
2021-08-02 09:53:17 -07:00
Pete Bacon Darwin 86cfbf8c8a test(compiler-cli): clarify source-map expectations in compliance tests (#42062)
The compliance tests can check source-map segments against expectations
encoded into the expectation files. Previously, the encoding of the expected
segment was only delimited by whitespace, but this made it difficult to identify
segments that started or ended with whitespace.

Now these segment expectations are wrapped in double-quotes which makes
it easier to read and understand the expectation files.

PR Close #42062
2021-08-02 09:53:17 -07:00
Pete Bacon Darwin 3b92b4abd3 refactor(ngcc): remove unused import (#42062)
This import is not used in the file, so can be removed.

PR Close #42062
2021-08-02 09:53:17 -07:00
Alex Rickabaugh dd6e80aac5 refactor(bazel): extract function to patch fileNameToModuleName on host (#42974)
This commit extracts the patching operation that adds `fileNameToModuleName`
to the Angular compiler's `ts.CompilerHost` into a separate function, so
that it can be invoked in other compilation flows besides the one outlined
in `ngc-wrapped`. This is primarily needed for the xi18n operation in g3.

PR Close #42974
2021-07-30 09:29:45 -07:00
Alex Rickabaugh da50b9b5e7 refactor(compiler): remove unnecessary escapes (#42990)
This commit is part of a larger scale change to eliminate unnecessary
escapes in string literals, in advance of enabling stricter checks in
`ts_library` rules in g3.

PR Close #42990
2021-07-30 09:28:46 -07:00
Paul Gschwendtner 86e4b3cdf9 fix(dev-infra): browser archive rule should handle .dmg files (#42992)
We recently reworked our browser archive extraction to happen
at analysis time for better caching. This resulted in us breaking
the extraction of macOS dmg files so that Firefox is currently
not usable for local testing on macOS. We implement a similar special
logic for `.dmg` files to what has been done within the Bazel
webtesting rules.

PR Close #42992
2021-07-30 09:28:08 -07:00
Nichola Alkhouri 3fddcb5364 docs: Fix wrongly provided/Injected AnimalService (#42988)
In the logical tree example which demonstrate the use of `@SkipSelf` and  `@Host`, the provided and injected `AnimalService` are reversed.
PR Close #42988
2021-07-29 15:05:53 -07:00
Joe Martin d5cc87dc88 docs: Add josmar-crwdstffng to contributors list. (#42972)
Add josmar-crwdstffng to list in contributors.json.  Add josephmmartin
image file.

PR Close #42972
2021-07-28 15:56:02 -07:00
Joey Perrott b075721a49 fix(dev-infra): ensure that building environment stamp fails silently (#42985)
Previously when a failure occurred in part of building the environment stamp, the entire
process errored.  This should instead fail silently providing no value for the stamp.

PR Close #42985
2021-07-28 13:00:09 -07:00
Joey Perrott 3346cb6e4e release: cut the v12.2.0-rc.0 release (#42983) 2021-07-28 11:51:31 -07:00
1093 changed files with 24929 additions and 41545 deletions
+5 -5
View File
@@ -114,11 +114,11 @@ build:remote --cpu=k8
build:remote --host_cpu=k8
# Toolchain and platform related flags
build:remote --crosstool_top=//dev-infra/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=//dev-infra/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=//dev-infra/bazel/remote-execution:platform
build:remote --host_platform=//dev-infra/bazel/remote-execution:platform
build:remote --platforms=//dev-infra/bazel/remote-execution:platform
build:remote --crosstool_top=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --host_platform=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
# Remote instance and caching
build:remote --remote_instance_name=projects/internal-200822/instances/primary_instance
+23 -14
View File
@@ -24,20 +24,20 @@ version: 2.1
# **NOTE 2 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
# **NOTE 3 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v4-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_3: &cache_key v1-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
# folder will contain all previously used versions and ultimately cause the cache restoring to
# be slower due to its growing size.
var_4: &cache_key_fallback v4-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
var_4: &cache_key_fallback v1-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
# Windows needs its own cache key because binaries in node_modules are different.
var_3_win: &cache_key_win v4-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v4-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
var_3_win: &cache_key_win v1-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v1-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
var_5: &components_repo_unit_tests_cache_key v1-angular-components-{{ checksum "month.txt" }}-d090617912da8e70aa336aa5b4d804b1b535402e
var_6: &components_repo_unit_tests_cache_key_fallback v1-angular-components-{{ checksum "month.txt" }}
var_5: &components_repo_unit_tests_cache_key v2-angular-components-{{ checksum "month.txt" }}-d090617912da8e70aa336aa5b4d804b1b535402e
var_6: &components_repo_unit_tests_cache_key_fallback v2-angular-components-{{ checksum "month.txt" }}
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
# `build-ivy-npm-packages`.
@@ -59,11 +59,13 @@ var_9: &skip_on_pull_requests
ignore:
- /pull\/\d+/
# Filter to run a job on builds for the master branch only.
var_10: &only_on_master
# Filter to run a job on builds for the main branch only.
var_10: &only_on_main_branch
filters:
branches:
only:
- main
# TODO(BRANCH_RENAME_CLEANUP): remove
- master
# Filter to run a job on all releasable branches.
@@ -71,6 +73,8 @@ var_11: &only_release_branches
filters:
branches:
only:
- main
# TODO(BRANCH_RENAME_CLEANUP): remove
- master
- /\d+\.\d+\.x/
@@ -213,6 +217,10 @@ commands:
keys:
- *cache_key_win
- *cache_key_win_fallback
# Install @bazel/bazelisk globally and use that for the first run.
# Workaround for https://github.com/bazelbuild/rules_nodejs/issues/894
# NB: the issue was for @bazel/bazel but the same problem applies to @bazel/bazelisk
- run: yarn global add @bazel/bazelisk@$env:BAZELISK_VERSION
# On Windows `~/` is not resolved when using as a CLI value. `../` results in the same path.
- run: yarn install --frozen-lockfile --non-interactive --cache-folder ../.cache/yarn
@@ -291,6 +299,7 @@ jobs:
- run: yarn -s ng-dev pullapprove verify
- run: yarn -s ng-dev ngbot verify
- run: yarn -s ng-dev commit-message validate-range $CI_GIT_BASE_REVISION $CI_GIT_REVISION
- run: yarn -s check-tooling-setup
test:
executor:
@@ -798,11 +807,11 @@ jobs:
- setup_win
- run:
name: Build all windows CI targets
command: yarn bazel build --build_tag_filters=-ivy-only //packages/compiler-cli/...
command: bazel build --build_tag_filters=-ivy-only //packages/compiler-cli/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: yarn bazel test --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/...
command: bazel test --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/...
no_output_timeout: 15m
test_ivy_aot_win:
@@ -811,11 +820,11 @@ jobs:
- setup_win
- run:
name: Build all windows CI targets
command: yarn bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/...
command: bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: yarn bazel test --config=ivy --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //packages/localize/...
command: bazel test --config=ivy --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //packages/localize/...
no_output_timeout: 15m
# Save dependencies to use on subsequent runs.
- save_cache:
@@ -926,7 +935,7 @@ workflows:
- saucelabs_view_engine:
# Testing saucelabs via Bazel currently taking longer than the legacy saucelabs job as it
# each karma_web_test target is provisioning and tearing down browsers which is adding
# a lot of overhead. Running once daily on master only to avoid wasting resources and
# a lot of overhead. Running once daily in the main branch to avoid wasting resources and
# slowing down CI for PRs.
# TODO: Run this job on all branches (including PRs) once karma_web_test targets can
# share provisioned browsers and we can remove the legacy saucelabs job.
@@ -934,6 +943,6 @@ workflows:
- setup
triggers:
- schedule:
<<: *only_on_master
<<: *only_on_main_branch
# Runs monitoring jobs at 10:00AM every day.
cron: '0 10 * * *'
+3 -2
View File
@@ -52,7 +52,7 @@ setSecretVar CI_SECRET_PAYLOAD_FIREBASE_TOKEN "$ANGULAR_PAYLOAD_TOKEN";
# Define SauceLabs environment variables for CircleCI.
####################################################################################################
setPublicVar SAUCE_USERNAME "angular-framework";
setSecretVar SAUCE_ACCESS_KEY "0c731274ed5f-cbc9-16f4-021a-9835e39f";
setSecretVar SAUCE_ACCESS_KEY "f4bf7c639c5a-c6bb-d6a4-a4b5-800aa111";
# TODO(josephperrott): Remove environment variables once all saucelabs tests are via bazel method.
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
@@ -72,7 +72,8 @@ setPublicVar SAUCE_READY_FILE_TIMEOUT 120
# the `save_cache` path configuration in `config.yml`
setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
setPublicVar COMPONENTS_REPO_BRANCH "master"
# TODO(BRANCH_RENAME_CLEANUP): fixup branch name to point to main branch
setPublicVar COMPONENTS_REPO_BRANCH "main-branch-rename-do-not-delete"
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
setPublicVar COMPONENTS_REPO_COMMIT "d090617912da8e70aa336aa5b4d804b1b535402e"
+12 -3
View File
@@ -84,22 +84,31 @@ async function _main() {
/**
* Sort a list of fullpath refs into a list and then provide the first entry.
*
* The sort order will first find master ref, and then any semver ref, followed
* The sort order will first find the the main branch, and then any semver ref, followed
* by the rest of the refs in the order provided.
*
* Branches are sorted in this order as work is primarily done on master, and
* Branches are sorted in this order as work is primarily done on main branches, and
* otherwise on a semver branch. If neither of those were to match, the most
* likely correct branch will be the first one encountered in the list.
*/
function getRefFromBranchList(gitOutput) {
const branches = gitOutput.split('\n').map(b => b.split('/').slice(1).join('/').trim());
return branches.sort((a, b) => {
if (a === 'main') {
return -1;
}
if (b === 'main') {
return 1;
}
// TODO(BRANCH_RENAME_CLEANUP): remove
if (a === 'master') {
return -1;
}
if (b === 'master') {
return 1;
}
const aIsSemver = semverRegex.test(a);
const bIsSemver = semverRegex.test(b);
if (aIsSemver && bIsSemver) {
@@ -132,7 +141,7 @@ function getShaFromRef(ref) {
* by committerdate.
*
* example:
* upstream/master
* upstream/main
* upstream/9.0.x
* upstream/test
* upstream/1.1.x
+1
View File
@@ -12,6 +12,7 @@ body:
- common
- compiler-cli
- compiler
- core
- elements
- forms
- language-service
@@ -12,6 +12,7 @@ body:
- common
- compiler-cli
- compiler
- core
- elements
- forms
- language-service
@@ -1,6 +0,0 @@
---
name: Security Issue Disclosure
about: Report a security issue in Angular Framework, Material, or CLI
---
Please read https://angular.io/guide/security#report-issues on how to disclose security related issues.
@@ -1,11 +0,0 @@
---
name: "Support Request"
about: Questions and requests for support
---
Please do not file questions or support requests on the GitHub issues tracker.
You can get your questions answered using other communication channels. Please see:
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Thank you!
-8
View File
@@ -1,8 +0,0 @@
---
name: "Angular CLI"
about: Issues and feature requests for Angular CLI
---
Please file any Angular CLI issues at: https://github.com/angular/angular-cli/issues/new
For the time being, we keep Angular CLI issues in a separate repository.
@@ -1,8 +0,0 @@
---
name: "Angular Components"
about: Issues and feature requests for Angular Components
---
Please file any Angular Components issues at: https://github.com/angular/components/issues/new
For the time being, we keep Angular Components issues in a separate repository.
+14
View File
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Security issue disclosure
url: https://angular.io/guide/security#report-issues
about: Report a security issue in Angular Framework, CDK, Material, or CLI
- name: Angular CLI
url: https://github.com/angular/angular/issues/new/choose
about: Issues and feature requests for Angular CLI
- name: Angular Material and Components Development Kit (CDK)
url: https://github.com/angular/components/issues/new/choose
about: Issues and feature requests for Angular Material
- name: Support Request
url: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
about: Questions and requests for support
-1
View File
@@ -38,7 +38,6 @@ merge:
- 'modules/benchmarks/**'
- 'modules/system.d.ts'
- 'packages/**'
- 'dev-infra/benchmark/driver-utilities/**'
# list of patterns to ignore for the files changed by the PR
exclude:
- 'packages/*'
+14
View File
@@ -0,0 +1,14 @@
name: DevInfra
on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: angular/dev-infra/github-actions/commit-message-based-labels@7b66fb5dc44b92fb4ecbd6a7d52b67a3e15339eb
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/feature-request@f83903fe1ac848407ef81465f66588e5accb6537
- uses: angular/dev-infra/github-actions/feature-request@7b66fb5dc44b92fb4ecbd6a7d52b67a3e15339eb
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@7679cff885633cd33bf5ac7922a5304e8971a5a6
- uses: angular/dev-infra/github-actions/lock-closed@7b66fb5dc44b92fb4ecbd6a7d52b67a3e15339eb
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
+1 -2
View File
@@ -106,8 +106,7 @@ Fixes #<issue number>
# │ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
# │ elements|forms|http|language-service|localize|platform-browser|
# │ platform-browser-dynamic|platform-server|router|service-worker|
# │ upgrade|zone.js|packaging|changelog|dev-infra|docs-infra|migrations|
# │ ngcc|ve
# │ upgrade|zone.js|packaging|changelog|docs-infra|migrations|ngcc|ve
# │ https://github.com/angular/angular/blob/master/CONTRIBUTING.md#scope
# │
# └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|style|test
+1 -1
View File
@@ -1,4 +1,4 @@
import {CaretakerConfig} from '../dev-infra/caretaker/config';
import {CaretakerConfig} from '@angular/dev-infra-private/ng-dev/caretaker/config';
/** The configuration for `ng-dev caretaker` commands. */
export const caretaker: CaretakerConfig = {
+1 -1
View File
@@ -1,4 +1,4 @@
import {CommitMessageConfig} from '../dev-infra/commit-message/config';
import {CommitMessageConfig} from '@angular/dev-infra-private/ng-dev/commit-message/config';
/**
* The configuration for `ng-dev commit-message` commands.
+1 -1
View File
@@ -1,4 +1,4 @@
import {FormatConfig} from '../dev-infra/format/config';
import {FormatConfig} from '@angular/dev-infra-private/ng-dev/format/config';
/**
* Configuration for the `ng-dev format` command.
+3 -3
View File
@@ -1,11 +1,11 @@
import {GithubConfig} from '../dev-infra/utils/config';
import {GithubConfig} from '@angular/dev-infra-private/ng-dev/utils/config';
/**
* Github configuration for the `ng-dev` command. This repository is used as
* remote for the merge script and other utilities like `ng-dev pr rebase`.
*/
export const github: GithubConfig = {
owner: 'angular',
name: 'angular'
name: 'angular',
mainBranchName: 'main',
};
+18 -27
View File
@@ -1,33 +1,24 @@
import {DevInfraMergeConfig} from '../dev-infra/pr/merge/config';
import {getDefaultTargetLabelConfiguration} from '../dev-infra/pr/merge/defaults';
import {github} from './github';
import {release} from './release';
import {MergeConfig} from '@angular/dev-infra-private/ng-dev/pr/merge/config';
/**
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
* are respected by the merge script (e.g. the target labels).
*/
export const merge: DevInfraMergeConfig['merge'] = async api => {
return {
githubApiMerge: false,
claSignedLabel: 'cla: yes',
mergeReadyLabel: /^action: merge(-assistance)?/,
caretakerNoteLabel: /^(action: merge-assistance)|(PullApprove: disable)/,
commitMessageFixupLabel: 'commit message fixup',
breakingChangeLabel: 'flag: breaking change',
// We can pick any of the NPM packages as we are in a monorepo where all packages are
// published together with the same version and branching.
labels: await getDefaultTargetLabelConfiguration(api, github, release),
requiredBaseCommits: {
// PRs that target either `master` or the patch branch, need to be rebased
// on top of the latest commit message validation fix.
// These SHAs are the commits that update the required license text in the header.
'master': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
'10.0.x': '27b95ba64a5d99757f4042073fd1860e20e3ed24',
},
// `dev-infra` and `docs-infra` are not affecting the public NPM packages. Similarly,
// the `bazel` package is not considered part of the public API so that features
// can land in patch branches.
targetLabelExemptScopes: ['dev-infra', 'docs-infra', 'bazel']
};
export const merge: MergeConfig = {
githubApiMerge: false,
claSignedLabel: 'cla: yes',
mergeReadyLabel: /^action: merge(-assistance)?/,
caretakerNoteLabel: /^(action: merge-assistance)|(PullApprove: disable)/,
commitMessageFixupLabel: 'commit message fixup',
requiredBaseCommits: {
// PRs that target either `main` or the patch branch, need to be rebased
// on top of the latest commit message validation fix.
// These SHAs are the commits that update the required license text in the header.
'main': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
'10.0.x': '27b95ba64a5d99757f4042073fd1860e20e3ed24',
},
// `dev-infra` and `docs-infra` are not affecting the public NPM packages. Similarly,
// the `bazel` package is not considered part of the public API so that features
// can land in patch branches.
targetLabelExemptScopes: ['dev-infra', 'docs-infra', 'bazel']
};
+2 -2
View File
@@ -1,5 +1,5 @@
import {ReleaseConfig} from '@angular/dev-infra-private/ng-dev/release/config';
import {join} from 'path';
import {ReleaseConfig} from '../dev-infra/release/config';
/** Configuration for the `ng-dev release` command. */
export const release: ReleaseConfig = {
@@ -22,7 +22,7 @@ export const release: ReleaseConfig = {
'@angular/service-worker',
'@angular/upgrade',
],
buildPackages: async (stampForRelease: boolean) => {
buildPackages: async (stampForRelease: boolean|undefined) => {
// The buildTargetPackages function is loaded at runtime as the loading the script causes an
// invocation of bazel.
const {buildTargetPackages} = require(join(__dirname, '../scripts/build/package-builder'));
+10
View File
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"strict": true,
"target": "es2015",
"module": "commonjs",
"noEmit": true,
"skipLibCheck": true,
"types": []
},
}
+21 -8
View File
@@ -190,7 +190,6 @@ groups:
- JiaLiPassion # Jia Li
- JoostK # Joost Koehoorn
- josephperrott # Joey Perrott
- kyliau # Keen Yee Liau
- manughub # Manu Murthy
- mgechev # Minko Gechev
- mmalerba # Miles Malerba
@@ -238,6 +237,7 @@ groups:
contains_any_globs(files.exclude('packages/compiler-cli/ngcc/**'), [
'packages/compiler/**',
'packages/examples/compiler/**',
'aio/content/examples/angular-compiler-options/**',
'packages/compiler-cli/**',
'aio/content/guide/angular-compiler-options.md',
'aio/content/guide/aot-compiler.md',
@@ -543,7 +543,20 @@ groups:
'packages/compiler/src/render3/view/i18n/**',
'packages/compiler-cli/src/extract_i18n.ts',
'packages/localize/**',
'aio/content/guide/i18n.md',
'aio/content/guide/i18n-overview.md',
'aio/content/guide/i18n-common-overview.md',
'aio/content/guide/i18n-common-add-package.md',
'aio/content/guide/i18n-common-locale-id.md',
'aio/content/guide/i18n-common-format-data-locale.md',
'aio/content/guide/i18n-common-prepare.md',
'aio/content/guide/i18n-common-translation-files.md',
'aio/content/guide/i18n-common-merge.md',
'aio/content/guide/i18n-common-deploy.md',
'aio/content/guide/i18n-example.md',
'aio/content/guide/i18n-optional-overview.md',
'aio/content/guide/i18n-optional-manual-runtime-locale.md',
'aio/content/guide/i18n-optional-import-global-variants.md',
'aio/content/guide/i18n-optional-manage-marked-text.md',
'aio/content/examples/i18n/**'
])
reviewers:
@@ -570,7 +583,6 @@ groups:
users:
- alan-agius4
- alxhub
- kyliau
# =========================================================
# Framework: Router
@@ -763,7 +775,6 @@ groups:
users:
- IgorMinar
- josephperrott
- kyliau
# =========================================================
# Language Service
@@ -781,7 +792,6 @@ groups:
])
reviewers:
users:
- kyliau
- atscott
- zarend
@@ -969,6 +979,7 @@ groups:
'aio/content/guide/updating.md',
'aio/content/guide/deprecations.md',
'aio/content/guide/migration-legacy-message-id.md',
'aio/content/examples/deprecation-guide/**',
'aio/content/guide/migration-renderer.md',
'aio/content/guide/migration-undecorated-classes.md',
'aio/content/guide/migration-dynamic-flag.md',
@@ -1021,7 +1032,7 @@ groups:
users:
- alan-agius4
- clydin
- kyliau
- dgp1130
- IgorMinar
reviews:
request: -1 # request reviews from everyone
@@ -1128,6 +1139,8 @@ groups:
'aio/content/guide/docs-style-guide.md',
'aio/content/examples/docs-style-guide/**',
'aio/content/images/guide/docs-style-guide/**',
'aio/content/guide/localized-documentation.md',
'aio/content/guide/localizing-angular.md',
'aio/content/guide/reviewing-content.md',
'aio/content/guide/updating-content-github-ui.md',
'aio/content/guide/updating-search-keywords.md',
@@ -1155,10 +1168,10 @@ groups:
'.ng-dev/**',
'.vscode/**',
'.yarn/**',
'dev-infra/**',
'docs/*.md',
'docs/images/**',
'goldens/*',
'goldens/public-api/manage.js',
'modules/*',
'packages/*',
'packages/examples/test-utils/**',
@@ -1202,7 +1215,7 @@ groups:
- *no-groups-above-this-rejected
- *can-be-global-approved
- >
contains_any_globs(files, [
contains_any_globs(files.exclude("goldens/public-api/manage.js"), [
'goldens/public-api/**',
'docs/NAMING.md',
'aio/content/errors/*.md',
+4 -4
View File
@@ -6,15 +6,15 @@ This folder contains opt-in [Workspace Settings](https://code.visualstudio.com/d
To use the recommended configurations follow the steps below:
- install the recommneded extensions in `.vscode/extensions.json`
- install the recommended extensions in `.vscode/extensions.json`
- copy (or link) `.vscode/recommended-settings.json` to `.vscode/settings.json`
- copy (or link) `.vscode/recommended-launch.json` to `.vscode/launch.json`
- copy (or link) `.vscode/recommended-tasks.json` to `.vscode/tasks.json`
- restart the editor
If you already have your custom workspace settings you should instead manually merge the file contents.
If you already have your custom workspace settings, you should instead manually merge the file contents.
This isn't an automatic process so you will need to repeat it when settings are updated.
This isn't an automatic process, so you will need to repeat it when settings are updated.
To see the recommended extensions select "Extensions: Show Recommended Extensions" in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
@@ -22,4 +22,4 @@ To see the recommended extensions select "Extensions: Show Recommended Extension
If you wish to add extra configuration items please keep in mind any modifications you make here will be used by many users.
Try to keep these settings/configuations to things that help facilitate the development process and avoid altering the user workflow whenever possible.
Try to keep these settings/configurations to things that help facilitate the development process and avoid altering the user workflow whenever possible.
+305 -1
View File
@@ -1,3 +1,307 @@
<a name="12.2.17"></a>
# 12.2.17 (2022-11-22)
## Breaking Changes
### core
- Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.
### core
| Commit | Type | Description |
| -- | -- | -- |
| [b871db57da](https://github.com/angular/angular/commit/b871db57daab10ef6d4d92041177458f19fd3ebd) | fix | hardening attribute and property binding rules for <iframe> elements |
## Special Thanks
Andrew Kushnir, Joey Perrott and Paul Gschwendtner
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.16"></a>
# 12.2.16 (2022-01-27)
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [460befd693](https://github.com/angular/angular/commit/460befd693d1eca69213211011113c5bb02e11b6) | fix | support element accesses for export declarations ([#44824](https://github.com/angular/angular/pull/44824)) |
## Special Thanks
Andrew Kushnir and JoostK
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.15"></a>
# 12.2.15 (2021-12-10)
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [b6554d75cd](https://github.com/angular/angular/commit/b6554d75cd3ac8a904820f7cd051d926c74460bf) | fix | correctly resolve UMD dependencies ([#44382](https://github.com/angular/angular/pull/44382)) |
## Special Thanks
Alex Rickabaugh and George Kalpakas
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.15"></a>
# 12.2.15 (2021-12-08)
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [b6554d75cd](https://github.com/angular/angular/commit/b6554d75cd3ac8a904820f7cd051d926c74460bf) | fix | correctly resolve UMD dependencies ([#44382](https://github.com/angular/angular/pull/44382)) |
## Special Thanks
George Kalpakas
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.14"></a>
# 12.2.14 (2021-12-01)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [e3db0385b6](https://github.com/angular/angular/commit/e3db0385b6ae18f35b16d5a7fcbfac49ef729330) | fix | ensure that partially compiled queries can handle forward references ([#44124](https://github.com/angular/angular/pull/44124)) |
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [a8be244113](https://github.com/angular/angular/commit/a8be244113d68865da9ec732291d7b79e26a0f1f) | fix | correctly report error when collecting dependencies of UMD module ([#44245](https://github.com/angular/angular/pull/44245)) |
| [fc072935ee](https://github.com/angular/angular/commit/fc072935ee0bcfc5b228ee81ba4261ee8f7b1756) | fix | support the UMD wrapper function format emitted by Webpack ([#44245](https://github.com/angular/angular/pull/44245)) |
## Special Thanks
George Kalpakas, Pete Bacon Darwin and iRealNirmal
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.13"></a>
# 12.2.13 (2021-11-03)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [9a89db790f](https://github.com/angular/angular/commit/9a89db790f2453c11df6778c3c8639114797ae28) | fix | avoid broken references in .d.ts files due to @internal markers ([#43965](https://github.com/angular/angular/pull/43965)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8f402c9d06](https://github.com/angular/angular/commit/8f402c9d06f4e6f16759f73df44438f2ba725a30) | fix | support `InjectFlags` argument in `NodeInjector.get()` ([#41592](https://github.com/angular/angular/pull/41592)) |
## Special Thanks
Alan Agius, George Kalpakas, Jochen Kraushaar, Joe Martin (Crowdstaffing), JoostK and vthinkxie
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.12"></a>
# 12.2.12 (2021-10-27)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [112557497c](https://github.com/angular/angular/commit/112557497cf75b5e41e0f490df921a243ace1aeb) | fix | avoid broken references in .d.ts files due to @internal markers ([#43527](https://github.com/angular/angular/pull/43527)) |
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [067ae54d46](https://github.com/angular/angular/commit/067ae54d46ce7480d2dccd4aa3fd4206737c02d1) | fix | support alternate UMD layout when adding new imports ([#43931](https://github.com/angular/angular/pull/43931)) |
## Special Thanks
Alan Agius, Andrew Kushnir, George Kalpakas, Jessica Janiuk, Joey Perrott, JoostK, Mladen Jakovljević, Virginia Dooley, amayer42, dirk diebel and ericcheng2005
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.11"></a>
# 12.2.11 (2021-10-20)
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [cab21cea7a](https://github.com/angular/angular/commit/cab21cea7ae0c99603333e563d6c29d6a7787cc8) | fix | support alternate wrapper function layout for UMD ([#43879](https://github.com/angular/angular/pull/43879)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [58c11865ac](https://github.com/angular/angular/commit/58c11865ac08d9112735f31d4222d794f0dd0054) | fix | Do not clear currentNavigation if already set to next one ([#43852](https://github.com/angular/angular/pull/43852)) |
## Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, David Shevitz, George Kalpakas, Joe Martin (Crowdstaffing), Natalia Venditto, Pete Bacon Darwin, Younes Jaaidi and dario-piotrowicz
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.10"></a>
# 12.2.10 (2021-10-13)
This release contains various API docs improvements.
## Special Thanks
Alan Agius, Daniel Díaz, David Shevitz, Doug Parker, George Kalpakas, Joe Martin (Crowdstaffing), Tanguy Nodet, Thomas Turrell-Croft, dario-piotrowicz, hchiam, markostanimirovic and mgechev
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.9"></a>
# 12.2.9 (2021-10-06)
### core
| Commit | Type | Description |
| -- | -- | -- |
| [b4b441077a](https://github.com/angular/angular/commit/b4b441077ad3a2991e7c04beb288bee1945a83bd) | fix | handle invalid constructor parameters in partial factory declarations ([#43619](https://github.com/angular/angular/pull/43619)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [7f6050587d](https://github.com/angular/angular/commit/7f6050587deb4796b6a0cc93445fab9e6b7ff826) | fix | unset attachRef when router-outlet is destroyed to avoid mounting a destroyed component ([#43697](https://github.com/angular/angular/pull/43697)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [c4ecc07838](https://github.com/angular/angular/commit/c4ecc07838de5149a360b11de1c8c4ef18b1fe77) | fix | make `ngsw.json` generation deterministic and correct ([#43679](https://github.com/angular/angular/pull/43679)) |
## Special Thanks
Alan Agius, Daniel Díaz, George Kalpakas, JoostK, Kristiyan Kostadinov, Pete Bacon Darwin, Wey-Han Liaw, dario-piotrowicz, iRealNirmal, little-pinecone, mgechev, ultrasonicsoft and xiaohanxu-nick
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.8"></a>
# 12.2.8 (2021-09-30)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [c1338bf837](https://github.com/angular/angular/commit/c1338bf837c7fe2bfb10974bd08d1ad013aaebbc) | fix | correctly interpret token arrays in @Injectable `deps` ([#43226](https://github.com/angular/angular/pull/43226)) |
### ngcc
| Commit | Type | Description |
| -- | -- | -- |
| [69299f7d4d](https://github.com/angular/angular/commit/69299f7d4d595141dae7a63e4faa35691a2d8887) | fix | do not fail for packages which correspond with `Object` members ([#43589](https://github.com/angular/angular/pull/43589)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [3cf41354ae](https://github.com/angular/angular/commit/3cf41354ae6bf988a9477379e0b28afaa6d7ce5b) | fix | do not unassign clients from a broken version ([#43518](https://github.com/angular/angular/pull/43518)) |
## Special Thanks
Adrien Crivelli, Alex Rickabaugh, Andrew Scott, Bobby Galli, Chris, Daniel Díaz, Dario Piotrowicz, George Kalpakas, Joe Martin (Crowdstaffing), JoostK, Pete Bacon Darwin, Rafael Santana, Raj Sekhar, Ricardo Chavarria, Teri Glover, Virginia Dooley, dario-piotrowicz, enisfr and wszgrcy
<a name="12.2.7"></a>
# 12.2.7 (2021-09-22)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [2bb4bf1468](https://github.com/angular/angular/commit/2bb4bf1468935a49a3d478d0cc13e7eb7fd1b98a) | fix | titlecase pipe incorrectly handling numbers ([#43476](https://github.com/angular/angular/pull/43476)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [9c8a1f8a71](https://github.com/angular/angular/commit/9c8a1f8a71be9b8380afbdc61ee7ee60f24488b4) | fix | include leading whitespace in source-spans of i18n messages ([#43132](https://github.com/angular/angular/pull/43132)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [defb02f11e](https://github.com/angular/angular/commit/defb02f11e2bd75452e8722e1474bb230d189864) | fix | handle directives that refer to a namespaced class in a type parameter bound ([#43511](https://github.com/angular/angular/pull/43511)) |
### platform-browser
| Commit | Type | Description |
| -- | -- | -- |
| [adc7c56ede](https://github.com/angular/angular/commit/adc7c56ede7ad34a90f5ef1b878e261836b25c45) | fix | improve error message for missing animation trigger ([#41356](https://github.com/angular/angular/pull/41356)) |
## Special Thanks
Andrew Scott, Daniel Díaz, George Kalpakas, JoostK, Kristiyan Kostadinov, Mwiku, Pete Bacon Darwin, Teri Glover, Virginia Dooley, Xiaohanxu1996, dario-piotrowicz and kirjs
<a name="12.2.6"></a>
# 12.2.6 (2021-09-15)
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [141fde1632](https://github.com/angular/angular/commit/141fde1632b4834449cfd48dcebfc8b1b7d58e09) | fix | emit pure annotations to static property initializers ([#43344](https://github.com/angular/angular/pull/43344)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [ca510c87c5](https://github.com/angular/angular/commit/ca510c87c5a890c4b22fd364c58667adef90a1e0) | fix | emit pure annotations to static property initializers ([#43344](https://github.com/angular/angular/pull/43344)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [4034f252c9](https://github.com/angular/angular/commit/4034f252c9707dabd01386843f7c278f3d2e4302) | fix | Allow renavigating to failed URLs ([#43424](https://github.com/angular/angular/pull/43424)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [a102b27641](https://github.com/angular/angular/commit/a102b27641e3ad00401dd6d2635b9ddcf1151251) | fix | clear service worker cache in safety worker ([#43324](https://github.com/angular/angular/pull/43324)) |
## Special Thanks
Alan Agius, Amadou Sall, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bjarki, David Shevitz, George Kalpakas, Joe Martin (Crowdstaffing), Michele Stieven, Naveed Ahmed, dario-piotrowicz, mezhik91 and mgechev
<a name="12.2.5"></a>
# 12.2.5 (2021-09-08)
### router
| Commit | Description |
| -- | -- |
| [a0bd6e90f9](https://github.com/angular/angular/commit/a0bd6e90f987377320b3b337d8c3a33235658e9a) | fix: add more context to `Unhandled Navigation Error` ([#43291](https://github.com/angular/angular/pull/43291)) |
## Special Thanks:
Alan Agius, Charles Barnes, Enea Jahollari, George Kalpakas, Ikko Ashimine, Paul Gschwendtner, Pete Bacon Darwin, William Sedlacek and dario-piotrowicz
<a name="12.2.4"></a>
# 12.2.4 (2021-09-01)
### compiler-cli
| Commit | Description |
| -- | -- |
| [8233906be2](https://github.com/angular/angular/commit/8233906be25e19da6d8115094616d3e4b5e36fea) | fix: Emit type annotations for synthesized decorator fields ([#43021](https://github.com/angular/angular/pull/43021)) |
## Special Thanks:
Andrew Scott, Daniel Trevino, George Kalpakas, Joey Perrott, Kristiyan Kostadinov, nickreid and segunb
<a name="12.2.3"></a>
# 12.2.3 (2021-08-25)
### service-worker
| Commit | Description |
| -- | -- |
| [fc7f92159d](https://github.com/angular/angular/commit/fc7f92159df16e894d9909cfc8969ed4b7d9924a) | fix: NPE if onActionClick is undefined ([#43210](https://github.com/angular/angular/pull/43210)) |
## Special Thanks:
Daniel Trevino, Erik Slack, George Kalpakas, dario-piotrowicz and shlasouski
<a name="12.2.2"></a>
# 12.2.2 (2021-08-18)
### animations
| Commit | Description |
| -- | -- |
| [bb6555979d](https://github.com/angular/angular/commit/bb6555979dd02e706f7e98022b9c37a4f54db1ba) | fix: add pure annotations to static property initializers ([#43064](https://github.com/angular/angular/pull/43064)) |
### core
| Commit | Description |
| -- | -- |
| [738b23347e](https://github.com/angular/angular/commit/738b23347e5eeadfa0321d1429537837dba5e4c1) | fix: add pure annotations to static property initializers ([#43064](https://github.com/angular/angular/pull/43064)) |
### platform-browser
| Commit | Description |
| -- | -- |
| [535837e617](https://github.com/angular/angular/commit/535837e617a0434f8e7bd9071cc4d8c27fd9f373) | perf: avoid intermediate arrays in server transition ([#43145](https://github.com/angular/angular/pull/43145)) |
### router
| Commit | Description |
| -- | -- |
| [6449590ec8](https://github.com/angular/angular/commit/6449590ec81eff0873af911fb65679b5a77db27b) | fix: eagerly update internal state on browser-triggered navigations ([#43102](https://github.com/angular/angular/pull/43102)) |
## Special Thanks:
Andrew Scott, Aristeidis Bampakos, Charles Lyding, Edoardo Dusi, George Kalpakas, Joe Martin (Crowdstaffing), Joey Perrott, Kirk Larkin, Kristiyan Kostadinov, Pete Bacon Darwin, TIffany Davis, Theoklitos Bampouris, ali, dario-piotrowicz and pichuser
<a name="12.2.1"></a>
# 12.2.1 (2021-08-11)
### router
| Commit | Description |
| -- | -- |
| [dd3abdb9d9](https://github.com/angular/angular/commit/dd3abdb9d9b2c4363fb1f468a05bf449b55f55a5) | fix(router): ensure check for match options is compatible with property renaming ([#43086](https://github.com/angular/angular/pull/43086)) |
## Special Thanks:
Amadou Sall, Andrew Kushnir, Andrew Scott, Daniel Trevino, Erik Slack, Fabien BERNARD, George Kalpakas, Jeroen van Warmerdam, Joey Perrott, Tim Gates and Vugar_Abdullayev
<a name="12.2.0"></a>
# 12.2.0 (2021-08-04)
### core
| Commit | Description |
| -- | -- |
| [bd7f0d8b70](https://github.com/angular/angular/commit/bd7f0d8b70150a7e4e7550f4380a2e731cf2b942) | fix(core): incorrect error reported when trying to re-create view which had an error during creation ([#43005](https://github.com/angular/angular/pull/43005)) |
### language-service
| Commit | Description |
| -- | -- |
| [aace1e71d8](https://github.com/angular/angular/commit/aace1e71d8fb5e1e52fcd86e2a26892d1016c43e) | fix(language-service): global autocomplete doesn't work when the user tries to modify the symbol ([#42923](https://github.com/angular/angular/pull/42923)) |
## Special Thanks:
Alex Rickabaugh, Joe Martin, Joey Perrott, Kristiyan Kostadinov, Nichola Alkhouri, Paul Gschwendtner, Pete Bacon Darwin, atscott, dario-piotrowicz and ivanwonder
<a name="12.2.0-rc.0"></a>
# 12.2.0-rc.0 (2021-07-28)
### compiler-cli
| Commit | Description |
| -- | -- |
| [ed9cfb674f](https://github.com/angular/angular/commit/ed9cfb674f8e52b416ccdaf9aa9c46955b8448f5) | fix(compiler-cli): use correct module resolution context for absolute imports in .d.ts files ([#42879](https://github.com/angular/angular/pull/42879)) |
| [5fb23eccea](https://github.com/angular/angular/commit/5fb23ecceaccf0629308dd50210b65f67d51f024) | perf(compiler-cli): skip analysis in incremental builds for files without Angular behavior ([#42562](https://github.com/angular/angular/pull/42562)) |
### core
| Commit | Description |
| -- | -- |
| [eefe1682e8](https://github.com/angular/angular/commit/eefe1682e8099b73b6e50bb227b5a7f63105c63d) | fix(core): correctly handle `null` or `undefined` in `ErrorHandler#handleError()` ([#42881](https://github.com/angular/angular/pull/42881)) |
### forms
| Commit | Description |
| -- | -- |
| [1d9d02696e](https://github.com/angular/angular/commit/1d9d02696eadbee2c2f719e432efca22f1e494e9) | feat(forms): add hasValidators, addValidators, and removeValidators methods (for both sync and async) ([#42838](https://github.com/angular/angular/pull/42838)) |
| [a502279592](https://github.com/angular/angular/commit/a50227959222f39884aac284544d1626aee5ca64) | feat(forms): allow minLength/maxLength validator to be bound to `null` ([#42565](https://github.com/angular/angular/pull/42565)) |
### language-service
| Commit | Description |
| -- | -- |
| [7c35ca0e00](https://github.com/angular/angular/commit/7c35ca0e0030f2ded12ddca9092e31f510cebeb1) | feat(language-service): support autocomplete string literal union types in templates ([#42729](https://github.com/angular/angular/pull/42729)) |
### router
| Commit | Description |
| -- | -- |
| [0d81b007e4](https://github.com/angular/angular/commit/0d81b007e48a0ac801d2614601fb8180a3517865) | fix(router): add missing outlet events to RouterOutletContract ([#42431](https://github.com/angular/angular/pull/42431)) |
| [dbae00195e](https://github.com/angular/angular/commit/dbae00195e114ac8b967201283962a7e2c0581b4) | feat(router): ability to provide custom route reuse strategy via DI for `RouterTestingModule` ([#42434](https://github.com/angular/angular/pull/42434)) |
## Special Thanks:
Andrew Scott, Daniel Trevino, Dmitrij Kuba, Dylan Hunn, George Kalpakas, Joey Perrott, JoostK, Paul Gschwendtner, Pete Bacon Darwin, Steven Masala, Teri Glover, Vladyslav, Yuvaraj, codebriefcase, iRealNirmal and ivanwonder
<a name="12.1.4"></a>
# 12.1.4 (2021-07-28)
### compiler-cli
@@ -8018,4 +8322,4 @@ Note: 2.1.0-beta.0 release also contains all the changes present in the 2.0.1 re
<a name="2.0.0"></a>
# [2.0.0 proprioception-reinforcement](https://github.com/angular/angular/compare/2.0.0-rc.7...2.0.0) (2016-09-14)
# [2.0.0 proprioception-reinforcement](https://github.com/angular/angular/compare/2.0.0-rc.7...2.0.0) (2016-09-14)
+19 -8
View File
@@ -58,9 +58,9 @@ If you would like to *implement* a new feature, please consider the size of the
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
Before you submit an issue, please search the issue tracker. An issue for your problem might already exist and the discussion might inform you of workarounds readily available.
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
We want to fix all the issues as soon as possible, but before fixing a bug, we need to reproduce and confirm it.
In order to reproduce bugs, we require that you provide a minimal reproduction.
Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions.
@@ -235,8 +235,6 @@ When the body is present it must be at least 20 characters long and must conform
The `footer` is optional. The [Commit Message Footer](#commit-footer) format describes what the footer is used for and the structure it must have.
Any line of the commit message cannot be longer than 100 characters.
#### <a name="commit-header"></a>Commit Message Header
@@ -248,8 +246,7 @@ Any line of the commit message cannot be longer than 100 characters.
│ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
│ elements|forms|http|language-service|localize|platform-browser|
│ platform-browser-dynamic|platform-server|router|service-worker|
│ upgrade|zone.js|packaging|changelog|dev-infra|docs-infra|migrations|
│ ngcc|ve
│ upgrade|zone.js|packaging|changelog|docs-infra|migrations|ngcc|ve
│
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
```
@@ -302,7 +299,7 @@ There are currently a few exceptions to the "use package name" rule:
* `changelog`: used for updating the release notes in CHANGELOG.md
* `dev-infra`: used for dev-infra related changes within the directories /scripts, /tools and /dev-infra
* `dev-infra`: used for dev-infra related changes within the directories /scripts and /tools
* `docs-infra`: used for docs-app (angular.io) related changes within the /aio directory of the repo
@@ -334,7 +331,8 @@ You can include a comparison of the previous behavior with the new behavior in o
#### <a name="commit-footer"></a>Commit Message Footer
The footer can contain information about breaking changes and is also the place to reference GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
The footer can contain information about breaking changes and deprecations and is also the place to reference GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
For example:
```
BREAKING CHANGE: <breaking change summary>
@@ -345,8 +343,21 @@ BREAKING CHANGE: <breaking change summary>
Fixes #<issue number>
```
or
```
DEPRECATED: <what is deprecated>
<BLANK LINE>
<deprecation description + recommended update path>
<BLANK LINE>
<BLANK LINE>
Closes #<pr number>
```
Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions.
Similarly, a Deprecation section should start with "DEPRECATED: " followed by a short description of what is deprecated, a blank line, and a detailed description of the deprecation that also mentions the recommended update path.
### Revert commits
+3 -3
View File
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "4681ca88d512d57196d064d1441549080d8d17d119174a1229d1717a16a4a489",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-beta.1/rules_nodejs-4.0.0-beta.1.tar.gz"],
sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"],
)
# Check the rules_nodejs version and download npm dependencies
@@ -44,7 +44,7 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"
web_test_repositories()
load("//dev-infra/bazel/browsers:browser_repositories.bzl", "browser_repositories")
load("@npm//@angular/dev-infra-private/bazel/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
+1
View File
@@ -27,6 +27,7 @@
"style": "kebab-case"
}
],
"max-len": ["error" , 120],
"@angular-eslint/directive-selector": [
"error",
{
@@ -6,4 +6,4 @@ TODO (gkalpak): Add docs. Mention:
Relevant files: `aio/aio-builds-setup/scripts/test.sh`
- Deploying from CI.
Relevant files: `.circleci/config.yml`, `scripts/ci/deploy.sh`, `aio/scripts/build-artifacts.sh`,
`aio/scripts/deploy-to-firebase.js`
`aio/scripts/deploy-to-firebase/index.mjs`
+5
View File
@@ -138,6 +138,11 @@
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"headers": {
"Content-Security-Policy": "require-trusted-types-for 'script'; trusted-types angular angular#bundler angular#unsafe-bypass aio#analytics google#safe"
}
},
"configurations": {
"next": {
"browserTarget": "site:build:next"
+3 -3
View File
@@ -27,7 +27,7 @@ ng config --global cli.analyticsSharing.tracking UA-123456-12
To turn off this feature, run the following command:
<code-example language="sh">
ng config --global --remove cli.analyticsSharing
ng config --global cli.analyticsSharing undefined
</code-example>
## Per user tracking
@@ -36,11 +36,11 @@ You can add a custom user ID to the global configuration, in order to identify u
If that user enables CLI analytics for their own project, your analytics display tracks and labels their individual usage.
<code-example language="sh">
ng config --global cli.analyticsSharing.user SOME_USER_NAME
ng config --global cli.analyticsSharing.uuid SOME_USER_NAME
</code-example>
To generate a new random user ID, run the following command:
<code-example language="sh">
ng config --global cli.analyticsSharing.user ""
ng config --global cli.analyticsSharing.uuid ""
</code-example>
+71
View File
@@ -0,0 +1,71 @@
@name Unsafe bindings on an iframe element
@category runtime
@shortDescription Unsafe bindings on an iframe element
@description
You see this error when Angular detects an attribute binding or a property binding on an `<iframe>` element using the following property names:
* sandbox
* allow
* allowFullscreen
* referrerPolicy
* csp
* fetchPriority
The mentioned attributes affect the security model setup for `<iframe>`s
and it's important to apply them before setting the `src` or `srcdoc` attributes.
To enforce that, Angular requires these attributes to be set on `<iframe>`s as
static attributes, so the values are set at the element creation time and they
remain the same throughout the lifetime of an `<iframe>` instance.
The error is thrown when a property binding with one of the mentioned attribute names is used:
```html
<iframe [sandbox]="'allow-scripts'" src="..."></iframe>
```
or when it's an attribute bindings:
```html
<iframe [attr.sandbox]="'allow-scripts'" src="..."></iframe>
```
Also, the error is thrown when a similar pattern is used in Directive's host bindings:
```typescript
@Directive({
selector: 'iframe',
host: {
'[sandbox]': `'allow-scripts'`,
'[attr.sandbox]': `'allow-scripts'`,
}
})
class IframeDirective {}
```
@debugging
The error message includes the name of the component with the template where
an `<iframe>` element with unsafe bindings is located.
The recommended solution is to use the mentioned attributes as static ones, for example:
```html
<iframe sandbox="allow-scripts" src="..."></iframe>
```
If you need to have different values for these attributes (depending on various conditions),
you can use an `*ngIf` or an `*ngSwitch` on an `<iframe>` element:
```html
<iframe *ngIf="someConditionA" sandbox="allow-scripts" src="..."></iframe>
<iframe *ngIf="someConditionB" sandbox="allow-forms" src="..."></iframe>
<iframe *ngIf="someConditionC" sandbox="allow-popups" src="..."></iframe>
```
<!-- links -->
<!-- external links -->
<!-- end links -->
@reviewed 2022-05-27
+8
View File
@@ -56,6 +56,7 @@ dist/
!systemjs.config.*.js
!karma-test-shim.*.js
!copy-dist-files.js
!i18n/angular.json
# AngularJS files
!**/*.ajs.js
@@ -98,3 +99,10 @@ upgrade-phonecat-3-final/rollup-config.js
# schematics
!schematics-for-libraries/projects/my-lib/package.json
#angular-compiler-options
!angular-compiler-options/tsconfig.json
!angular-compiler-options/tsconfig.app.json
# deprecated-example
!deprecation-guide/angular.package.json
View File
@@ -0,0 +1,20 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
// Add your e2e tests here
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
@@ -0,0 +1,19 @@
{
"projectType": "cli",
"overrideBoilerplate": [
"tsconfig.json",
"tsconfig.app.json"
],
"tests": [
{
"cmd": "yarn",
"args": [
"e2e",
"--protractor-config=e2e/protractor-puppeteer.conf.js",
"--no-webdriver-update",
"--port={PORT}"
]
}
]
}
@@ -0,0 +1 @@
<h1>Replace the src folder in this {{title}} with yours.</h1>
@@ -0,0 +1,20 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
// Add your unit tests here
});
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'example';
}
@@ -0,0 +1,16 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ponyracer</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
@@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -0,0 +1,18 @@
{
"description": "Angular Compiler Options",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*",
"!doc-files/**/*",
"!tsconfig.json",
"!tsconfig.app.json"
],
"tags": [
[
"angular",
"compiler",
"options"
]
]
}
@@ -0,0 +1,45 @@
// #docplaster ...
/* To learn more about this file see: https://angular.io/config/tsconfig. */
// #docregion angular-compiler-options-app
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
// #enddocregion angular-compiler-options-app
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts",
"src/**/*-specs.ts",
"src/**/*.avoid.ts",
"src/**/*.0.ts",
"src/**/*.1.ts",
"src/**/*.1b.ts",
"src/**/*.2.ts",
"src/**/*.3.ts",
"src/**/*.4.ts",
"src/**/*.5.ts",
"src/**/*.6.ts",
"src/**/*.7.ts",
"src/**/testing"
],
// #docregion angular-compiler-options-app
"angularCompilerOptions": {
"strictTemplates": true,
"preserveWhitespaces": true,
// #enddocregion angular-compiler-options-app
"sourceMap": true,
"declaration": false
// #docregion angular-compiler-options-app
},
}
// #enddocregion angular-compiler-options-app
@@ -0,0 +1,37 @@
// #docplaster ...
/* To learn more about this file see: https://angular.io/config/tsconfig. */
// #docregion angular-compiler-options
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
// #enddocregion angular-compiler-options
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
// #docregion angular-compiler-options
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
// #enddocregion angular-compiler-options
"strictInputAccessModifiers": true,
"strictTemplates": true
// #docregion angular-compiler-options
}
}
// #enddocregion angular-compiler-options
@@ -205,8 +205,8 @@ describe('Animation Tests', () => {
const heroesList = filterStagger.getHeroesList();
const total = await heroesList.count();
const formInput = filterStagger.getFormInput();
await formInput.sendKeys('Mag');
const input = filterStagger.getInput();
await input.sendKeys('Mag');
await browser.wait(async () => await heroesList.count() === 2, 2000);
@@ -14,7 +14,7 @@ export function getHeroesList() {
return getComponentContainer().all(by.css('li'));
}
export function getFormInput() {
const formInput = () => by.css('form > input');
return locate(getPage(), formInput());
export function getInput() {
const input = () => by.css('input');
return locate(getPage(), input());
}
@@ -3,7 +3,7 @@ import {
transition, animate, style, query
} from '@angular/animations';
export const transAnimation = animation([
export const transitionAnimation = animation([
style({
height: '{{ height }}',
opacity: '{{ opacity }}',
@@ -23,7 +23,9 @@ import { slideInAnimation } from './animations';
// #enddocregion decorator
slideInAnimation
// #docregion decorator
// #enddocregion toggle-app-animations, define
// animation triggers go here
// #docregion toggle-app-animations, define
]
})
// #enddocregion decorator, define
@@ -34,7 +36,7 @@ export class AppComponent {
// #docregion prepare-router-outlet
prepareRoute(outlet: RouterOutlet) {
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
return outlet?.activatedRouteData?.animation;
}
// #enddocregion prepare-router-outlet
@@ -31,14 +31,14 @@ import { InsertRemoveComponent } from './insert-remove.component';
{ path: 'open-close', component: OpenClosePageComponent },
{ path: 'status', component: StatusSliderPageComponent },
{ path: 'toggle', component: ToggleAnimationsPageComponent },
{ path: 'heroes', component: HeroListPageComponent, data: {animation: 'FilterPage'} },
{ path: 'heroes', component: HeroListPageComponent,
data: { animation: 'FilterPage' } },
{ path: 'hero-groups', component: HeroListGroupPageComponent },
{ path: 'enter-leave', component: HeroListEnterLeavePageComponent },
{ path: 'auto', component: HeroListAutoCalcPageComponent },
{ path: 'insert-remove', component: InsertRemoveComponent},
{ path: 'home', component: HomeComponent, data: {animation: 'HomePage'} },
{ path: 'about', component: AboutComponent, data: {animation: 'AboutPage'} },
{ path: 'home', component: HomeComponent, data: { animation: 'HomePage' } },
{ path: 'about', component: AboutComponent, data: { animation: 'AboutPage' } },
])
],
// #enddocregion route-animation-data
@@ -36,7 +36,7 @@ import { Hero } from './hero';
width: 120,
transform: 'translateX(0)', opacity: 1
})),
transition('void => *', [
transition(':enter', [
style({ width: 10, transform: 'translateX(50px)', opacity: 0 }),
group([
animate('0.3s 0.1s ease', style({
@@ -48,7 +48,7 @@ import { Hero } from './hero';
}))
])
]),
transition('* => void', [
transition(':leave', [
group([
animate('0.3s ease', style({
transform: 'translateX(50px)',
@@ -1,16 +1,13 @@
<!-- #docplaster -->
<h2>Filter/Stagger</h2>
<form>
<label for="search">Search heroes: </label>
<input type="text"
id="search"
#criteria (input)="updateCriteria(criteria.value)"
placeholder="Search heroes">
</form>
<!-- #docregion filter-animations -->
<ul class="heroes" [@filterAnimation]="heroTotal">
<label for="search">Search heroes: </label>
<input type="text" id="search" #criteria
(input)="updateCriteria(criteria.value)"
placeholder="Search heroes">
<ul class="heroes" [@filterAnimation]="heroesTotal">
<!-- #enddocregion filter-animations -->
<li *ngFor="let hero of heroes" class="hero">
<div class="inner">
@@ -17,10 +17,11 @@ import { Hero } from './hero';
// #enddocregion filter-animations
trigger('pageAnimations', [
transition(':enter', [
query('.hero, form', [
query('.hero', [
style({opacity: 0, transform: 'translateY(-100px)'}),
stagger(-30, [
animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' }))
stagger(30, [
animate('500ms cubic-bezier(0.35, 0, 0.25, 1)',
style({ opacity: 1, transform: 'none' }))
])
])
])
@@ -32,7 +33,7 @@ import { Hero } from './hero';
transition(':enter, * => 0, * => -1', []),
transition(':increment', [
query(':enter', [
style({ opacity: 0, width: '0px' }),
style({ opacity: 0, width: 0 }),
stagger(50, [
animate('300ms ease-out', style({ opacity: 1, width: '*' })),
]),
@@ -41,13 +42,12 @@ import { Hero } from './hero';
transition(':decrement', [
query(':leave', [
stagger(50, [
animate('300ms ease-out', style({ opacity: 0, width: '0px' })),
animate('300ms ease-out', style({ opacity: 0, width: 0 })),
]),
])
]),
]),
// #enddocregion increment
// #docregion page-animations
]
})
export class HeroListPageComponent implements OnInit {
@@ -56,8 +56,8 @@ export class HeroListPageComponent implements OnInit {
public animatePage = true;
// #docregion filter-animations
heroTotal = -1;
// #enddocregion filter-animations
heroesTotal = -1;
get heroes() { return this._heroes; }
private _heroes: Hero[] = [];
@@ -71,12 +71,11 @@ export class HeroListPageComponent implements OnInit {
this._heroes = HEROES.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase()));
const newTotal = this.heroes.length;
if (this.heroTotal !== newTotal) {
this.heroTotal = newTotal;
if (this.heroesTotal !== newTotal) {
this.heroesTotal = newTotal;
} else if (!criteria) {
this.heroTotal = -1;
this.heroesTotal = -1;
}
}
// #docregion filter-animations
}
// #enddocregion filter-animations
@@ -2,14 +2,14 @@
// #docregion reusable
import { Component } from '@angular/core';
import { transition, trigger, useAnimation } from '@angular/animations';
import { transAnimation } from './animations';
import { transitionAnimation } from './animations';
@Component({
selector: 'app-open-close-reusable',
animations: [
trigger('openClose', [
transition('open => closed', [
useAnimation(transAnimation, {
useAnimation(transitionAnimation, {
params: {
height: 0,
opacity: 1,
@@ -22,7 +22,7 @@ import { trigger, transition, state, animate, style } from '@angular/animations'
state('closed', style({
width: '100px',
opacity: 0.8,
backgroundColor: '#c6ecff'
backgroundColor: 'blue'
})),
transition('* => *', [
animate('1s')
@@ -21,7 +21,7 @@ import { trigger, transition, state, animate, style, AnimationEvent } from '@ang
state('closed', style({
height: '100px',
opacity: 0.8,
backgroundColor: '#c6ecff'
backgroundColor: 'blue'
})),
// #enddocregion state2, trigger-wildcard1
// #docregion transition1
@@ -78,7 +78,7 @@ export class OpenCloseComponent {
// #enddocregion component
// #docregion events1, events
onAnimationEvent( event: AnimationEvent ) {
onAnimationEvent(event: AnimationEvent) {
// #enddocregion events1, events
if (!this.logging) {
return;
@@ -87,16 +87,16 @@ export class OpenCloseComponent {
// openClose is trigger name in this example
console.warn(`Animation Trigger: ${event.triggerName}`);
// phaseName is start or done
// phaseName is "start" or "done"
console.warn(`Phase: ${event.phaseName}`);
// in our example, totalTime is 1000 or 1 second
// in our example, totalTime is 1000 (number of milliseconds in a second)
console.warn(`Total time: ${event.totalTime}`);
// in our example, fromState is either open or closed
// in our example, fromState is either "open" or "closed"
console.warn(`From: ${event.fromState}`);
// in our example, toState either open or closed
// in our example, toState either "open" or "closed"
console.warn(`To: ${event.toState}`);
// the HTML element itself, the button in this case
@@ -13,11 +13,11 @@ import { CountdownTimerComponent } from './countdown-timer.component';
@Component({
selector: 'app-countdown-parent-lv',
template: `
<h3>Countdown to Liftoff (via local variable)</h3>
<button (click)="timer.start()">Start</button>
<button (click)="timer.stop()">Stop</button>
<div class="seconds">{{timer.seconds}}</div>
<app-countdown-timer #timer></app-countdown-timer>
<h3>Countdown to Liftoff (via local variable)</h3>
<button (click)="timer.start()">Start</button>
<button (click)="timer.stop()">Stop</button>
<div class="seconds">{{timer.seconds}}</div>
<app-countdown-timer #timer></app-countdown-timer>
`,
styleUrls: ['../assets/demo.css']
})
@@ -29,11 +29,11 @@ export class CountdownLocalVarParentComponent { }
@Component({
selector: 'app-countdown-parent-vc',
template: `
<h3>Countdown to Liftoff (via ViewChild)</h3>
<button (click)="start()">Start</button>
<button (click)="stop()">Stop</button>
<div class="seconds">{{ seconds() }}</div>
<app-countdown-timer></app-countdown-timer>
<h3>Countdown to Liftoff (via ViewChild)</h3>
<button (click)="start()">Start</button>
<button (click)="stop()">Stop</button>
<div class="seconds">{{ seconds() }}</div>
<app-countdown-timer></app-countdown-timer>
`,
styleUrls: ['../assets/demo.css']
})
@@ -7,7 +7,9 @@ import { HEROES } from './hero';
selector: 'app-hero-parent',
template: `
<h2>{{master}} controls {{heroes.length}} heroes</h2>
<app-hero-child *ngFor="let hero of heroes"
<app-hero-child
*ngFor="let hero of heroes"
[hero]="hero"
[master]="master">
</app-hero-child>
@@ -8,9 +8,12 @@ import { MissionService } from './mission.service';
template: `
<h2>Mission Control</h2>
<button (click)="announce()">Announce mission</button>
<app-astronaut *ngFor="let astronaut of astronauts"
<app-astronaut
*ngFor="let astronaut of astronauts"
[astronaut]="astronaut">
</app-astronaut>
<h3>History</h3>
<ul>
<li *ngFor="let event of history">{{event}}</li>
@@ -4,8 +4,9 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-name-parent',
template: `
<h2>Master controls {{names.length}} names</h2>
<app-name-child *ngFor="let name of names" [name]="name"></app-name-child>
<h2>Master controls {{names.length}} names</h2>
<app-name-child *ngFor="let name of names" [name]="name"></app-name-child>
`
})
export class NameParentComponent {
@@ -6,7 +6,9 @@ import { Component } from '@angular/core';
template: `
<h2>Should mankind colonize the Universe?</h2>
<h3>Agree: {{agreed}}, Disagree: {{disagreed}}</h3>
<app-voter *ngFor="let voter of voters"
<app-voter
*ngFor="let voter of voters"
[name]="voter"
(voted)="onVoted($event)">
</app-voter>
@@ -25,7 +25,7 @@ describe('AppComponent', () => {
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('component-overview app is running!');
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('component-overview app is running!');
});
});
@@ -4,12 +4,12 @@ import { Component } from '@angular/core';
// #docregion templatebacktick
@Component({
selector: 'app-component-overview',
template: `<h1>Hello World!</h1>
<p>This template definition spans
multiple lines.</p>`
template: `
<h1>Hello World!</h1>
<p>This template definition spans multiple lines.</p>
`
})
// #enddocregion templatebacktick
export class ComponentOverviewComponent {
}
@@ -14,26 +14,6 @@ describe('Component Style Tests', () => {
expect(await externalH1.getCssValue('fontWeight')).not.toMatch(/normal|400/);
});
it('allows styling :host element', async () => {
const host = element(by.css('app-hero-details'));
expect(await host.getCssValue('borderWidth')).toEqual('1px');
});
it('supports :host() in function form', async () => {
const host = element(by.css('app-hero-details'));
await host.element(by.buttonText('Activate')).click();
expect(await host.getCssValue('borderWidth')).toEqual('3px');
});
it('allows conditional :host-context() styling', async () => {
const h2 = element(by.css('app-hero-details h2'));
expect(await h2.getCssValue('backgroundColor')).toEqual('rgba(238, 238, 255, 1)'); // #eeeeff
});
it('styles both view and content children with /deep/', async () => {
const viewH3 = element(by.css('app-hero-team h3'));
const contentH3 = element(by.css('app-hero-controls h3'));
@@ -3,22 +3,26 @@
@import './hero-details-box.css';
/* #enddocregion import */
/* #docregion host */
:host {
display: block;
border: 1px solid black;
font-style: italic;
}
/* #enddocregion host */
/* #docregion hostfunction */
:host {
font-style: italic;
}
:host(.active) {
border-width: 3px;
font-weight: bold;
}
/* #enddocregion hostfunction */
/* #docregion hostcontext */
:host-context(.theme-light) h2 {
background-color: #eef;
:host-context(.active) {
font-style: italic;
}
/* #enddocregion hostcontext */
@@ -0,0 +1,16 @@
import { Component } from '@angular/core';
// #docregion
@Component({
selector: 'app-main',
template: `
<h1>It Works!</h1>
<div>
Start editing to see some magic happen :)
</div>
`
})
export class HostSelectorExampleComponent {
}
// #enddocregion
@@ -2,7 +2,7 @@
<!-- #docregion ngif -->
<div *ngIf="expanded" [id]="contentId">
<!-- #docregion ng-container -->
<ng-container [ngTemplateOutlet]="content.templateRef"> </ng-container>
<ng-container [ngTemplateOutlet]="content.templateRef"></ng-container>
<!-- #enddocregion ng-container-->
</div>
<!-- #enddocregion ngif -->
<!-- #enddocregion ngif -->
@@ -3,8 +3,8 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-zippy-basic',
template: `
<h2>Single-slot content projection</h2>
<ng-content></ng-content>
`
<h2>Single-slot content projection</h2>
<ng-content></ng-content>
`
})
export class ZippyBasicComponent {}
@@ -3,11 +3,13 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-zippy-multislot',
template: `
<h2>Multi-slot content projection</h2>
Default:
<ng-content></ng-content>
Question:
<ng-content select="[question]"></ng-content>
`
<h2>Multi-slot content projection</h2>
Default:
<ng-content></ng-content>
Question:
<ng-content select="[question]"></ng-content>
`
})
export class ZippyMultislotComponent {}
@@ -3,11 +3,13 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-zippy-ngprojectas',
template: `
<h2>Content projection with ngProjectAs</h2>
Default:
<ng-content></ng-content>
Question:
<ng-content select="[question]"></ng-content>
`
<h2>Content projection with ngProjectAs</h2>
Default:
<ng-content></ng-content>
Question:
<ng-content select="[question]"></ng-content>
`
})
export class ZippyNgprojectasComponent {}
@@ -0,0 +1,34 @@
// #docplaster ...
{
"deprecation":
// #docregion deprecatedPackageJson
{
"name": "@angular/core",
"version": "9.0.0",
"main": "./bundles/core.umd.js",
"module": "./fesm5/core.js",
"es2015": "./fesm2015/core.js",
"esm5": "./esm5/core.js",
"esm2015": "./esm2015/core.js",
"fesm5": "./fesm5/core.js",
"fesm2015": "./fesm2015/core.js"
// #enddocregion deprecatedPackageJson
// #docregion deprecatedPackageJson
}
// #enddocregion deprecatedPackageJson
,
"working" :
// #docregion packageJson
{
"name": "@angular/core",
"version": "10.0.0",
"main": "./bundles/core.umd.js",
"module": "./fesm2015/core.js",
"es2015": "./fesm2015/core.js",
"esm2015": "./esm2015/core.js",
"fesm2015": "./fesm2015/core.js",
// #enddocregion packageJson
// #docregion packageJson
}
// #enddocregion packageJson
}
@@ -0,0 +1,20 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
// Add your e2e tests here
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
@@ -0,0 +1,6 @@
<select>
<!--#docregion two-way-template-deprecated-->
<option *ngFor="let optionName of options" [(value)]="optionName"></option>
<!--#enddocregion two-way-template-deprecated-->
</select>
@@ -0,0 +1,25 @@
<h1>Deprecation</h1>
<!--#docregion deprecated-example-->
<input [formControl]="control" [(ngModel)]="value">
<!--#enddocregion deprecated-example-->
<!--#docregion reactive-form-example-->
<input [formControl]="control">
<!--#enddocregion reactive-form-example-->
<!--#docregion template-driven-form-example-->
<input [(ngModel)]="value">
<!--#enddocregion template-driven-form-example-->
<select>
<!--#docregion valid-template-bind-->
<option *ngFor="let optionName of options" [value]="optionName"></option>
<!--#enddocregion valid-template-bind-->
</select>
@@ -0,0 +1,20 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
// Add your unit tests here
});
@@ -0,0 +1,60 @@
// #docplaster
import { Component, ContentChild, Injector, Input, OnInit, StaticProvider, TemplateRef } from '@angular/core';
import { ReflectiveInjector } from '@angular/core';
import {
FormControl,
} from '@angular/forms';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'example';
value = 'initial value';
control: FormControl = new FormControl('');
options = [
'repeat-value'
];
/*
// #docregion template-with-input-deprecated
@Input() @ContentChild(TemplateRef) tpldeprecated !: TemplateRef<any>;
// #enddocregion template-with-input-deprecated
*/
// #docregion template-with-input
@Input() tpl !: TemplateRef<any>;
@ContentChild(TemplateRef) inlineTemplate !: TemplateRef<any>;
// #enddocregion template-with-input
ngOnInit() {
// #docregion deprecated-example, template-driven-form-example
this.value = 'some value';
// #enddocregion deprecated-example, template-driven-form-example
this.setValue();
}
setValue(): void {
// #docregion reactive-form-example
this.control.setValue('some value');
// #enddocregion reactive-form-example
}
}
class InjectorExample {}
const Provider = [InjectorExample];
const providers: StaticProvider[] = [Provider];
// #docregion reflective-injector-deprecated-example
ReflectiveInjector.resolveAndCreate(providers);
// #enddocregion reflective-injector-deprecated-example
// #docregion static-injector-example
Injector.create({providers});
// #enddocregion static-injector-example
@@ -0,0 +1,75 @@
// #docplaster
import { BrowserModule } from '@angular/platform-browser';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { SubmitButtonComponent } from './submit-button/submit-button.component';
// #docregion lazyload-syntax, lazyload-deprecated-syntax
const routes: Routes = [{
path: 'lazy',
// #enddocregion lazyload-deprecated-syntax
// The new import() syntax
loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)
// #enddocregion lazyload-syntax
/*
// #docregion lazyload-deprecated-syntax
// The following string syntax for loadChildren is deprecated
loadChildren: './lazy/lazy.module#LazyModule',
// #enddocregion lazyload-deprecated-syntax
*/
// #docregion lazyload-syntax, lazyload-deprecated-syntax
}];
// #enddocregion lazyload-syntax, lazyload-deprecated-syntax
@NgModule({
declarations: [
AppComponent,
SubmitButtonComponent
],
// #docregion reactive-form-no-warning
imports: [
// #enddocregion reactive-form-no-warning
RouterModule.forChild(routes),
FormsModule,
BrowserModule,
// #docregion reactive-form-no-warning
ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'})
],
// #enddocregion reactive-form-no-warning
providers: [],
bootstrap: [AppComponent],
exports: [RouterModule]
})
export class AppModule { }
class SomeModule { }
class SomeConfig { }
// #docplaster ...
// #docregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
@NgModule({
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
// #docregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
})
// #docplaster
export class MyModule {
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
/*
// #docregion ModuleWithProvidersNonGeneric
static forRoot(config: SomeConfig): ModuleWithProviders {
// #enddocregion ModuleWithProvidersNonGeneric
*/
// #docregion ModuleWithProvidersGeneric
static forRoot(config: SomeConfig): ModuleWithProviders<SomeModule> {
// #docregion ModuleWithProvidersNonGeneric
return {
ngModule: SomeModule,
providers: [
{provide: SomeConfig, useValue: config}
]
};
}
}
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LazyRoutingModule { }
@@ -0,0 +1 @@
<p>lazy works!</p>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LazyComponent } from './lazy.component';
describe('LazyComponent', () => {
let component: LazyComponent;
let fixture: ComponentFixture<LazyComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LazyComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LazyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-lazy',
templateUrl: './lazy.component.html',
styleUrls: ['./lazy.component.css']
})
export class LazyComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LazyRoutingModule } from './lazy-routing.module';
import { LazyComponent } from './lazy.component';
@NgModule({
declarations: [
LazyComponent
],
imports: [
CommonModule,
LazyRoutingModule
]
})
export class LazyModule { }
@@ -0,0 +1 @@
<p>submit-button works!</p>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SubmitButtonComponent } from './submit-button.component';
describe('SubmitButtonComponent', () => {
let component: SubmitButtonComponent;
let fixture: ComponentFixture<SubmitButtonComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SubmitButtonComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(SubmitButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,40 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-submit-button',
templateUrl: './submit-button.component.html',
styleUrls: ['./submit-button.component.css']
})
export class SubmitButtonComponent {
private disabledValue = false;
@Input()
get disabled(): boolean {
return this.disabledValue;
}
set disabled(value: boolean|'') {
this.disabledValue = (value === '') || value;
}
}
@Component({
selector: 'app-submit-button-valid',
templateUrl: './submit-button.component.html',
styleUrls: ['./submit-button.component.css']
})
export class SubmitButtonValidComponent {
// tslint:disable: variable-name
static ngAcceptInputType_disabled: boolean|'';
private disabledValue = false;
@Input()
get disabled(): boolean {
return this.disabledValue;
}
/*
set disabled(value: boolean) {
this.disabledValue = (value === '') || value;
}
*/
}
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ponyracer</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
@@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -0,0 +1,14 @@
{
"description": "Deprecation Guide",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"tags": [
[
"deprecation",
"guide"
]
]
}
@@ -9,19 +9,22 @@ import { AdComponent } from './ad.component';
selector: 'app-ad-banner',
// #docregion ad-host
template: `
<div class="ad-banner-example">
<h3>Advertisements</h3>
<ng-template adHost></ng-template>
</div>
`
<div class="ad-banner-example">
<h3>Advertisements</h3>
<ng-template adHost></ng-template>
</div>
`
// #enddocregion ad-host
})
// #docregion class
export class AdBannerComponent implements OnInit, OnDestroy {
@Input() ads: AdItem[] = [];
currentAdIndex = -1;
@ViewChild(AdDirective, {static: true}) adHost!: AdDirective;
interval: any;
interval: number | undefined;
constructor(private componentFactoryResolver: ComponentFactoryResolver) { }
@@ -9,15 +9,22 @@ import { AdItem } from './ad-item';
export class AdService {
getAds() {
return [
new AdItem(HeroProfileComponent, {name: 'Bombasto', bio: 'Brave as they come'}),
new AdItem(HeroProfileComponent, {name: 'Dr IQ', bio: 'Smart as they come'}),
new AdItem(HeroJobAdComponent, {headline: 'Hiring for several positions',
body: 'Submit your resume today!'}),
new AdItem(HeroJobAdComponent, {headline: 'Openings in all departments',
body: 'Apply today'}),
new AdItem(
HeroProfileComponent,
{ name: 'Bombasto', bio: 'Brave as they come' }
),
new AdItem(
HeroProfileComponent,
{ name: 'Dr IQ', bio: 'Smart as they come' }
),
new AdItem(
HeroJobAdComponent,
{ headline: 'Hiring for several positions', body: 'Submit your resume today!' }
),
new AdItem(
HeroJobAdComponent,
{ headline: 'Openings in all departments', body: 'Apply today' }
)
];
}
}
@@ -9,16 +9,19 @@ import { AdService } from './ad.service';
@NgModule({
imports: [ BrowserModule ],
providers: [AdService],
declarations: [ AppComponent,
AdBannerComponent,
HeroJobAdComponent,
HeroProfileComponent,
AdDirective ],
entryComponents: [ HeroJobAdComponent, HeroProfileComponent ],
providers: [ AdService ],
declarations: [
AppComponent,
AdBannerComponent,
HeroJobAdComponent,
HeroProfileComponent,
AdDirective
],
entryComponents: [
HeroJobAdComponent,
HeroProfileComponent
],
bootstrap: [ AppComponent ]
})
export class AppModule {
constructor() {}
}
export class AppModule { }
@@ -7,13 +7,11 @@ import { AdComponent } from './ad.component';
template: `
<div class="job-ad">
<h4>{{data.headline}}</h4>
{{data.body}}
</div>
`
})
export class HeroJobAdComponent implements AdComponent {
@Input() data: any;
}
@@ -1,6 +1,6 @@
{
"tests": [
{"cmd": "yarn", "args": ["test", "--browsers=ChromeHeadless", "--no-watch"]},
{"cmd": "yarn", "args": ["e2e", "--prod", "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}"]}
{"cmd": "yarn", "args": ["e2e", "--configuration=production", "--protractor-config=e2e/protractor-puppeteer.conf.js", "--no-webdriver-update", "--port={PORT}"]}
]
}
@@ -25,7 +25,7 @@ describe('AppComponent', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Forms Overview');
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Forms Overview');
}));
});

Some files were not shown because too many files have changed in this diff Show More