Commit graph

27700 commits

Author SHA1 Message Date
Pawel Kozlowski
cdcfa09ab3 refactor(core): built-in control flow - repeaters (#51422)
Draft of the runtime implementation for the built-in repeaters.

PR Close #51422
2023-08-28 20:49:18 +00:00
Miles Malerba
88fcd27c6d refactor(compiler): add a pointer to the const array in i18nStart (#51353)
Adds a pointer to the const array index containing the i18n message to
the i18nStart instruction.

PR Close #51353
2023-08-28 18:57:08 +00:00
Miles Malerba
5f02b5810b refactor(compiler): resolve element placeholders in i18n messages (#51353)
Adds a new phase to resolve element placeholders in i18n messages.
This requires adding the i18n message to element ops, which means the
creation of i18n start/end ops can now be done in a separate phase
instead of during ingestion.

PR Close #51353
2023-08-28 18:57:08 +00:00
Miles Malerba
b064b29776 refactor(compiler): use correct closure variable naming (#51353)
Updates the closure variable naming for i18n variables to match those
generated by TemplateDefinitionBuilder

PR Close #51353
2023-08-28 18:57:08 +00:00
Miles Malerba
99f94747e4 refactor(compiler): extract text nodes in i18n blocks (#51353)
Removes text nodes from i18n blocks, since the text is already captured
in the i18n message.

PR Close #51353
2023-08-28 18:57:08 +00:00
Miles Malerba
d13a2ee064 refactor(compiler): support i18n messages in the consts array (#51353)
Creates a new `ExtractedMessageOp` which is consumed by the const
collection pahse to serialize the i18n message into the consts array.
Also adds support to the consts array for initialization statements.

PR Close #51353
2023-08-28 18:57:08 +00:00
Alex Rickabaugh
575a5588f8 refactor(compiler): initial implementation of i18n blocks (#51353)
Adds i18n block start & end ops, as well as a new phase to construct the
i18n message variable to be added to the consts array.

Co-authored-by: Alex Rickabaugh <alx+alxhub@alxandria.net>
Co-authored-by: Dylan Hunn <dylhunn@gmail.com>

PR Close #51353
2023-08-28 18:57:08 +00:00
Ward Bell
a28864d0f7 docs: migrate template guide and its code examples to standalone. (#51364)
Guide pages do not mention `NgModule` so they are untouched (and not "reviewed" either).

All code was migrated, including code in the `template-expression-operators` folder despite it only being referenced in the “archived” guide, `template-expression-operators.md`.

PR Close #51364
2023-08-28 18:36:51 +00:00
Shuaib hasan akib
dc4db80f9a docs(docs-infra): remove inactive resource from community page (#51418)
PR Close #51418
2023-08-28 18:36:25 +00:00
Dylan Hunn
9753347f8a docs: Add standalone edits to "Testing Components" (#51451)
Minimal updates to the "Testing Components" guide for standalone-by-default aio.

PR Close #51451
2023-08-28 18:35:56 +00:00
Andrew Scott
3dc74f3ac5 docs(router): Update the basic router guide to use standalone (#51452)
This commit updates the basic router-tutorial guide to use standalone features.

PR Close #51452
2023-08-28 18:35:31 +00:00
Andrew Kushnir
c4deaac5b0 refactor(core): initial implementation of {#defer} block runtime (#51347)
This commit adds an initial implementation of the `{#defer}` block runtime, which supports the `when` conditions. More conditions and basic prefetching support will be added in followup PRs.

PR Close #51347
2023-08-28 17:09:52 +00:00
Kristiyan Kostadinov
bf9663847d build: update type TypeScript 5.2 final (#51503)
Bumps up the repo to the stable version of TypeScript 5.2.

PR Close #51503
2023-08-28 17:02:30 +00:00
Mikka
1a1d0c90bf docs: remove MessageService information from HeroService section (#51501)
PR Close #51501
2023-08-28 16:44:57 +00:00
Andrew Scott
440684ddb4 docs(router): Update the url matcher guide to use standalone (#51450)
This commit updates the url matcher guide to use standalone rather than
NgModules.

PR Close #51450
2023-08-25 16:43:50 +00:00
Joey Perrott
c3349fb2a1 ci: fix escaping for determing current stable version (#51496)
Fix the escaping for the sed command determining the stable version

PR Close #51496
2023-08-24 20:35:40 +00:00
Jeremy Elbourn
6d29ab7818 docs(docs-infra): set meta description per page (#51487)
aio currently uses the same `<meta name="Description">` content for every page. It seems like this might be causing a problem with search engine indexing such that different pages are being marked as duplicates of each other. It's unfortunately impossible to know whether this will actually fix the issue without it going live.

PR Close #51487
2023-08-24 16:44:34 +00:00
Joey Perrott
26ad6d50cc build: add AIO_PAYLOAD_TOKEN env variable (#51489)
add environement variable for deployment

PR Close #51489
2023-08-24 16:08:59 +00:00
Joey Perrott
6ca8219007 build: provide CI_BUILD_URL env variable (#51488)
Provide the link to the job workflow on github actions

PR Close #51488
2023-08-23 22:44:59 +00:00
Kristiyan Kostadinov
fa72384ec5 refactor(compiler): introduce AST for outputting arrow functions (#51436)
Extends the compiler to add support for generating arrow functions in the output AST. This will be required for the `for` control flow block and we can potentially leverage it in other places to reduces the amount of generated code.

PR Close #51436
2023-08-23 14:45:33 -07:00
Joey Perrott
5cea2b52f6 ci: properly provide environment variables for aio deployment (#51484)
Provide environment variables

PR Close #51484
2023-08-23 14:44:39 -07:00
Joey Perrott
fd4e8b18bd build: include bazel build file in aio playground code (#51485)
Include the bazel build file in the aio playground code so it contains the same bazel
targets as the regular examples.

PR Close #51485
2023-08-23 14:44:03 -07:00
Shuaib hasan akib
574a759842 docs(docs-infra): Update text mdn to MDN (#51470)
PR Close #51470
2023-08-23 14:41:02 -07:00
Andrew Kushnir
1a8aa9ddfa release: cut the v17.0.0-next.1 release 2023-08-23 10:43:22 -07:00
Andrew Kushnir
189bb74205 docs: release notes for the v16.2.2 release 2023-08-23 10:38:19 -07:00
Joey Perrott
c9ce89ee5c ci: correctly check aio job results (#51464)
Correctly check the aio job result to determine if we should deploy.

PR Close #51464
2023-08-22 11:41:30 -07:00
Kristiyan Kostadinov
36663e6ef6 refactor(compiler): parse let parameters in for loop (#51398)
Adds the logic to parse `let` parameters of a `for` loop block which was missed in #51299.

PR Close #51398
2023-08-22 10:40:17 -07:00
Kristiyan Kostadinov
9f6b565abd refactor(compiler): parse for loop track as an expression (#51398)
Adds some logic to store the `track` parameter of a `for` loop block as an expression AST instead of a string.

PR Close #51398
2023-08-22 10:40:17 -07:00
Kristiyan Kostadinov
eb1faa8f87 refactor(compiler): don't allow as expressions in else if blocks (#51398)
Based on some discussions, these changes remove the ability to have an `as` expression on an `else if` block.

PR Close #51398
2023-08-22 10:40:17 -07:00
Jeevan Mahesha
362e069364 docs: add MSYS2 to DEVELOPER.md (#51459)
PR Close #51459
2023-08-22 10:39:23 -07:00
Andrew Scott
2aae92b05f refactor(router): Have router subscribe to transition events to update state (#48427)
Rather than the navigation transitions managing Router state, this
commit updates the Router to manage its own state based on ongoing
transition events. In the future, this can be abstracted even further to
have a totally separate class that manages the Router state. This would
allow the potential for swapping state manager implementations rather
than having to implement all types of state management in a single place.

One finding during tests was that unexpected errors thrown by the state management code moved
to the Router here will no longer be caught by the transition pipe's `catchError`.
This only includes calls to the following public Api methods:

* `go`, `replaceState`, `historyGo`, `isCurrentPathEqualTo` on `Location`
* `UrlSerializer.serialize`
* `UrlHandlingStrategy.merge`.

None of these methods should throw if the router is expected to function.
These might throw when tests include incomplete mocks, which is not
supported, or in cases where the actual browser methods like
`replaceState` would throw. This will already result in unexpected/unsupported
behavior. The failure case here is now arguably better - the navigation
itself still completes but the state update (either updating Router
internal state or updating the browser URL) fails separately and is
unhandled.

PR Close #48427
2023-08-22 08:04:00 -07:00
Alan Agius
bd150a2550 docs: remove update reference (#51449)
Remove reference that `--routing` was added in 8.1

PR Close #51449
2023-08-22 08:02:07 -07:00
Ben Hong
d2346a601d docs: migrate rxjs-interop guide to standalone (#51447)
PR Close #51447
2023-08-21 16:37:08 -07:00
Aristeidis Bampakos
9977727f73 docs: fix typos in inputs-outputs guide (#51428)
PR Close #51428
2023-08-21 16:35:56 -07:00
aanchal
119eaa5651 docs: add lang attribute in html files (#51269)
PR Close #51269
2023-08-21 16:33:43 -07:00
Aristeidis Bampakos
b7d25bbf47 docs: review Angular elements guide (#50043)
PR Close #50043
2023-08-21 16:32:52 -07:00
mgechev
803fc7f0f7 docs: add link to developer survey 2023 (#51444)
PR Close #51444
2023-08-21 13:43:49 -07:00
Andrew Scott
96d94ad130 fix(router): Ensure canceledNavigationResolution: 'computed' works on first page (#51441)
Setting the page ID is currently broken for the first page because the
helper method's second parameter is optional, which allowed the initally
`undefined` page ID to be used again when the router performs its
initial navigation.

fixes #50983

PR Close #51441
2023-08-21 13:01:58 -07:00
Mark Thompson
38671f7c14 docs(animations): update animation docs to be standalone first (#51390)
Update the animation example files to be standalone and use boostrap application, update the documentation to prioritize standalone

PR Close #51390
2023-08-21 13:01:20 -07:00
Yann-Thomas LE MOIGNE
3a686478ac docs(service-worker): Miss a comma in sample (#3) (#51336)
PR Close #51336
2023-08-21 08:24:31 -07:00
Matthieu Riegler
a9b3c006f8 fix(core): guard the jasmine hooks (#51394)
This commit fixes a regression introduced in #50063

Fixes #51382

PR Close #51394
2023-08-21 08:14:53 -07:00
Paul Gschwendtner
53434864cb ci: remove myself from pullapprove unavailability list (#51437)
Removes myself from the pullapprove unavailability list.

PR Close #51437
2023-08-21 08:14:01 -07:00
Naaajii
f724b8dd6b docs(docs-infra): fix margin on contribute page heading (#51393)
fix margin on h2 tag of contribute page being overwritten

closes #51391

PR Close #51393
2023-08-21 08:12:57 -07:00
Kristiyan Kostadinov
9152de1387 test(core): remove manually-written control flow instructions (#51380)
Updates the control flow tests to use the compiler instead of manually-written instructions. Also adds a couple of tests that I was using along the way to verify that things work as expected.

PR Close #51380
2023-08-18 10:01:02 -07:00
Kristiyan Kostadinov
9cc0cbed0c refactor(compiler): generate if block instructions (#51380)
Adds the logic to generate the instructions for `if` blocks. There are two primary use cases we need to account for:

A conditional that doesn't use the `as` parameter of the `if` block. To support it we generate a nested ternary expression that evaluates to the index of the template whose condition is truthy. If the block doesn't have an `else` branch, we pass in a special `-1` value which means that no view will be rendered.

Example with an `else`:
```ts
// {#if expr}
//   ...
//   {:else if otherExpr} ...
//   {:else} ...
// {/if}

if (rf & 1) {
  ɵɵtemplate(0, App_Conditional_0_Template, 0, 0);
  ɵɵtemplate(1, App_Conditional_1_Template, 0, 0);
  ɵɵtemplate(2, App_Conditional_2_Template, 0, 0);
}
if (rf & 2) {
  ɵɵconditional(0, ctx.expr ? 0 : ctx.otherExpr ? 1 : 2);
}
```

Example without an `else`:
```ts
// {#if expr}
//   ...
//   {:else if otherExpr} ...
// {/if}

if (rf & 1) {
  ɵɵtemplate(0, App_Conditional_0_Template, 0, 0);
  ɵɵtemplate(1, App_Conditional_1_Template, 0, 0);
}
if (rf & 2) {
  ɵɵconditional(0, ctx.expr ? 0 : ctx.otherExpr ? 1 : -1);
}
```

If a conditional captures it's value in an alias (e.g. `{#if expr; as foo}`) we need to assign the value to a temporary variable before passing it along to `conditional`.

```ts
// {#if expr; as alias}...{/if}
if (rf & 1) {
  ɵɵtemplate(0, App_Conditional_0_Template, 1, 0);
}
if (rf & 2) {
  let App_contFlowTmp;
  ɵɵconditional(0, (App_contFlowTmp = ctx.expr) ? 0 : -1, App_contFlowTmp);
}
```

PR Close #51380
2023-08-18 10:01:02 -07:00
Kristiyan Kostadinov
0c4c773fca refactor(compiler): generate switch block instructions (#51380)
Adds the logic to generate the instructions for `switch` instructions. For the following block:

```html
{#switch value()}
  {:case 0} case 0
  {:case 1} case 1
  {:case 2} case 2
  {:default} default
{/switch}
```

The compiler will produce the following output:

```ts
function App_Template(rf, ctx) {
  if (rf & 1) {
    ɵɵtemplate(0, App_Case_0_Template, 1, 0);
    ɵɵtemplate(1, App_Case_1_Template, 1, 0);
    ɵɵtemplate(2, App_Case_2_Template, 1, 0);
    ɵɵtemplate(3, App_Case_3_Template, 1, 0);
  }
  if (rf & 2) {
    let App_contFlowTmp;
    ɵɵconditional(0, (App_contFlowTmp = ctx.value()) === 0 ? 0 : App_contFlowTmp === 1 ? 1 : App_contFlowTmp === 2 ? 2 : 3);
  }
}
```

PR Close #51380
2023-08-18 10:01:02 -07:00
JoostK
5bd9fbd2c3 fix(compiler-cli): enforce a minimum version to be used when a library uses input transform (#51413)
Angular 16.1 introduced the input transform feature, requiring the partial compilation output to be extended
with a reference to the input transform function. This has resulted in a subtle breaking change, where older
versions of the Angular linker can no longer consume libraries that have started to use this feature.

We do try to support using a 16.1 library from an Angular 16.0 application, but if a library actually
adopts a new feature then this is no longer possible. In such cases, it is desirable to report a message
telling the user that their version of the Angular compiler is too old, as determined by the `"minVersion"`
property that is present in each partial declaration. This version would still indicate that the declaration
required at least Angular 14.0 to be compiled, but this is not accurate once input transforms are being
used. Consequently, this error would not be reported, causing a less informative error once the input transform
was being observed.

Fixes #51411

PR Close #51413
2023-08-18 07:58:53 -07:00
Matthieu Riegler
4663a33a0d refactor(platform-browser-dynamic): remove reexport of MetadataOverrider (#51412)
this commit removes an unnecessary re-export

PR Close #51412
2023-08-18 07:57:34 -07:00
Matthieu Riegler
de3be98417 docs: fix links in UpgradeAdapter (#51395)
PR Close #51395
2023-08-18 07:56:41 -07:00
Kristiyan Kostadinov
9cc52b9b85 feat(core): support TypeScript 5.2 (#51334)
Updates the project to support TypeScript 5.2.

PR Close #51334
2023-08-18 07:55:16 -07:00