angular/packages/core/src
Kristiyan Kostadinov 05a16b973d refactor(compiler): add support for advanced tracking expressions (#51618)
These changes build on top of #51514 to add support for advanced expressions inside the `track` parameter of `for` loop blocks. There are two different outputs that the compiler can generate:

1. If the tracking function only references the item or `$index`, the compiler generates a pure arrow function as a constant references in the `repeaterCreate` instruction.
2. If the tracking function has references to properties outside of the `for` loop block, the compiler will rewrite those references to go through `this` and generate a function declaration. The runtime will `bind` the declaration to the current component instance so that the rewritten `this` references are resolved correctly.

Advanced tracking expression come with the following limitations to ensure the best possible performance:
1. They can only reference the item, `$index` and properties directly on the component instance. This means that there'll be an error when accessing this like local template variables and references. While we could get this to work, we would have to traverse the context tree at runtime which will degrade the performance of the loop, because it's a linear time operation that is performed on each comparison. Furthermore, allowing local references would require us re-evaluate the list when any one of them has changed.
2. Pipes aren't allowed inside the tracking function.
3. Object literals and pipes used inside the tracking expression will be recreated on each invocation.

PR Close #51618
2023-09-05 14:19:18 +00:00
..
change_detection refactor(core): handle #24571 todos. (#49221) 2023-06-14 12:33:44 +02:00
compiler refactor(compiler): introduce compiler infrastructure for input transforms (#50225) 2023-05-22 14:48:02 +00:00
debug refactor(core): drop IE workarounds (#49763) 2023-04-13 14:01:45 +00:00
di docs(core): clarify InjectionToken usage (#51386) 2023-08-30 15:53:23 +00:00
hydration refactor(core): adjust defer block behavior on the server (#51530) 2023-09-01 19:15:16 +00:00
i18n docs(core): Make links out of @see tags (#50110) 2023-06-14 10:54:38 +02:00
interface docs(core): Make links out of @see tags (#50110) 2023-06-14 10:54:38 +02:00
linker refactor(core): adjust defer block behavior on the server (#51530) 2023-09-01 19:15:16 +00:00
metadata docs: Improve host binding docs (#51326) 2023-08-15 09:54:14 -07:00
reflection build(bazel): add bazel targets for aio doc generation 2022-11-22 13:51:16 -07:00
render refactor(core): handle #24571 todos. (#49221) 2023-06-14 12:33:44 +02:00
render3 refactor(compiler): add support for advanced tracking expressions (#51618) 2023-09-05 14:19:18 +00:00
sanitization feat(core): change the URL sanitization to only block javascript: URLs (#49659) 2023-04-04 15:01:13 -07:00
signals refactor(core): switch signals to a refcounting algorithm (#51226) 2023-09-01 14:18:41 +00:00
testability refactor: use queueMicrotask to schedule micro tasks instead of various helpers (#50485) 2023-06-15 16:38:21 +02:00
util refactor(core): Use intersections on branded types. (#49702) 2023-08-31 20:22:12 +00:00
view refactor: remove unnecessary file (#49042) 2023-02-17 11:08:33 -08:00
zone docs: add missing jsdocs for static ngzone methods (#50924) 2023-07-11 08:28:38 -07:00
application_config.ts feat(core): add mergeApplicationConfig method (#49253) 2023-03-01 11:20:31 -08:00
application_init.ts docs(core): Make links out of @see tags (#50110) 2023-06-14 10:54:38 +02:00
application_module.ts perf(core): make LOCALE_ID and other tokens from ApplicationModule tree-shakable (#45102) 2022-02-18 13:40:02 -08:00
application_ref.ts docs: fix see also links. (#51379) 2023-08-17 10:18:33 -07:00
application_tokens.ts refactor: add readonly to public InjectionToken types (#51125) 2023-08-14 17:17:35 -07:00
change_detection.ts perf(core): remove support for the deprecated WrappedValue (#43507) 2021-10-01 12:25:19 -04:00
console.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
core.externs.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core.ts feat(core): add afterRender and afterNextRender (#50607) 2023-08-01 13:02:27 -07:00
core_private_export.ts fix(core): avoid duplicated code between entry-points (primary, testing, rxjs-interop) (#51500) 2023-08-29 17:55:34 +00:00
core_reactivity_export.ts feat(core): add Angular Signals to the public API (#49150) 2023-02-22 11:27:21 -08:00
core_reactivity_export_internal.ts refactor(core): remove DeepReadonly type wrapper for signals (#49154) 2023-03-30 09:44:38 -07:00
core_render3_private_export.ts refactor(core): add instruction to reference component instance (#51618) 2023-09-05 14:19:18 +00:00
di.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_details_base_url.ts docs: extract XSS security doc URL into a constant (#48082) 2022-11-17 13:21:16 -08:00
error_handler.ts refactor(core): remove unused error handler logic (#46216) 2022-06-02 13:40:16 -07:00
errors.ts docs: Add Missing SSR integrity marker error doc page (#51340) 2023-08-14 14:39:25 -07:00
event_emitter.ts refactor(core): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:15 -07:00
initial_render_pending_tasks.ts fix(core): update ApplicationRef.isStable to account for rendering pending tasks (#50425) 2023-05-30 12:58:22 -07:00
linker.ts feat(core): introduce concept of DestroyRef (#49158) 2023-02-28 11:52:09 -08:00
metadata.ts feat(core): remove entryComponents (#49484) 2023-03-23 10:38:03 -07:00
platform_core_providers.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
r3_symbols.ts refactor(compiler): apply component metadata asynchronously when defer blocks are present (#51182) 2023-08-15 11:32:09 -07:00
render.ts refactor(core): clean up circular dependencies (#39722) 2020-11-18 09:15:29 -08:00
transfer_state.ts refactor(core): simplify state transfer escaping (#50201) 2023-05-10 11:31:34 -07:00
version.ts Revert "refactor(core): optimize calls to split and slice while computing version parts (#41208)" 2021-05-12 14:13:50 -04:00
zone.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00