Commit graph

29561 commits

Author SHA1 Message Date
Joey Perrott
2a2b61b1ed ci: migrate monitoring jobs to GHA (#51350)
Migrate monitoring jobs to Github Actions from CircleCI

PR Close #51350
2023-08-30 19:41:53 +00:00
Jessica Janiuk
bd8c08a284 release: cut the v17.0.0-next.2 release 2023-08-30 11:27:05 -07:00
Jessica Janiuk
23996ce112 docs: release notes for the v16.2.3 release 2023-08-30 11:02:05 -07:00
Luis Castro
6b5c812b6b docs(core): clarify InjectionToken usage (#51386)
- Emphasized the importance of using the same InjectionToken instance for both provider and injection call.
- Added examples to illustrate correct usages to prevent NullInjectorError.

PR Close #51386
2023-08-30 15:53:23 +00:00
Ben Hong
dad47bb720 docs: migrate security guide and example to standalone (#51446)
PR Close #51446
2023-08-30 15:50:57 +00:00
Alan Agius
c340d6e044 feat(platform-browser): enable removal of styles on component destroy by default (#51571)
This change aligns the settings between G3 and P3 as `REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT` is already set to `true` internally.

BREAKING CHANGE: `REMOVE_STYLES_ON_COMPONENT_DESTROY` default value is now `true`. This causes CSS of components to be removed from the DOM when destroyed. You retain the previous behaviour by providing the `REMOVE_STYLES_ON_COMPONENT_DESTROY` injection token.

```ts
import {REMOVE_STYLES_ON_COMPONENT_DESTROY} from '@angular/platform-browser';
...
providers: [{
  provide: REMOVE_STYLES_ON_COMPONENT_DESTROY,
  useValue: false,
}]
```

PR Close #51571
2023-08-30 14:42:02 +00:00
Ben Hong
0f86a0b9e7 docs: migrate elements guide and code to standalone (#51455)
PR Close #51455
2023-08-30 00:01:12 +00:00
Aristeidis Bampakos
8c77240caa docs: fix casing of GitHub in navigation (#51427)
PR Close #51427
2023-08-29 23:32:36 +00:00
Aristeidis Bampakos
83b93d9537 docs: fix casing of image alt in page not found (#51432)
PR Close #51432
2023-08-29 23:30:51 +00:00
Aristeidis Bampakos
fa29eb84a3 docs: fix casing of a11y labels in main page (#51431)
PR Close #51431
2023-08-29 23:30:11 +00:00
Aristeidis Bampakos
629f0146b8 docs: fix typos in search results component (#51433)
PR Close #51433
2023-08-29 23:29:40 +00:00
Ben Hong
e027a59be0 docs: migrate built-in-template-functions to standalone (#51486)
PR Close #51486
2023-08-29 22:58:45 +00:00
Ben Hong
dd52f9f05d docs: migrate view encapsulation guide and code to standalone (#51454)
PR Close #51454
2023-08-29 22:58:20 +00:00
Ben Hong
7d4550b7a7 docs: migrate accessibility guide and example to standalone (#51445)
PR Close #51445
2023-08-29 22:57:55 +00:00
Ben Hong
fbdca15a86 docs: migrate attribute-binding code to standalone (#51477)
PR Close #51477
2023-08-29 22:38:02 +00:00
Ben Hong
f6fa690152 docs: migrate directives guide and examples to standalone (#51416)
PR Close #51416
2023-08-29 22:37:37 +00:00
Ben Hong
5d1d3b3d9f docs: migrate angular compiler options code to standalone (#51467)
PR Close #51467
2023-08-29 22:24:41 +00:00
Joey Perrott
1baeca87e3 fix(devtools): remove unnecessary escaping in regex expressions (#51554)
Correct various Useless regular-expression character escape issues.

PR Close #51554
2023-08-29 21:52:33 +00:00
Joey Perrott
3bca9db4a5 fix(compiler-cli): remove unnecessary escaping in regex expressions (#51554)
Correct various Useless regular-expression character escape issues.

PR Close #51554
2023-08-29 21:52:33 +00:00
Joey Perrott
18be804c03 fix(animations): remove unnecessary escaping in regex expressions (#51554)
Correct various Useless regular-expression character escape issues.

PR Close #51554
2023-08-29 21:52:33 +00:00
Joey Perrott
1423bfbf8f fix(core): remove unnecessary escaping in regex expressions (#51554)
Correct various Useless regular-expression character escape issues.

PR Close #51554
2023-08-29 21:52:33 +00:00
Joey Perrott
1f7e7dff50 fix(docs-infra): escape the . character in regex (#51555)
Escape the `.` character in a hostnaem regex

PR Close #51555
2023-08-29 21:13:14 +00:00
Ward Bell
8ef5cc680d docs: Migrate HttpClient guide and its code examples (/http) to standalone (#51400)
**Unit Testing Code Does Not Compile**

The compilation error is:
```
The compilation error is
./src/testing/http-client.spec.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: /home/projects/obk3vc--run/src/testing/http-client.spec.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
```
I’m not sure what to say about unit testing HTTP in a full Standalone app. Is it different?

_This is the only known remaining defect in this conversion of HTTP to Standalone._

**Edited content of  `http-request-data-from-server.md`**

The current version of this page is confusing. In particular

* It tells readers they **should always unsubscribe** from the HttpClient method calls. This is *not true* and this example doesn't even do it. I replaced this instruction with more nuanced advice and an explanation of why it is OK to not unsubscribe to HttpClient methods.

* There is a "helpful" note about using the RxJS `map` operator to transform the response. This is *not "helpfulf"*. It is *confusing* because the sample doesn't use `map` anywhere. It was unnecessary here, even if it might be helpful elsewhere. I removed this note.

* The "Requesting a typed response" section seemed unclear to me, particularly because the guide begins with a `get` request that already has the `Config` return type specification. My revision attempts to make this more clear.

* The bold "callout" about the `observe` and `responseType` options appears out of nowhere after "Requesting a typed response". It's disconcerting at best. I moved it to the bottom of the page and linked to it from the `options` discussion at the top.

I made a few other revisions that I hope improve the readability of this page.

**Corrected `http-make-jsonp-request.md`**

The JSONP example, handwritten in the guide page, would not have compiled. I added one that does to `heroes.service.ts` and displayed it on this page.

**Corrected `http-handle-request-errors.md`

This page ended with a section called "Sending data to a server" that introduces PUT, POST, and DELETE. These features have nothing to do with error handling and the verbiage here duplicates the opening paragraphs of the next topic which does: "Send data to a server". So I deleted this section from the error handling guide page.

**Archived http-setup-server-communication.md**

`http-setup-server-communication.md` appears to be the original long document that has since been divided over the other pages in this folder.

It shouldn’t be in the reader’s flow. I did update it for Standalone. But I also removed it from left-nav and marked as archived.

PR Close #51400
2023-08-29 21:03:49 +00:00
Joey Perrott
49415e8221 build: update security related package version for aio (#51562)
Update packages for security exposure

PR Close #51562
2023-08-29 20:27:00 +00:00
Joey Perrott
de2550d988 fix(compiler-cli): correct incomplete escaping (#51557)
Correct incomplete escaping and replace all instances of `

PR Close #51557
2023-08-29 19:48:25 +00:00
Joey Perrott
45d2ded0ea fix(core): correct incomplete escaping (#51557)
Correct incomplete escaping and replace all instances of comment delimiters

PR Close #51557
2023-08-29 19:48:25 +00:00
Joey Perrott
88b1575271 fix(language-service): correct incomplete escaping (#51557)
Correct incomplete escaping and replace all instances of $

PR Close #51557
2023-08-29 19:48:25 +00:00
Andrew Scott
c62e680098 fix(router): Remove deprecated Router properties (#51502)
This commit removes deprecated properties on the Router. These are meant
to be configured through DI and not meant to be changed during runtime.

BREAKING CHANGE: The following Router properties have been removed from
the public API:

- canceledNavigationResolution
- paramsInheritanceStrategy
- titleStrategy
- urlUpdateStrategy
- malformedUriErrorHandler

These should instead be configured through the `provideRouter` or
`RouterModule.forRoot` APIs.

PR Close #51502
2023-08-29 19:47:58 +00:00
Joey Perrott
0b6aae8d6d build: use pin for devcontainer base image (#51556)
Use pinned verison of container image for devcontainer.

PR Close #51556
2023-08-29 18:38:55 +00:00
Ben Hong
6fff65c384 docs: update what is angular to use standalone and cup of coffee (#51378)
PR Close #51378
2023-08-29 18:38:28 +00:00
Paul Gschwendtner
5ee6c7e344 refactor(localize): ignore code duplication error with compiler package (#51500)
The localize package intentionally duplicates some logic from the
compiler to avoid adding a dependency. This is now an error in the
packaging rule to prevent common pitfalls/code duplication. Here it's
an explicit decision though so we mark it as such and ask for the check
to be ignored for the particular import.

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
65b6fdb9cd refactor(upgrade): ignore cross relative import for package (#51500)
The upgrade package duplicaes some of code due to relative
imports between entry-points. This caused bundlers to
inline shared functions twice in both FESM outputs.

This is an acceptable limitation and we are not changing this
because the primary entry-point is not synced into G3. It's non-trivial
to remove these cross relative imports right now because the primary
entry-point is not even built in G3 so instead we just ignore the
relative imports using a re-export file.

Note: To simplify this change, we continue using namespace exports
as exporting individual named exports for all these possible usages
is rather cumbersome and also we had existing namespace imports for
e.g. `angular1.ts`. The code of upgrade is rarely edited these days

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
86c5e34601 fix(common): remove code duplication between entry-points (#51500)
The common packages were duplicating a little bit of code due
to relative imports between entry-points. This caused bundlers to
inline shared functions twice in both FESM outputs.i

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
698c058e1c fix(animations): remove code duplication between entry-points (#51500)
The animations packages were duplicating a little bit of code due
to relative imports between entry-points. This caused bundlers to
inline shared functions twice in both FESM outputs.

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
a6b7dbc1db fix(bazel): dedupe es2022 javascript files properly (#51500)
We were collecting all ES2022 files from entry-points (including
transitive files). Those are later on combined and filtered so that
we know which files to copy over to the package. There was no
deduping here. This did not have an effect, but could be a source
of slowness in `ng_package` and also breaks validation checks which
could show same errors multiple times for the same file.

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
dbffdc09c2 fix(core): avoid duplicated code between entry-points (primary, testing, rxjs-interop) (#51500)
Fixes that there was code duplication between the primary entry-point,
the testing entry-point and the rxjs-interop entry-point.

This code duplication resulted in additional code size (really
neglibible here because rxjs-interop did not duplicate large parts of
core, and `testing` is not used in production).

On the other hand though, the duplication resulted in a subtle JIT
dependency tracking issue due to the `depsTracker` no longer being a
singleton. This caused test failures as in:
https://github.com/angular/angular/pull/51415.

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
9aa71cc8e0 feat(bazel): prohibit cross entry-point relative imports (#51500)
Introduces a check into `ng_package` that will ensure that there are no
cross entry-point or cross-package relative imports that would end up
contributing to duplicate code. Not only would duplicate code result in
size increases, but also it could cause subtle hard-to-debug bugs,
especially when cross imports rely on e.g. singletons. Like for example
the deps tracker that is used in angular/core but also in
angular/core/testing.

PR Close #51500
2023-08-29 17:55:34 +00:00
Ben Hong
7ed4c56c24 docs: migrate event-binding code to standalone (#51538)
PR Close #51538
2023-08-29 17:53:54 +00:00
Ward Bell
c0d3a019c2 docs: Migrate pipe guide and its code examples to standalone (#51333)
**Pipes Sample Code**

Migrated all sample code in the `examples/pipes` folder. Did not touch the pipes in the ToH or Testing folders.

>The existing, complex discussion of the `CurrencyPipe` within `pipes-transform-data.md` cried out for a new `concurrency-formatting.component` example`.

**Extracted "pipe precedence" into its own page**

The topic had been extracted from `pipe.md` and tacked on to the bottom of the `pipes-overview.md` page.

It's an advanced and somewhat obscure topic that doesn't belong in the overview. Rather than throw it away, I created a new `pipe-precedence.md` page and added it to the bottom of the pipes section navigation.

I also tried to improve both the guide text and the companion component, `precedence.component`.

**How to create a pipe is missing**

The readers are told they can create their own pipes in several places throughout the docs. But there are no links and you can't navigate to a page that covers the topic. This is a serious omission!

The topic is introduced in the `pipes-custom-data-trans.md` page (extracted verbatim from `pipes.md`). But you can't navigate to this page and their are no links to it.

TODO: restore this page and add it to the left-nav.

**Change `pipes.md` references to `pipe-overview.md`**

The original, kitchen-sink page, `pipes.md`, was disconnected from navigation long ago, in favor of multiple pages such as `pipe-overview.md`. The page is still in the AIO documentation and can be found by searching or by links from 3rd party documenters. Landing on that page hides the left-nav.

In this commit, we treat `pipes.md` as deprecated (which it seems to be). Therefore, this commit retargets previous `pipes.md` references to `pipe-overview.md`.

>The `change-detection-slow-computations.md` is the exception. It refers to "pure pipes", a subject not covered in the current pipe documentation. That reference is retargeted to `api/core/Pipe#pure`.

Certain code files are only referenced in `pipe.md`. They still work and are displayed in the overall pipes code sample as before. Now they are marked with deprecation comments for future treatment or removal.

For consistency, certain sections of `pipes.md` were replaced by the contents of the corresponding current pages.

PR Close #51333
2023-08-29 17:52:35 +00:00
Thomas Turrell-Croft
a610eb160a docs: add browsers switch to CI test example (#50451)
PR Close #50451
2023-08-29 17:52:10 +00:00
Matthieu Riegler
c5daa6ce77 feat(platform-browser): expose EventManagerPlugin in the public API. (#49969)
The exposed type of the `EVENT_MANAGER_PLUGINS` token should be in the public API.

PR Close #49969
2023-08-29 16:40:06 +00:00
Kristiyan Kostadinov
685d01e106 perf(core): chain template instructions (#51546)
With the new control flow and defer blocks it'll be common for several template instructions to be declare one after another. These changes add support for chaining to the `template` instruction which will allow us to save some bytes.

PR Close #51546
2023-08-29 16:38:52 +00:00
Kristiyan Kostadinov
4dabcad557 test(core): convert for block tests to template (#51514)
Reworks the `for` block tests to use compiled templates instead of manually-written instructions.

PR Close #51514
2023-08-29 16:38:22 +00:00
Kristiyan Kostadinov
d83dfaa8ea refactor(compiler): generate for loop block instructions (#51514)
Adds the initial implementation to generate the instructions for the `for` loop block.

**Note:** the expressions we support in the `track` paramateter are currently limited to tracking by identity or index, or a specific property of the item. Supporting more advanced expression will require additional work that I'll do in a follow-up PR.

PR Close #51514
2023-08-29 16:38:22 +00:00
Andrew Kushnir
006577f39c fix(core): handle hydration of view containers that use component hosts as anchors (#51456)
This commit fixes an issue where serialization of a view container fails in case it uses a component host as an anchor. This fix is similar to the fix from #51247, but for cases when we insert a component (that acts as a host for a view container) deeper in a hierarchy.

Resolves #51318.

PR Close #51456
2023-08-29 16:37:50 +00:00
Dylan Hunn
ab0f9eeba5 refactor(compiler): Implement switch blocks in template pipeline (#51518)
`switch` blocks are part of the new control flow syntax. This commit adds support for processing them, and emitting the appropriate templates and conditional instructions.

PR Close #51518
2023-08-29 00:16:00 +00:00
Ben Hong
f7364ece87 docs: migrate binding-syntax code to standalone (#51479)
PR Close #51479
2023-08-28 23:55:07 +00:00
Andrew Kushnir
ba32d6ffd1 refactor(core): add basic prefetching runtime mechanism for defer blocks (#51529)
This commit adds runtime implementation of a basic preloading mechanism for defer blocks. The base prefetching logic invokes a dependency loading function (generated by the compiler) when a corresponding `prefetch when` condition is triggered. The `prefetch on` triggers would be implemented in followup PRs.

We plan to explore additional prefetching techniques and will followup with more PRs later (based on the research).

PR Close #51529
2023-08-28 23:53:32 +00:00
Gerald Monaco
3a19d6b743 fix(core): run afterRender callbacks outside of the Angular zone (#51385)
afterRender should run outside of the Angular zone so that it does not trigger further CD cycles

PR Close #51385
2023-08-28 23:02:28 +00:00
Dylan Hunn
c2d859241b refactor(compiler): Enable additional passing tests (#51498)
Some additional tests were already passing.

PR Close #51498
2023-08-28 21:51:04 +00:00