26470 Commits

Author SHA1 Message Date
Matthieu Riegler f321e65c46 refactor(common): remove BrowserPlatformLocation from private exports. (#49301)
`BrowserPlatformLocation` was add to the public API by #48488.

PR Close #49301
2023-03-03 16:39:54 +00:00
Angular Robot 13e675ea87 build: update all non-major dependencies (#49267)
See associated pull request for more information.

PR Close #49267
2023-03-02 14:09:15 -08:00
Kristiyan Kostadinov de48c99afb refactor(migrations): expose current file in import remapper (#49288)
Passes the path of the current file to the import remapper. Useful if we want to generate absolute paths.

PR Close #49288
2023-03-02 21:48:35 +00:00
Andrew Scott 81e32f4283 docs(router): Update component testing to user RouterTestingHarness (#48553)
This commit updates the documentation on testing the
`Router` to use the `RouterTestingHarness` rather than stubs.

The stubs described in the previous form of this document actually
creates tests which are incapable of catching bugs related to the
component's interaction with the `Router`. In addition, managing the
stubs is more difficult than using the real `Router` classes.

Stubbing something like the `RouterLink` is quite harmful because it
neither tests the actual URL being created, nor the end result of the
navigation. There have been serveral bug fixes in the Router over the
years the would change the outcome of these but would not be caught by
tests which create a stub.

PR Close #48553
2023-03-02 13:17:17 -08:00
Paul Gschwendtner e20b6d98d9 build: remove ts-node forking bug workaround (#49289)
In the past, `ts-node` had a bug that prevented forking processes
when used in combination with `--esm`.

We contributed a fix upstream to `ts-node` to fix this, and this
commit updates to the latest version so that we can simplify our
`ng-dev` invocation.

https://github.com/TypeStrong/ts-node/commit/32d07e2b2fcbaab97c11e71ee5fc3a79fc20c802

Fixes #46858

PR Close #49289
2023-03-02 13:16:20 -08:00
Matthieu Riegler d42032a380 refactor(core): Remove isListLikeIterable from private export. (#49297)
PR #48433 removed the last external usage of `isListLikeIterable`. We can now remove it from the private exports.

PR Close #49297
2023-03-02 20:53:01 +00:00
Matthieu Riegler ffc684381f docs: Add NG8107 entry : Optional chain not nullable extended diagnostic (#49287)
PR Close #49287
2023-03-02 19:56:37 +00:00
Matthieu Riegler 8f7fbddb51 refactor: remove duplicate key from component metadata (#49065)
`directiveMetadata()` already assigns the `standalone` property to the `R3ComponentMetadataFacade` there is no need to do it twice.

PR Close #49065
2023-03-01 22:36:50 +00:00
Alan Agius bca3aed9e4 build: remove core-js-bundle from dependencies (#49259)
This is no longer needed as Angular is ever green.

PR Close #49259
2023-03-01 11:19:49 -08:00
Andrew Kushnir 819b9f32b4 refactor(core): move APP_BOOTSTRAP_LISTENER to avoid circular deps (#49273)
This commit moves the `APP_BOOTSTRAP_LISTENER` token into the `application_ref.ts` to avoid a risk of circular dependencies. The main problem is that the token refers to the `ComponentRef`, which in turn refers to more symbols, thus making the `application_tokens.ts` file susceptible to circular dependencies. Such a dependency was identified in https://github.com/angular/angular/pull/49271.

PR Close #49273
2023-03-01 11:18:28 -08:00
Kristiyan Kostadinov 6207d6f1f0 fix(migrations): add protractor support if protractor imports are detected (#49274)
The new `bootstrapApplication` API doesn't include Protractor support anymore which may cause existing e2e tests to break after the migration. These changes add some logic that will provide Protractor support if any imports to `protractor` or `protractor/*` are detected.

PR Close #49274
2023-03-01 11:13:57 -08:00
Andrew Kushnir 174997150f release: cut the v15.2.1 release 15.2.1 2023-03-01 10:53:10 -08:00
Stephanie Tuerk 439b4d3a89 docs: clarify ActivatedRouter injection location (#49270)
The example in the code snippet below this line of text shows `ActivatedRouter` being injected into a component's constructor. When I read instruction to inject A`ActivatedRouter` into **application's** constructor, I assumed this meant the constructor for `app.component.ts`. 

Editing to clarify/match code example below.
PR Close #49270
2023-02-28 17:13:37 -08:00
Joey Perrott 377d0c9c1e build: update cross-repo angular dependencies (#49268)
See associated pull request for more information.

PR Close #49268
2023-02-28 12:43:42 -08:00
Alan Agius d60ea6ab5a fix(core): update zone.js peerDependencies ranges (#49244)
This ensures that the latest version of zone.js is supported.

PR Close #49244
2023-02-28 11:55:54 -08:00
Matthieu Riegler dafb765926 refactor(core): Drop Symbol.iterator shim (#49207)
We are targeting evergreen browsers, we can drop the shim.

PR Close #49207
2023-02-28 10:05:42 -08:00
Kristiyan Kostadinov 44d095a61c fix(migrations): avoid migrating the same class multiple times in standalone migration (#49245)
If a class is declared in multiple modules, the standalone migration may end up generating invalid code. While declaring a class in multiple modules is an error, it can happen with modules in tests. These changes avoid the issue by using a `Set` to track the classes being migrated.

PR Close #49245
2023-02-28 10:04:55 -08:00
Virginia Dooley 600fd12fda docs: New doc extract from original HTTP doc to be retired. (#48915)
PR Close #48915
2023-02-28 09:32:30 -08:00
Virginia Dooley d100ddfd6e docs: New doc extract from original HTTP doc to be retired. (#48912)
PR Close #48912
2023-02-28 09:31:31 -08:00
Virginia Dooley 1aadabb508 docs: New doc extract from original HTTP doc to be retired. (#48908)
PR Close #48908
2023-02-28 09:30:14 -08:00
Virginia Dooley d252187c45 docs: New document extracted from the original Communicating with backend services using HTTP document, which is to be retired. (#47971)
PR Close #47971
2023-02-28 09:29:13 -08:00
Matthieu Riegler 6d6b76c59f docs(router): Improving linking (#49203)
Add links to @see elements and suggest a more explicit alternative for the depreciation of `CanActivate`.

PR Close #49203
2023-02-28 08:24:11 -08:00
Matthieu Riegler 5f2822ce1f refactor(platform-server): handle #24571 todos (#49233)
This commit removes the remaining TODO(issue/24571) in platform-server code base.

PR Close #49233
2023-02-28 08:19:58 -08:00
Matthieu Riegler acc87a41ce docs: remove TODO from doc example (#49233)
This commit removes a TODO(issue/24571) that leaking into the docs examples

PR Close #49233
2023-02-28 08:19:57 -08:00
Matthieu Riegler 7eec66c449 refactor(elements): handle #24571 todos (#49233)
This commit removes the remaining TODO(issue/24571) in elements code base.

PR Close #49233
2023-02-28 08:19:57 -08:00
Angular Robot 8fc02f56d0 build: update eslint dependencies to v5.54.0 (#49243)
See associated pull request for more information.

PR Close #49243
2023-02-28 08:19:07 -08:00
Angular Robot 313760b851 build: update github/codeql-action action to v2.2.5 (#49242)
See associated pull request for more information.

PR Close #49242
2023-02-28 08:18:22 -08:00
Matthieu Riegler 87252dcbbc docs: improve section title in TOH-pt4 (#49208)
fixes #49165

PR Close #49208
2023-02-28 08:16:39 -08:00
Alan Agius 785ab81a7b ci: add several dependencies to renovate ignore list (#49258)
Add ignored dependencies in Renovate config. These have been collected from the dependency dashboard (https://github.com/angular/angular/issues/46728)

The reason for this change is that Renovate is re-opened dependency updates for ignored PRs.

Example:
https://github.com/angular/angular/pull/49256
https://github.com/angular/angular/pull/47852

PR Close #49258
2023-02-28 08:15:05 -08:00
Virginia Dooley 19a4cdec7d docs: New document extracted from the original Communicating with backend services using HTTP document, which is to be retired. (#47937)
PR Close #47937
2023-02-27 15:24:41 -08:00
Iván Navarro 3062442728 fix(router): add error message when using loadComponent with a NgModule (#49164)
Add a more specific error message when defining a lazy-loaded route using
`loadComponent` and passing it a NgModule instead of a standalone component,
when the user should actually be using `loadChildren`.

PR Close #49164
2023-02-27 10:09:55 -08:00
Doug Parker 138b4936b7 release: bump DevTools version (#49121)
PR Close #49121
2023-02-27 10:07:54 -08:00
Matthieu Riegler af31adb8dd refactor(common): Use isPromise from @angular/core (#49210)
This commit removes `isPromise()` from Common as it's a duplicate function that can be imported from `@angular/core`.

PR Close #49210
2023-02-27 10:03:21 -08:00
Vincent f0e926074d fix(common): make Location.normalize() return the correct path when the base path contains characters that interfere with regex syntax. (#49181)
Fix the function stripping the base path from the URL, as the current implementation uses the base path as part of a regex, which wrongly makes paths fails that contain characters such as a parenthesis (example: C:/Users/MyUser(Test)/project).

Fixes #49179

PR Close #49181
2023-02-27 10:02:33 -08:00
Andrew Kushnir 7ec76dea5f refactor(core): add previous sibling node reference to TNode (#49223)
This commit updates the `TNode` to include a reference to the previous sibling node. Currently, TNode has references to the next sibling and parent nodes, but in followup changes we'd need to have access to previous TNodes (to determine position of the current node).

PR Close #49223
2023-02-27 10:00:26 -08:00
Paul Gschwendtner a852862ff9 build: cleanup unused dependencies (#49227)
Cleans up a few more unused dependencies.

Related: https://github.com/angular/angular/pull/49226

PR Close #49227
2023-02-27 08:06:00 -08:00
Aristeidis Bampakos 6107d2ebbc docs: change link for Angular Projects book (#49198)
PR Close #49198
2023-02-27 08:05:21 -08:00
Aristeidis Bampakos 56f7d1f61a docs: add new edition of Learning Angular book (#49199)
PR Close #49199
2023-02-27 08:04:35 -08:00
Matthieu Riegler 6d912960b9 docs: bump first-app to 15.2 (#49217)
The stackblitz demo of the quick-start guide was broken with incompatible dependencies.
This commit fixes this.

Fixes #49213

PR Close #49217
2023-02-27 08:03:47 -08:00
Andrew Kushnir 8542593c80 refactor(platform-browser): move TransferState init logic into its constructor (#49191)
This commit updates the TransferState class to move its init logic from the `useFactory` function to its constructor. The change is needed to make the init behavior consistent across different injection scenarios and tolerate the issue described in https://github.com/angular/angular/issues/49190.

PR Close #49191
2023-02-24 10:41:17 -08:00
Andrew Kushnir d0fa598fe4 refactor(core): avoid creating DOM nodes before creating a TNode (#49172)
This commit updates the `elementStart` instruction to avoid creating DOM nodes before creating a corresponding TNode. This refactoring is needed to make sure this internal logic is consistent across all instructions.

PR Close #49172
2023-02-24 08:29:06 -08:00
Paul Gschwendtner 04d8b6c61a fix(compiler-cli): do not persist component analysis if template/styles are missing (#49184)
Consider the following scenario:

1. A TS file with a component and templateUrl exists
2. The template file does not exist.
3. First build: ngtsc will properly report the error, via a FatalDiagnosticError
4. The template file is now created
5. Second build: ngtsc still reports the same errror.

ngtsc persists the analysis data of the component and never invalidates
it when the template/style file becomes available later.

This breaks incremental builds and potentially common workflows
where resource files are added later after the TS file is created. This
did surface as an issue in the Angular CLI yet because Webpack requires
users to re-start the process when a new file is added. With ESBuild
this will change and this also breaks incremental builds with
Bazel/Blaze workers.

To fix this, we have a few options:

* Invalidate the analysis when e.g. the template file is missing. Never
  caching it means that it will be re-analyzed on every build iteration.
* Add the resource dependency to ngtsc's incremental file graph. ngtsc
  will then know via `host.getModifiedResources` when the file becomes
  available- and fresh analysis of component would occur.

The first approach is straightforward to implement and was chosen here.
The second approach would allow ngtsc to re-use more of the analysis
when we know that e.g. the template file still not there, but it
increases complexity unnecessarily because there is no **single**
obvious resource path for e.g. a `templateUrl`. The URL is attempted
to be resolved using multiple strategies, such as TS program root dirs,
or there is support for a custom resolution through
`host.resourceNameToFileName`.

It would be possible to determine some candidate paths and add them to
the dependency tracker, but it seems incomplete given possible external
resolvers like `resourceNameToFileName` and also would likely not have
a sufficient-enough impact given that a broken component decorator is
not expected to remain for too long between N incremental build
iterations.

PR Close #49184
2023-02-24 08:24:08 -08:00
Kristiyan Kostadinov 92b0bda9e4 fix(migrations): delete barrel exports in standalone migration (#49176)
Adds some logic to automatically delete `export * from './foo'` style imports. Previously they weren't being picked up, because finding all the references using the language service doesn't include barrel exports.

PR Close #49176
2023-02-24 08:23:02 -08:00
Michael Ziluck d7835e4f1a docs(router): fix code block closing ticks (#49185)
PR Close #49185
2023-02-23 10:37:25 -08:00
Craig Spence e384c69b83 docs(core): Improved README.md (#49171)
PR Close #49171
2023-02-23 10:35:42 -08:00
Angular Robot aa10532458 build: update io_bazel_rules_sass digest to 1f27790 (#49132)
See associated pull request for more information.

PR Close #49132
2023-02-23 10:34:43 -08:00
Alex Rickabaugh 7677963bd9 release: cut the v15.2.0 release 15.2.0 2023-02-22 13:04:10 -08:00
cexbrayat 03fcb36cfd fix(migrations): migrate HttpClientModule to provideHttpClient() (#48949)
The `standalone-bootstrap` migration now migrates `HttpClientModule` imports to `provideHttpClient(withInterceptorsFromDi())` instead of `importProvidersFrom(HttpClientModule)`.

The `withInterceptorsFromDi()` feature is added to make sure class-based interceptors still works if there are any in the application.

Fixes #48948

PR Close #48949
2023-02-22 11:30:01 -08:00
Matthieu Riegler 2f0856070b docs: escape script tag to prevent rendering problems (#49152)
un-commented tags are responsible for rendering problem of markdown document. This commit fixes the http make jsonp request guide.

fixes #49151

PR Close #49152
2023-02-22 11:29:33 -08:00
Angular Robot 7b4d3c036d build: update actions/cache digest to 69d9d44 (#49148)
See associated pull request for more information.

PR Close #49148
2023-02-21 13:36:41 -08:00