Commit Graph

26846 Commits

Author SHA1 Message Date
Jessica Janiuk 2f4b61e164 release: cut the v16.0.0-rc.2 release 16.0.0-rc.2 2023-04-19 12:37:03 -07:00
lonikadze d45aafb264 docs: add information on how to use index option in configuration (#49813)
#49780

PR Close #49813
2023-04-19 18:46:11 +00:00
Pawel Kozlowski f8b95b9da6 fix(core): execute query setters in non-reactive context (#49906)
This commit assures that query results setters run when there is no active
reactive consumer set.

PR Close #49906
2023-04-19 18:12:15 +00:00
Pawel Kozlowski 2650f1afc1 fix(core): execute input setters in non-reactive context (#49906)
This change explicitly resets a reactive consumer before setting inputs
on directive instances. This is to assure that any potential input setters
do _not_ run in the reactive context.

PR Close #49906
2023-04-19 18:12:15 +00:00
judytag b7d6889bf1 docs: update-to-version-14 linting fixes (#49839)
PR Close #49839
2023-04-19 18:10:33 +00:00
Kristiyan Kostadinov a3c3ab757c fix(core): handle invalid classes in class array bindings (#49924)
When binding an array to `class` like `[class]="['foo', 'bar']"`, the runtime treats it the same as a literal binding with all the values being `true`, e.g. `{foo: true, bar: true}`. While object literals can only have string keys, arrays can have any value which can lead to errors if the array contains non-string values.

These changes add some logic to stringify the keys and ignore invalid ones.

Fixes #48473.

PR Close #49924
2023-04-19 16:28:27 +00:00
Matthieu Riegler 69fb7b0761 docs: schematics for functional guards & resolvers (#49865)
Adding back the schematics to generate functional guards & resolver that they are supported.

PR Close #49865
2023-04-19 16:22:53 +00:00
Matthieu Riegler c9a1044b04 refactor(core): Create TestBed injector without a module (#49864)
We can create the injector without relying on th module factory.

PR Close #49864
2023-04-19 15:30:23 +00:00
Alan Agius a175ac5441 test: update platform-server tests to test both ngmodule and standalone application (#49927)
This commits update the platform-server test structure to add 2 applications in the Angular CLI workspace one based on ngmodules and another standalone. The same E2E suit is ran on both apps.

PR Close #49927
2023-04-19 14:56:29 +00:00
Andrew Kushnir 21b834fc36 test(core): adding extra tests for hydration of view containers located after <ng-content> slots (#49920)
This commit adds extra tests to verify a couple additional use-cases related to view containers located after <ng-content> slots.

PR Close #49920
2023-04-19 14:26:43 +00:00
Andrew Kushnir aa240382bd refactor(core): handle empty projection slots within <ng-container> during hydration (#49920)
This commit updates hydration logic to handle cases when there are projection slots present in a template inside of an `<ng-container>` and when there are regular elements follow an <ng-content> slot (see tests for additional information). With this combination, the logic that annotates regular element locations should fallback to calculating a path from a reference node to that node. In case of an <ng-container>, the comment node is located *after* the node that needs an annotation. An existing logic was mistakenly returning an empty path, which was represented as a pointer to teh reference node. This commit fixes that and triggers a fallback to using a component host node as a reference in this case.

Resolves #49918.

PR Close #49920
2023-04-19 14:26:43 +00:00
Alan Agius 48ab536b94 refactor(core): remove redundant hydrationInfo check (#49926)
This check is not needed as it is done in the previous line

PR Close #49926
2023-04-19 14:21:40 +00:00
Alan Agius 38e8d4b3b8 docs: some changes to the helpful not in preserve-whitespaces (#49928)
This commit updates the note with a recommendation.

PR Close #49928
2023-04-19 14:18:43 +00:00
Alan Agius e036c914e7 docs: fix grammer in preserve whitespaces notes (#49928)
This commit fixes some grammer in preserve whitespaces notes.

PR Close #49928
2023-04-19 14:18:43 +00:00
Lars Gyrup Brink Nielsen a803bb5df3 docs(core): add version ranges for Angular 14.3 (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen d940ff482a docs: change section heading (#48753)
Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen 3bee32db86 docs(core): add version ranges for Angular 15.2 (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen 17d856aae1 docs(core): split versions table into LTS and non-LTS tables (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen d680b8eb09 docs(docs-infra): add versions document to code owners (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen 1ec84fbb3f docs(docs-infra): add versions document to the navigation (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen 351d257097 docs(core): include introductory text about version compatibility (#48753)
PR Close #48753
2023-04-19 14:07:32 +00:00
Lars Gyrup Brink Nielsen ab4e2c3176 docs(core): add Angular, Node.js, TypeScript, and RxJS version compatibility matrix (#48753)
PR Close #48753
2023-04-19 14:07:31 +00:00
Angular Robot 50720e41a8 docs: update events (#49569)
Generated `events.json` with the latest events retrieved from the Firebase DB.

Closes #49545

PR Close #49569
2023-04-19 14:05:45 +00:00
Angular Robot 318e3ed402 build: update angular/dev-infra digest to 1564c4e (#49916)
See associated pull request for more information.

PR Close #49916
2023-04-18 22:09:40 +00:00
arturovt 1b13f18779 docs: add Artur Androsovych to GDE resources (#48520)
PR Close #48520
2023-04-18 21:35:46 +00:00
Joey Perrott 209364d2c3 ci: update renovate.json (#49909)
Update renovate to ignore rules_pkg bazel dep and group the babel @types packages with the babel packages themselves.

PR Close #49909
2023-04-18 20:54:28 +00:00
Angular Robot 3fc96ddd63 build: update all non-major dependencies (#49909)
See associated pull request for more information.

PR Close #49909
2023-04-18 20:54:28 +00:00
Angular Robot de0d0b4757 build: update dependency build_bazel_rules_nodejs to v5.8.2 (#49910)
See associated pull request for more information.

PR Close #49910
2023-04-18 20:45:25 +00:00
Alan Agius ded7ede1d4 test: update platform-server integration tests to use the Angular CLI (#49900)
This commit updates the platform-server integration tests to use the Angular CLI as it makes it easier to add more tests and remove the custom webpack setup.

PR Close #49900
2023-04-18 19:47:03 +00:00
Angular Robot ec983fd663 build: update actions/cache digest to 88522ab (#49437)
See associated pull request for more information.

PR Close #49437
2023-04-18 19:46:17 +00:00
Angular Robot 5e4797cd16 build: update dependency google-closure-compiler to v20230411 (#49892)
See associated pull request for more information.

PR Close #49892
2023-04-18 19:07:14 +00:00
Angular Robot b046ecf2a5 build: update cross-repo angular dependencies (#49891)
See associated pull request for more information.

PR Close #49891
2023-04-18 19:06:46 +00:00
Jessica Janiuk 1190c75728 docs: Update hydration guide constraints section (#49908)
PR Close #49908
2023-04-18 19:05:24 +00:00
Jessica Janiuk fc81abd12c docs: add info on preserveWhitespaces to hydration guide (#49904)
PR Close #49904
2023-04-18 19:04:56 +00:00
Andrew Kushnir 44243f8d50 refactor(core): insert special marker only when text node content is an empty string (#49877)
Empty text nodes are not present in the server-rendered HTML output, thus we inject a special marker
at a text node location to later restore an empty text node at the client. Currently, we treat text nodes with spaces as "empty" as well, however those spaces are present in the HTML and text nodes are created in a browser. Adding extra annotation in this case results in extra text nodes created on the client and may trigger hydration issues. This commit updates the code to avoid treating text nodes with spaces as "empty".

PR Close #49877
2023-04-18 19:04:28 +00:00
Douglas Diniz Carvalho 7e286c5d2b docs: type clearTimer function as VoidFunction or undefined (#48480)
PR Close #48480
2023-04-18 19:03:58 +00:00
Douglas Diniz Carvalho 3d07ec1f89 docs: standardize examples using timers for SSR compatibility (#48480)
PR Close #48480
2023-04-18 19:03:58 +00:00
Alex Rickabaugh ead10aff41 refactor(compiler): next context merging in the template pipeline (#49797)
This commit adds a phase to the template pipeline to merge `nextContext()`
instructions that follow each other without context reads in between. That
is, the sequence:

```typescript
nextContext();
var v1 = nextContext();
```

becomes:

```typescript
var v1 = nextContext(2);
```

PR Close #49797
2023-04-18 17:00:52 +00:00
Alex Rickabaugh 84af3e302d refactor(compiler): convert literals and this in template pipeline (#49797)
This commit adds support for two new expression AST forms to the template
pipeline ingest step: literal values and `this`.

PR Close #49797
2023-04-18 17:00:52 +00:00
Alex Rickabaugh 9a37b3ed6a refactor(compiler): emit correct listener name in template pipeline (#49797)
This commit modifies the `ListenerOp` operation to capture the context
needed to generate the "correct" (per `TemplateDefinitionBuilder`) function
name for the handler function for the listener.

PR Close #49797
2023-04-18 17:00:52 +00:00
Alex Rickabaugh 59bed917d9 refactor(compiler): fix wrong instruction emit for resetView (#49797)
The `resetView` instruction in the template pipeline had a copy-paste error
where it was emitting a call to `reference` instead. This commit fixes the
issue.

PR Close #49797
2023-04-18 17:00:52 +00:00
Alex Rickabaugh c4fe1e329e refactor(compiler): implement operation chaining in the template pipeline (#49797)
This commit adds a chaining phase which post-processes reified template
pipeline operations, and collapses chainable instructions into chained
calls. Performing chaining as a post-processing step after reification
allows the specifically selected instruction variants to be known when
considering chaining two operations.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh 303ad05b9c refactor(compiler): variable optimizer for the template pipeline (#49797)
This commit adds a variable optimization pass to the template pipeline. The
pipeline generates all variables which might be referenced within a given
view's template function, regardless of whether other operations will read
those values.

The variable optimizer post-processes the IR and performs several variable-
related optimizations:

* It transforms variable declarations to side effectful expressions when the
  variable is not used, but its initializer has global effects which other
  operations rely upon.
* It removes variable declarations if those variables are not referenced and
  either they do not have global effects, or nothing relies on them.
* It inlines variable declarations when those variables are only used once
  and the inlining is semantically safe.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh cbda8054c5 refactor(compiler): handle textInterpolate with empty string bookends (#49797)
This commit teaches the template pipeline how to generate `textInterpolate`
when there's a single expression with no surrounding static text.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh f5f67e6917 refactor(compiler): reorder constant pool statements in template pipeline (#49797)
This commit reverses the generate template functions when adding them to the
constant pool in the template pipeline. This seems to better match the
ordering in which `TemplateDefinitionBuilder` generates template functions.
Further study is needed to determine if this is exactly accurate.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh d5c40a569b refactor(compiler): skip emit of empty blocks in template pipeline (#49797)
This commit configures the template pipeline to skip the emit of empty
create or update blocks of a template function.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh 4688464ac5 refactor(compiler): fix issues with advance() in the template pipeline (#49797)
`advance()` was not emitted correctly by the template pipeline. There were
two problems:

* it was not handled in `transformExpressionsInOp()`.
* it was not added to the list correctly in `phaseGenerateAdvance()`.

This commit addresses both problems.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh 3d2fc821e8 refactor(compiler): fix node ownership assertions in template pipeline ops (#49797)
This commit fixes a broken assertion in the template pipeline concerning the
ownership of nodes in `insertBefore`, as well as adjusts a few other
assertions.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh 3fa916047d refactor(compiler): don't throw on static attr bindings in the pipeline (#49797)
The template pipeline previously included an error when a static attribute
binding was found on an `<ng-template>`, under the assumption that this case
didn't happen in reality. It turns out that it does, so this commit removes
the error in favor of a comment to investigate the case further.

PR Close #49797
2023-04-18 17:00:51 +00:00
Alex Rickabaugh a2245663b0 refactor(compiler): reify the correct parameters to template() (#49797)
The template pipeline previously reified the parameters to `template()`
incorrectly. This commit adjusts the output to correctly reference the
attributes of the `template()` call.

PR Close #49797
2023-04-18 17:00:51 +00:00