Commit graph

29561 commits

Author SHA1 Message Date
Alan Agius
6b8cdc9339 docs: update creating libraries guide (#43982)
We update the `creating libraries` guide to remove View Engine references. This is because in version 13 users are no longer able to build libraries using View Engine.

In addition to the above, we also remove references to `npm link`. As this is actually not a recommended workflow, and was mostly needed in older versions of the CLI prior to version 6, were multi-projects workspaces were introduced.

Closes #43949

PR Close #43982
2021-10-29 14:23:03 -07:00
George Kalpakas
7b35a3426f refactor(docs-infra): align docs examples with default CLI TS config (#43880)
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.

PR Close #43880
2021-10-29 13:10:25 -07:00
George Kalpakas
8286190930 build(docs-infra): update docs examples to Angular v13.0.0-rc.0 (#43880)
This commit updates the docs examples to Angular v13.0.0-rc.0. In
addition to updating the dependency versions, it also updates the
projects' structure and configs to more closely match what a new v13 CLI
app would look like. See, also, the [diff][1] between a basic v12.1.3
CLI app and a v13.0.0-rc.0 one.
(NOTE: v12.1.3 was the last version for which we aligned the projects
with how a new CLI app would look like.)

Additionlly:
- Since we now use RxJS v7 in docs examples, this commit removes the
  extra CI steps to explicitly test the docs examples against RxJS v7.
- Since Angular v13 no longer supports IE, this commit removes an
  IE-specific section from `upgrade-setup.md`.

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

PR Close #43880
2021-10-29 13:10:25 -07:00
George Kalpakas
0fc4e66f6e test(docs-infra): fix practical-observable-usage docs example tests with RxJS v7 (#43880)
Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.

PR Close #43880
2021-10-29 13:10:25 -07:00
George Kalpakas
bc5e29592c build: use the latest version of Chrome (v93) in non-bazel tests (#43880)
This commit updates the version of Chrome used in non-bazel tests (via
Puppeteer) to the latest (v93).

PR Close #43880
2021-10-29 13:10:25 -07:00
Jochen Kraushaar
e3511e2632 docs(common): describe behavior when reference changes (#42863)
PR Close #42863
2021-10-28 11:34:23 -07:00
vthinkxie
65cb2c5565 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:19:58 -07:00
Pete Bacon Darwin
c315878910 refactor: simplify the LOCALE_ID provider (#43913)
Other parts of the intialization process are responsible for passing the locale id to ivy, so it does not need to happen in the provider factory. E.g. `PlatformRef.bootstrapModule()` and `R3TestBedCompiler.finalize()`.

PR Close #43913
2021-10-28 11:19:12 -07:00
Pete Bacon Darwin
70d3805fd6 refactor: remove ɵloc and related code (#43913)
This code is not used in ivy - and probably was not being used
in View Engine either.

PR Close #43913
2021-10-28 11:19:12 -07:00
Jessica Janiuk
17be47e781 Revert "refactor(forms): update minlength/maxlength to inherit abstractValidator" (#43971)
This reverts commit 7b31b887f9.

PR Close #43971
2021-10-27 21:42:26 +00:00
Jessica Janiuk
a84983efea
docs: release notes for the v13.0.0-rc.2 release (#43969) 2021-10-27 11:36:50 -07:00
Jessica Janiuk
96944ebc56
docs: release notes for the v12.2.12 release (#43967) 2021-10-27 11:26:30 -07:00
Mladen Jakovljević
b393188899 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:34 +00:00
Virginia Dooley
aa555631f6 docs: review tag added (#43465)
PR Close #43465
2021-10-27 16:13:01 +00:00
Alan Agius
57cbb4f2e8 refactor(migrations): remove no longer accessible migrations (#43947)
With this change we remove no longer needed migrations. These migrations are no longer accessible following a change angular/angular-cli#21986 in the Angular CLI.  The CLI now shows an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.

Example to update from version 11 to version 13 the recommand approach is to run the following commands

```
ng update @angular/core@12
ng update @angular/core@13 (which is the same as ng update @angular/core)
```

NB: It is recommand that when update from one major to another, users verify that their applications is working as expected.

PR Close #43947
2021-10-26 23:59:42 +00:00
Paul Gschwendtner
e2f9dcff68 ci: update commit for components-repo-unit-tests job (#43932)
Updates the SHA for the components-repo-unit-tests job. Due to
us enabling code splittign in the Angular compiler CLI package,
the postinstall patches in Angular Components started failing. The
latest commit of Angular Components no longer patches any JS files of
the compiler-cli, so updating the job unblocks us from enabling code
splitting within ESBuild.

PR Close #43932
2021-10-26 23:58:27 +00:00
Paul Gschwendtner
a3908bd0fc build: enable code splitting for esbuild bundling of localize tools (#43932)
Enables code spitting for ESBuild bundling of the localize/tools entry
point. When we initially configured ESBuild as part of APF v13, we left
this option disabled as code splitting is marked experimental. The ESM
splitting mechanism in ESBuild seems very solid so far (judging subjectively
and by experience/reports in the ESBuild repo), so we should give it a shot,
in order to significantly reduce the size of the NPM package, and simplify
debugging (by not having duplicated code portions for all the different entry points).

To clarify: Code splitting is helpful as we have multiple entry-points
that currently duplicate code. With code splitting these entry-points
would share common code instead.

PR Close #43932
2021-10-26 23:58:27 +00:00
Paul Gschwendtner
4b641a914b build: enable code splitting for esbuild bundling of compiler-cli (#43932)
Enables code spitting for ESBuild bundling of the compiler-cli. When
we initially configured ESBuild as part of APF v13, we left this option
disabled as code splitting is marked experimental. The ESM splitting
mechanism in ESBuild seems very solid so far (judging subjectively
and by experience/reports in the ESBuild repo), so we should give
it a shot, in order to significantly reduce the size of the NPM package,
and simplify debugging (by not having duplicated code portions for all
the different entry points).

To clarify: Code splitting is helpful as we have multiple entry-points
that currently duplicate code. With code splitting these entry-points
would share common code instead.

PR Close #43932
2021-10-26 23:58:27 +00:00
Virginia Dooley
82b668aada docs: reviewed tag added (#43487)
PR Close #43487
2021-10-26 23:57:43 +00:00
Virginia Dooley
284f58546a docs: reviewed tag added (#43488)
PR Close #43488
2021-10-26 22:57:19 +00:00
Renovate Bot
6c471396af build: update all non-major dependencies (#43917)
PR Close #43917
2021-10-26 21:16:06 +00:00
AleksanderBodurri
a31e135f09 build(devtools): bump typescript version to keep angular devtools compatible with the angular compiler
Also installs the latest `@types/filesystem` because the transitive dependency from `@types/chrome` is not compatible with typescript 4.4 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54046
2021-10-26 13:42:24 -07:00
iRealNirmal
5c22dfe861 refactor(forms): update minlength/maxlength to inherit abstractValidator (#43835)
Modified minlength and maxlength validator to inherit abstractValidator

For every validator type different PR will be raised as discussed in #42378.

Closes #42267

PR Close #43835
2021-10-26 20:24:40 +00:00
Joey Perrott
5d66b4aee6 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:03 +00:00
Joey Perrott
143bb9f339 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
Renovate Bot
58beafb29b build: lock file maintenance (#43937)
PR Close #43937
2021-10-26 20:12:00 +00:00
JoostK
28a40f3396 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:32 +00:00
JoostK
5d678de4da 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:32 +00:00
dirk diebel
a91fe6db8c docs(docs-infra): change deprecated keyboardEvent.keyCode example to use keyboardEvent.code (#43934)
PR Close #43934
2021-10-26 00:05:22 +00:00
amayer42
0e05f64bf4 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
Jessica Janiuk
0873ae2580 Revert "refactor(migrations): remove no longer accessible migrations" (#43943)
This reverts commit f21ad8780b.

PR Close #43943
2021-10-25 22:02:32 +00:00
Alan Agius
0b4350c6ef refactor(migrations): remove no longer accessible migrations (#43942)
With this change we remove no longer needed migrations. These migrations are no longer accessible following a change https://github.com/angular/angular-cli/pull/21986 in the Angular CLI.  The CLI now shows an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.

Example to update from version 11 to version 13 the recommand approach is to run the following commands

```
ng update @angular/core@12
ng update @angular/core@13 (which is the same as ng update @angular/core)
```

NB: It is recommand that when update from one major to another, users verify that their applications is working as expected.

PR Close #43942
2021-10-25 19:32:27 +00:00
Andrew Kushnir
bf1a2fc2d5 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:25 +00:00
George Kalpakas
6e37c938e2 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:26 +00:00
Renovate Bot
786f02b0c9 build: update dependency eslint-plugin-jsdoc to v37 (#43930)
PR Close #43930
2021-10-25 17:55:54 +00:00
Doug Parker
be564e6291 docs: deprecate @angular-devkit/build-optimizer (#43915)
The entire package is deprecated in v13. Deprecation message is mostly copied from the package's [README](https://github.com/angular/angular-cli/blob/13.0.0-next.9/packages/angular_devkit/build_optimizer/README.md), with just some minor edits.

(cherry picked from commit d81744e600)

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius
e48b49959d docs: remove fesm5 and esm5 deprecation notice. (#43915)
This has been removed in version 11 and should no longer be listed.

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius
a3af9b11f6 docs: update CLI deprecation guide to reflect new deprecations (#43915)
With this change we update the CLI deprecations sections as per version 13.

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius
9b240c7587 docs: format tables in deprecations page (#43915)
Currently, the table are unformatted which makes it extremely hard to read when viewing the markdown file directly.

PR Close #43915
2021-10-25 17:54:52 +00:00
ericcheng2005
b1c028677f 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:58 +00:00
ericcheng2005
2e941d2fa0 docs: added commas to sentences in .vscode/README.md (#43684)
PR Close #43684
2021-10-21 18:39:58 +00:00
ericcheng2005
2189c1011b docs: fixed minor grammar mistakes in CONTRIBUTING (#43684)
PR Close #43684
2021-10-21 18:39:58 +00:00
Doug Parker
4ed8dc858a docs: remove Ivy-specific guides (#43860)
Ivy is the only supported rendering engine in v13, so there is no need to document the concept. Everything in Angular is Ivy. This starts the removal process by deleting Ivy-specific guides and references to them. It also updates the glossary to be more clear that Ivy is the current rendering engine while View Engine is simply a historical note.

This does not attempt to fully remove all references to "Ivy" or "View Engine", that will likely be a more involved clean up process.

PR Close #43860
2021-10-21 18:14:34 +00:00
krzysztof-grzybek
45e4e60fd6 fix(router): reuse route strategy fix (#43791)
Currently, it's impossible to cache (detach/attach) parent route without caching child routes.
This produces a bug, when navigating from a/b to c, then to a/d, where a route is cached.
On the last navigation, we incorrectly restore a/b route instead of a/d.
This change introduces new behavior: if the route should be detached/attached,
we do so, but we check also child routes recursively.

Fixes #17333

PR Close #43791
2021-10-21 16:28:03 +00:00
Alan Agius
643cdf72ee 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:34 +00:00
Alan Agius
a1d44d92a8 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:34 +00:00
Renovate Bot
eafa7532ea build(devtools): update dependency webpack to v5.59.1 2021-10-21 09:03:09 -07:00
Tomasz Domański
974767d428 docs: fix typos in the workspace config guide (#43918)
PR Close #43918
2021-10-21 14:42:46 +00:00
George Kalpakas
c5d0b76e29 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:50 +00:00
iRealNirmal
c78f1cd34e docs: move deprecations example snippets to external file (#43700)
Moving angular depreciation examples to external project

closes #43337

PR Close #43700
2021-10-20 20:24:54 +00:00