Commit graph

29561 commits

Author SHA1 Message Date
Dylan Hunn
c013bff48a refactor(compiler): Support $event in host bindings (#51498)
Run the existing phase that deals with `$event` during host binding compilation.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
6669bea544 refactor(compiler): Share the same phase list for components and hosts (#51498)
Component compilation and host binding compilation previously used separate compilation emit functions. This was a bit messy, because we had to manage the relative orders of both phase lists. Indeed, there was already some inconsistency between the precise orders!

This commit refactors the emit functions to share the same phase list, and thus guarantees they will always be in the same order.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
bca26b88b1 refactor(compiler): Generalize the ordering phase to also order create mode (#51498)
`syntheticHostListener` and `listener` have ordering dependencies. We reuse the existing ordering phase, and generalize it to also order create mode instructions.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
f13223b140 refactor(compiler): Support host animation events. (#51498)
Animation listeners on host bindings result in a special `syntheticHostListener` instruction. We can now emit this instruction.

Additionally, the naming phase for events has been slightly refactored to smoothly incorporate whether the event is from a host listener, as well as whether it is an animation listener.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
1ea8617cd2 refactor(compiler): Support host binding listeners (#51498)
We can now ingest host bindings listeners into the template pipeline, and process them using the pre-existing phases.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
5546cb3197 refactor(compiler): More closely match TDB binding ordering (#51498)
For host bindings, `TemplateDefinitionBuilder` seems to use a different binding ordering, in which style bindings come after all the property bindings. We approximate that by treating `hostProperty` differently from `property` in the ordering phase.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
cae01dae1b refactor(compiler): Support class and style attrs in host bindings (#51498)
The template pipeline is already capable of parsing and processing class and style attributes on templates. We now extend that functionality to host bindings.

The parser, for some reason, splits out class and style attributes into a `specialAttributes` field. We merge them back into the main attributes map, and allow the template pipeline to process them normally.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
d0b83b14be refactor(compiler): Backwards compatibility with TDB for host attributes (#51498)
TemplateDefinitionBuilder only extracts host attributes if they are text attributes. For example, `[attr.foo]="'my-value'"` is not extracted despite being a string literal, because it is not a text attribute.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
8f90630dc8 refactor(compiler): Support synthetic host property bindings. (#51498)
Host property bindings can be animation bindings, and should be ingested and emitted as such, as well as being processed by the renaming phase.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
0df7828637 refactor(compiler): Extract host binding static attributes to hostAttrs (#51498)
Host bindings can apply static attributes. These will be extracted to a `hostAttrs` field on the host binding function's metadata.

In order to achieve this, we add an `attributes` field to the host binding job. Then, we peform attribute exraction on host bindings. We finally populate the `attributes` field directly, instead of relying on a `consts` array.

PR Close #51498
2023-08-28 21:51:04 +00:00
Dylan Hunn
8071ed36c5 refactor(compiler): Refactor the compilation job and unit abstractions (#51498)
Convert `CompilationJob` into a abstract class in order to extract common code. Separate host binding jobs and units, in order to allow for more code sharing.

PR Close #51498
2023-08-28 21:51:04 +00:00
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