@rx-angular/template
Version:
**Fully** Reactive Component Template Rendering in Angular. @rx-angular/template aims to be a reflection of Angular's built in renderings just reactive.
1 lines • 26 kB
Source Map (JSON)
{"version":3,"file":"template-let.mjs","sources":["../../../../libs/template/let/src/lib/let.directive.ts","../../../../libs/template/let/src/template-let.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Directive,\n ErrorHandler,\n inject,\n Injector,\n Input,\n isSignal,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n Signal,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { coerceAllFactory } from '@rx-angular/cdk/coercing';\nimport { toObservableMicrotaskInternal } from '@rx-angular/cdk/internals/core';\nimport {\n createTemplateNotifier,\n RxNotification,\n RxNotificationKind,\n} from '@rx-angular/cdk/notifications';\nimport {\n RxStrategyNames,\n RxStrategyProvider,\n} from '@rx-angular/cdk/render-strategies';\nimport {\n createTemplateManager,\n RxBaseTemplateNames,\n RxTemplateManager,\n RxViewContext,\n} from '@rx-angular/cdk/template';\nimport {\n defer,\n merge,\n NEVER,\n NextObserver,\n Observable,\n ObservableInput,\n ReplaySubject,\n Subject,\n Subscribable,\n Subscription,\n} from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/** @internal */\ntype RxLetTemplateNames = 'nextTpl' | RxBaseTemplateNames;\n\n/** @internal */\nconst RxLetTemplateNames = {\n ...RxBaseTemplateNames,\n next: 'nextTpl',\n} as const;\n\n/** @internal */\nexport interface RxLetViewContext<T> extends RxViewContext<T> {\n // to enable `as` syntax we have to assign the directives selector (var as v)\n rxLet: T;\n}\n\n/**\n * @Directive RxLet\n *\n * @description\n * In Angular there is one way to handle asynchronous values or streams in the template, the `async` pipe.\n * Even though the async pipe evaluates such values in the template, it is insufficient in many ways.\n * To name a few:\n * * it will only update the template when `NgZone` is also aware of the value change\n * * it leads to over rendering because it can only run global change detection\n * * it leads to too many subscriptions in the template\n * * it is cumbersome to work with values in the template\n *\n * read more about the LetDirective in the [official docs](https://www.rx-angular.io/docs/template/let-directive)\n *\n * **Conclusion - Structural directives**\n *\n * In contrast to global change detection, structural directives allow fine-grained control of change detection on a per directive basis.\n * The `LetDirective` comes with its own way to handle change detection in templates in a very efficient way.\n * However, the change detection behavior is configurable on a per directive or global basis.\n * This makes it possible to implement your own strategies, and also provides a migration path from large existing apps running with Angulars default change detection.\n *\n * This package helps to reduce code used to create composable action streams.\n * It mostly is used in combination with state management libs to handle user interaction and backend communication.\n *\n * ```html\n * <ng-container *rxLet=\"observableNumber$; let n\">\n * ...\n * </ng-container>\n * ```\n *\n *\n * @docsCategory LetDirective\n * @docsPage LetDirective\n * @publicApi\n */\n@Directive({ selector: '[rxLet]', standalone: true })\nexport class RxLet<U> implements OnInit, OnDestroy, OnChanges {\n /** @internal */\n private strategyProvider = inject(RxStrategyProvider);\n /** @internal */\n private cdRef = inject(ChangeDetectorRef);\n\n private injector = inject(Injector);\n /** @internal */\n private ngZone = inject(NgZone);\n /** @internal */\n private viewContainerRef = inject(ViewContainerRef);\n /** @internal */\n private errorHandler = inject(ErrorHandler);\n\n static ngTemplateGuard_rxLet: 'binding';\n\n /**\n * @description\n * The Observable or value to be bound to the context of a template.\n *\n * @example\n * const hero1 = {name: 'Batman'};\n * const hero$ = of(hero);\n *\n * <ng-container *rxLet=\"hero1; let hero\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * <ng-container *rxLet=\"hero$; let hero\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * @param { ObservableInput<U> | U | null | undefined } rxLet\n */\n @Input() rxLet:\n | ObservableInput<U>\n | Subscribable<U>\n | Signal<U>\n | U\n | null\n | undefined;\n\n /**\n * @description\n *\n * You can change the used `RenderStrategy` by using the `strategy` input of the `*rxLet`. It accepts\n * an `Observable<RxStrategyNames>` or [`RxStrategyNames`](https://github.com/rx-angular/rx-angular/blob/b0630f69017cc1871d093e976006066d5f2005b9/libs/cdk/render-strategies/src/lib/model.ts#L52).\n *\n * The default value for strategy is\n * [`normal`](https://www.rx-angular.io/docs/template/cdk/render-strategies/strategies/concurrent-strategies).\n *\n * Read more about this in the\n * [official docs](https://www.rx-angular.io/docs/template/let-directive#use-render-strategies-strategy).\n *\n * @example\n *\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <ng-container *rxLet=\"hero$; let hero; strategy: strategy\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * <ng-container *rxLet=\"hero$; let hero; strategy: strategy$\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n * `\n * })\n * export class AppComponent {\n * strategy = 'low';\n * strategy$ = of('immediate');\n * }\n *\n * @param { string | Observable<string> | undefined } strategyName\n * @see {@link RxStrategyNames}\n */\n @Input('rxLetStrategy')\n set strategy(strategyName: string | Observable<string> | undefined) {\n this.strategyHandler.next(strategyName);\n }\n\n /**\n * @description\n * Defines the template for the complete state. Will be\n * shown when the bound Observable is in \"complete\" state.\n *\n * @example\n * <ng-container *rxLet=\"hero$; let hero; complete: completeTemplate\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n * <ng-template #completeTemplate>\n * <mat-icon>thumb_up</mat-icon>\n * </ng-template>\n *\n * @param { TemplateRef<RxLetViewContext<U | undefined | null> | null> } complete\n */\n @Input('rxLetComplete')\n complete: TemplateRef<RxLetViewContext<U | undefined | null> | null>;\n\n /**\n * @description\n * Defines the template for the error state. Will be\n * shown when the bound Observable is in \"error\" state.\n *\n * @example\n * <ng-container *rxLet=\"hero$; let hero; error: errorTemplate\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n * <ng-template #errorTemplate>\n * <mat-icon>thumb_down</mat-icon>\n * </ng-template>\n *\n * @param { TemplateRef<RxLetViewContext<U | undefined | null> | null> } error\n */\n @Input('rxLetError')\n error: TemplateRef<RxLetViewContext<U | undefined | null> | null>;\n\n /**\n * @description\n * Defines the template for the suspense state. Will be\n * shown when the bound Observable is in \"suspense\" state.\n * Suspense means any undefined value, a never emitted value or `NEVER` itself.\n *\n * @example\n * <ng-container *rxLet=\"hero$; let hero; suspense: suspenseTemplate\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n * <ng-template #suspenseTemplate>\n * <mat-progress-spinner></mat-progress-spinner>\n * </ng-template>\n *\n * @param { TemplateRef<RxLetViewContext<U | undefined | null> | null> } suspense\n */\n @Input('rxLetSuspense')\n suspense: TemplateRef<RxLetViewContext<U | undefined | null> | null>;\n\n /**\n * @description\n * A trigger to manually set the active template. It accepts a `RxNotificationKind`\n * which determines what template to display. If no template is given, a context\n * variable resembling the notification state is put into the `Next`\n * template of the directive\n *\n * @example\n * <ng-container\n * *rxLet=\"\n * hero$;\n * let hero;\n * let e = error;\n * contextTrigger: contextTrigger$\n * \">\n *\n * <app-hero [hero]=\"hero\"></app-hero>\n * <error *ngIf=\"e\"></error>\n * </ng-container>\n *\n * // trigger template from component.ts\n * contextTrigger$.next(RxNotificationKind.error)\n *\n * @param { Observable<RxNotificationKind> } contextTrigger\n * @see {@link RxNotificationKind}\n */\n @Input('rxLetContextTrigger') contextTrigger?: Observable<RxNotificationKind>;\n\n /**\n * @description\n * A trigger to manually activate the complete template. It accepts any value,\n * on emission it will display the error template. If no template is given,\n * the complete context variable will complete set to true instead.\n *\n * @example\n * <ng-container\n * *rxLet=\"\n * hero$;\n * let hero;\n * let c = complete;\n * completeTrigger: completeTrigger$\n * \">\n *\n * <app-hero [hero]=\"hero\"></app-hero>\n * <done *ngIf=\"c\"></done>\n * </ng-container>\n *\n * // trigger template from component.ts\n * completeTrigger$.next()\n *\n * @param { Observable<unknown> } completeTrigger\n */\n @Input('rxLetCompleteTrigger') completeTrigger?: Observable<unknown>;\n\n /**\n * @description\n * A trigger to manually activate the error template. It accepts any value,\n * on emission it will display the error template. If no template is given,\n * the error context variable will be set to true instead.\n *\n * @example\n * <ng-container\n * *rxLet=\"\n * hero$;\n * let hero;\n * let e = error;\n * errorTrigger: errorTrigger$\n * \">\n *\n * <app-hero [hero]=\"hero\"></app-hero>\n * <error *ngIf=\"e\"></error>\n * </ng-container>\n *\n * // trigger template from component.ts\n * errorTrigger$.next()\n *\n * @param { Observable<unknown> } errorTrigger\n */\n @Input('rxLetErrorTrigger') errorTrigger?: Observable<unknown>;\n\n /**\n * @description\n * A trigger to manually activate the suspense template. It accepts any value,\n * on emission it will display the suspense template. If no template is given,\n * the suspense context variable will be set to true instead.\n *\n * @example\n * <ng-container\n * *rxLet=\"\n * hero$;\n * let hero;\n * let s = suspense;\n * suspenseTrigger: suspenseTrigger$\n * \">\n *\n * <app-hero [hero]=\"hero\"></app-hero>\n * <loader *ngIf=\"s\"></loader>\n * </ng-container>\n *\n *\n * // trigger template from component.ts\n * suspenseTrigger$.next()\n *\n * @param { Observable<unknown> } suspenseTrigger\n */\n @Input('rxLetSuspenseTrigger') suspenseTrigger?: Observable<unknown>;\n\n /**\n * @description\n * A trigger to manually activate the default template. It accepts any value,\n * on emission it will switch to the let directives default template.\n *\n * @example\n * <ng-container\n * *rxLet=\"\n * hero$;\n * let hero;\n * suspense: suspense\n * nextTrigger: nextTrigger$\n * \">\n *\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * <ng-template #suspense><loader></loader></ng-template>\n *\n * // trigger template from component.ts\n * nextTrigger$.next()\n *\n * @param { Observable<unknown> } nextTrigger\n */\n @Input('rxLetNextTrigger') nextTrigger?: Observable<unknown>;\n\n /**\n * @description\n * A `Subject` which emits whenever *rxFor finished rendering a set changes to the view.\n * This enables developers to perform actions when a list has finished rendering.\n * The `renderCallback` is useful in situations where you rely on specific DOM properties like the `height` a\n * table after all items got rendered.\n * It is also possible to use the renderCallback in order to determine if a view should be visible or not. This\n * way developers can hide a list as long as it has not finished rendering.\n *\n * The result of the `renderCallback` will contain the currently rendered set of items in the iterable.\n *\n * @example\n * \\Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: trackItem;\n * renderCallback: itemsRendered;\n * \">\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$: Observable<Item[]> = itemService.getItems();\n * trackItem = (idx, item) => item.id;\n * // this emits whenever rxFor finished rendering changes\n * itemsRendered = new Subject<Item[]>();\n *\n * constructor(elementRef: ElementRef<HTMLElement>) {\n * itemsRendered.subscribe(() => {\n * // items are rendered, we can now scroll\n * elementRef.scrollTo({bottom: 0});\n * })\n * }\n * }\n *\n * @param callback\n */\n @Input('rxLetRenderCallback')\n set renderCallback(callback: NextObserver<U>) {\n this._renderObserver = callback;\n }\n\n /**\n * @description\n *\n * When local rendering strategies are used, we need to treat view and content queries in a\n * special way.\n * To make `*rxLet` in such situations, a certain mechanism is implemented to\n * execute change detection on the parent (`parent`).\n *\n * This is required if your components state is dependent on its view or content children:\n *\n * - `@ViewChild`\n * - `@ViewChildren`\n * - `@ContentChild`\n * - `@ContentChildren`\n *\n * Read more about this in the\n * [official\n * docs](https://www.rx-angular.io/docs/template/let-directive#local-strategies-and-view-content-queries-parent).\n *\n * @example\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxLet=\"\n * item$;\n * let item;\n * parent: true;\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * item$ = itemService.getItem();\n * }\n *\n * @param boolean\n *\n * @deprecated this flag will be dropped soon, as it is no longer required when using signal based view & content queries\n */\n @Input('rxLetParent') renderParent = this.strategyProvider.config.parent;\n\n /**\n * @description\n * A flag to control whether *rxLet templates are created within `NgZone` or not.\n * The default value is `true, `*rxLet` will create it's `EmbeddedViews` inside `NgZone`.\n *\n * Event listeners normally trigger zone. Especially high frequently events cause performance issues.\n *\n * Read more about this in the\n * [official docs](https://www.rx-angular.io/docs/template/let-directive#working-with-event-listeners-patchzone).\n *\n * @example\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxLet=\"\n * item$;\n * let item;\n * patchZone: false;\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * item$ = itemService.getItem();\n * }\n */\n @Input('rxLetPatchZone') patchZone = this.strategyProvider.config.patchZone;\n\n /** @internal */\n private observablesHandler = createTemplateNotifier<U>();\n /** @internal */\n private strategyHandler = coerceAllFactory<string>(\n () => new ReplaySubject<RxStrategyNames>(1),\n );\n /** @internal */\n private triggerHandler = new ReplaySubject<RxNotificationKind>(1);\n\n /** @internal */\n private _renderObserver: NextObserver<any>;\n\n /** @internal */\n private subscription: Subscription = new Subscription();\n\n /** @internal */\n private templateManager: RxTemplateManager<\n U,\n RxLetViewContext<U | undefined | null>,\n RxLetTemplateNames\n >;\n\n /** @internal */\n private rendered$ = new Subject<void>();\n\n /** @internal */\n readonly templateNotification$ = new Subject<RxNotification<U>>();\n\n /** @internal */\n readonly values$ = this.observablesHandler.values$;\n\n @Output() readonly rendered = defer(() => this.rendered$);\n\n /** @internal */\n static ngTemplateContextGuard<U>(\n dir: RxLet<U>,\n ctx: unknown | null | undefined,\n ): ctx is RxLetViewContext<U> {\n return true;\n }\n\n constructor(private templateRef: TemplateRef<RxLetViewContext<U>>) {}\n\n /** @internal */\n ngOnInit() {\n this.subscription.add(\n this.templateManager\n .render(merge(this.values$, this.templateNotification$))\n .subscribe((n) => {\n this.rendered$.next(n);\n this._renderObserver?.next(n);\n }),\n );\n this.subscription.add(\n merge(\n this.contextTrigger || NEVER,\n this.nextTrigger?.pipe(map(() => RxNotificationKind.Next)) || NEVER,\n this.suspenseTrigger?.pipe(map(() => RxNotificationKind.Suspense)) ||\n NEVER,\n this.completeTrigger?.pipe(map(() => RxNotificationKind.Complete)) ||\n NEVER,\n this.errorTrigger?.pipe(map(() => RxNotificationKind.Error)) || NEVER,\n )\n .pipe(filter((v) => !!v))\n .subscribe((t) => this.triggerHandler.next(t)),\n );\n }\n\n /** @internal */\n ngOnChanges(changes: SimpleChanges) {\n if (!this.templateManager) {\n this._createTemplateManager();\n }\n\n if (changes.complete) {\n this.templateManager.addTemplateRef(\n RxLetTemplateNames.complete,\n this.complete,\n );\n }\n\n if (changes.suspense) {\n this.templateManager.addTemplateRef(\n RxLetTemplateNames.suspense,\n this.suspense,\n );\n this.observablesHandler.withInitialSuspense(!!this.suspense);\n }\n\n if (changes.error) {\n this.templateManager.addTemplateRef(RxLetTemplateNames.error, this.error);\n }\n\n if (changes.rxLet) {\n if (isSignal(this.rxLet)) {\n this.observablesHandler.next(\n toObservableMicrotaskInternal(this.rxLet, {\n injector: this.injector,\n }),\n );\n } else {\n this.observablesHandler.next(this.rxLet);\n }\n }\n }\n\n /** @internal */\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n\n /** @internal */\n private _createTemplateManager(): void {\n this.templateManager = createTemplateManager<\n U,\n RxLetViewContext<U>,\n RxLetTemplateNames\n >({\n templateSettings: {\n viewContainerRef: this.viewContainerRef,\n customContext: (rxLet) => ({ rxLet }),\n },\n renderSettings: {\n cdRef: this.cdRef,\n parent: !!this.renderParent,\n patchZone: this.patchZone ? this.ngZone : false,\n defaultStrategyName: this.strategyProvider.primaryStrategy,\n strategies: this.strategyProvider.strategies,\n errorHandler: this.errorHandler,\n },\n notificationToTemplateName: {\n [RxNotificationKind.Suspense]: () =>\n this.suspense ? RxLetTemplateNames.suspense : RxLetTemplateNames.next,\n [RxNotificationKind.Next]: () => RxLetTemplateNames.next,\n [RxNotificationKind.Error]: () =>\n this.error ? RxLetTemplateNames.error : RxLetTemplateNames.next,\n [RxNotificationKind.Complete]: () =>\n this.complete ? RxLetTemplateNames.complete : RxLetTemplateNames.next,\n },\n templateTrigger$: this.triggerHandler,\n });\n\n this.templateManager.addTemplateRef(\n RxLetTemplateNames.next,\n this.templateRef,\n );\n this.templateManager.nextStrategy(this.strategyHandler.values$);\n }\n}\n","/**\n * Generated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