@rs-x/angular 0.4.22 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,161 +1,40 @@
1
- # RS-X Angular Pipe
1
+ # @rs-x/angular
2
2
 
3
- The **RS-X Angular Extension** provides seamless integration of RS-X expressions within Angular templates. It allows you to bind expressions to your data models, making your templates fully reactive without extra boilerplate.
3
+ Angular pipe integration for rs-x bind RS-X expressions to Angular templates with automatic reactive updates.
4
4
 
5
- ## Installation
6
-
7
- Update the `dependencies` section in your `package.json` to include the required RS-X packages. You can ignore the version numbers and use the latest versions compatible with your Angular version. The latest RS-X packages are currently built with Angular 21. After updating, run `npm install` to install the dependencies.
8
-
9
- ```json
10
- "dependencies": {
11
- "@rs-x/core": "^0.4.12",
12
- "@rs-x/state-manager": "^0.4.12",
13
- "@rs-x/expression-parser": "^0.4.12",
14
- "@rs-x/angular": "^0.4.12",
15
- },
16
- ```
5
+ **Docs:** [rsxjs.com](https://rsxjs.com)
17
6
 
18
- ## Prepare Angular application for using rs-x
7
+ ---
19
8
 
20
- Add the RS-X providers to the `providers` array when bootstrapping your Angular application. After that you can use the rsx-pipe and inject the rsx expression factory as a service
21
-
22
- So
9
+ ## Installation
23
10
 
24
- ```ts
25
- providers: [...providexRsx()];
11
+ ```bash
12
+ npm install @rs-x/core @rs-x/state-manager @rs-x/expression-parser @rs-x/angular
26
13
  ```
27
14
 
28
- Example:
15
+ ## Setup
29
16
 
30
17
  ```ts
31
- import { bootstrapApplication } from '@angular/platform-browser';
32
- import { App } from './app/app';
33
- import {
34
- provideRouter,
35
- withDebugTracing,
36
- withViewTransitions,
37
- } from '@angular/router';
38
- import { provideBrowserGlobalErrorListeners } from '@angular/core';
39
18
  import { providexRsx } from '@rs-x/angular';
40
19
 
41
20
  bootstrapApplication(App, {
42
- providers: [
43
- provideRouter([], withDebugTracing(), withViewTransitions()),
44
- provideBrowserGlobalErrorListeners(),
45
- ...providexRsx(),
46
- ],
47
- }).catch((err) => console.error(err));
21
+ providers: [...providexRsx()],
22
+ });
48
23
  ```
49
24
 
50
- ## Rsx pipe
51
-
52
- The `rsx` pipe enables binding RS-X expressions or strings to Angular templates and automatically updates the view whenever the underlying data changes. It transforms expressions into reactive values, subscribes to changes, triggers Angular change detection, and cleans up subscriptions when no longer needed. It supports both synchronous and asynchronous data sources.
53
-
54
- The value passed to the `rsx` pipe can be either an expression string or an expression tree. Expression trees are created by the expression factory. The `rsx` pipe also requires a model, as the expression tree is bound to that model to resolve the necessary data.
55
-
56
- Example:
25
+ ## Usage
57
26
 
58
27
  ```ts
59
- import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core';
60
28
  import { RsxPipe } from '@rs-x/angular';
61
- import { type IExpression } from '@rs-x/expression-parser';
62
-
63
29
 
64
30
  @Component({
65
- selector: 'rsx-field',
66
- standalone: true,
67
- imports: [ RsxPipe],
68
- template: ' {{ expression | rsx: model }}',
69
- changeDetection: ChangeDetectionStrategy.OnPush
31
+ imports: [RsxPipe],
32
+ template: `{{ expression | rsx: model }}`,
70
33
  })
71
- export class RsxField {
72
- @Input() expression!: string | IExpression;
73
- @Input() model!: object;
74
- ```
75
-
76
- ## Injection the expression factory and change transaction manager
77
-
78
- - **Expression Factory**: Used to translate a JavaScript expression string into an observable expression tree.
79
- - **Change Transaction Manager**: Used to temporarily suspend change event emission, allowing you to update the model without emitting more than one change event per expression.
80
-
81
- The example below shows how you can use these two services.
82
-
83
- ```ts
84
- import { inject, Injectable } from '@angular/core';
85
-
86
- import {
87
- IExpressionChangeTransactionManagerToken,
88
- IExpressionFactoryToken,
89
- } from '@rs-x/angular';
90
- import { IExpression } from '@rs-x/expression-parser';
91
-
92
- import { Observable, Subject, Subscription } from 'rxjs';
93
-
94
- interface IModel {
95
- x: number;
96
- r: number;
97
- }
98
-
99
- @Injectable({ providedIn: 'root' })
100
- export class MyFormula {
101
- private _isDisposed = false;
102
- private readonly _expressionFactory = inject(IExpressionFactoryToken);
103
- private readonly _expressionChangeTransactionManager = inject(
104
- IExpressionChangeTransactionManagerToken,
105
- );
106
- private readonly _changed: Subject<number | undefined>;
107
- private readonly _changedSubscription: Subscription;
108
- private readonly _expression: IExpression<number | undefined>;
109
- private readonly _model: IModel = {
110
- x: 10,
111
- r: 2,
112
- };
113
-
114
- constructor() {
115
- this._changed = new Subject();
116
- this._expression = this._expressionFactory.create(
117
- this._model,
118
- 'r * x * (1 - x)',
119
- );
120
- this._changedSubscription = this._expression.changed.subscribe(() =>
121
- this._changed.next(this._expression.value),
122
- );
123
- }
124
-
125
- public get changed(): Observable<number | undefined> {
126
- return this._changed;
127
- }
128
-
129
- public dispose(): void {
130
- if (this._isDisposed) {
131
- return;
132
- }
133
- this._expression.dispose();
134
- this._changedSubscription.unsubscribe();
135
- this._isDisposed = true;
136
- }
137
-
138
- public update(r: number, x: number): void {
139
- // Suspend change event emission to prevent emitting it twice
140
- this._expressionChangeTransactionManager.suspend();
141
- this._model.r = r;
142
- this._model.x = x;
143
- this._expressionChangeTransactionManager.continue();
144
- }
34
+ export class MyComponent {
35
+ expression = 'a + b';
36
+ model = { a: 1, b: 2 };
145
37
  }
146
38
  ```
147
39
 
148
- ## Benefits
149
-
150
- - **Reactive Templates:** Automatically updates Angular views whenever bound data changes.
151
- - **Supports Complex Data:** Works with synchronous, asynchronous, or mixed data models.
152
- - **Minimal Boilerplate:** No manual subscriptions or change detection needed.
153
- - **Full Angular Integration:** Works seamlessly with Angular’s dependency injection and change detection system.
154
-
155
- ## References
156
-
157
- - [RS-X]('../../../readme.md')
158
- - [RS-X core]('../../../rs-x-core/readme.md')
159
- - [RS-X state manager]('../../../rs-x-state-manager/readme.md')
160
- - [RS-X expression parser]('../../../rs-x-expression-parser/readme.md')
161
- - [RS=X angular demo](https://stackblitz.com/~/github.com/robert-sanders-software-ontwikkeling/rs-x-angular-demo)
40
+ See [rsxjs.com](https://rsxjs.com) for full documentation and examples.
@@ -38,6 +38,7 @@ class RsxPipe {
38
38
  _changedSubscription;
39
39
  _lastExpressionString;
40
40
  _lastContext;
41
+ _ownsExpression = false;
41
42
  _value;
42
43
  transform(expression, context) {
43
44
  if ((expression instanceof AbstractExpression &&
@@ -56,11 +57,13 @@ class RsxPipe {
56
57
  if (expression instanceof AbstractExpression) {
57
58
  this._lastExpressionString = undefined;
58
59
  this._expression = expression;
60
+ this._ownsExpression = false;
59
61
  }
60
62
  else if (Type.isString(expression)) {
61
63
  this._lastExpressionString = expression;
62
64
  if (context) {
63
65
  this._expression = this._expressionFactory.create(context, expression);
66
+ this._ownsExpression = true;
64
67
  }
65
68
  }
66
69
  else if (!Type.isNullOrUndefined(expression)) {
@@ -79,11 +82,12 @@ class RsxPipe {
79
82
  });
80
83
  }
81
84
  disposeExpression() {
82
- this._changedSubscription?.unsubscribe();
83
- this._changedSubscription = undefined;
84
- if (this._lastExpressionString) {
85
+ if (this._ownsExpression) {
85
86
  this._expression?.dispose();
86
87
  }
88
+ this._ownsExpression = false;
89
+ this._changedSubscription?.unsubscribe();
90
+ this._changedSubscription = undefined;
87
91
  this._expression = undefined;
88
92
  }
89
93
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: RsxPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -1 +1 @@
1
- {"version":3,"file":"rs-x-angular.mjs","sources":["../../../projects/rsx/src/lib/rsx.providers.ts","../../../projects/rsx/src/lib/rsx.pipe.ts","../../../projects/rsx/src/public-api.ts","../../../projects/rsx/src/rs-x-angular.ts"],"sourcesContent":["import { APP_INITIALIZER, InjectionToken, type Provider } from '@angular/core';\n\nimport { InjectionContainer } from '@rs-x/core';\nimport {\n type IExpressionChangeTransactionManager,\n type IExpressionFactory,\n RsXExpressionParserInjectionTokens,\n RsXExpressionParserModule,\n} from '@rs-x/expression-parser';\n\nexport const IExpressionFactoryToken = new InjectionToken<IExpressionFactory>(\n 'IExpressionFactoryProvider',\n);\n\nexport const IExpressionChangeTransactionManagerToken =\n new InjectionToken<IExpressionChangeTransactionManager>(\n 'IExpressionChangeTransactionManager',\n );\n\nfunction initializeRsx(): () => Promise<void> {\n return () => {\n if (\n InjectionContainer.isBound(\n RsXExpressionParserInjectionTokens.IExpressionFactory,\n )\n ) {\n return Promise.resolve();\n }\n return InjectionContainer.load(RsXExpressionParserModule);\n };\n}\n\nexport function providexRsx(): Provider[] {\n return [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeRsx,\n multi: true,\n },\n {\n provide: IExpressionFactoryToken,\n useFactory: () =>\n InjectionContainer.get(\n RsXExpressionParserInjectionTokens.IExpressionFactory,\n ),\n },\n {\n provide: IExpressionChangeTransactionManagerToken,\n useFactory: () =>\n InjectionContainer.get(\n RsXExpressionParserInjectionTokens.IExpressionChangeTransactionManager,\n ),\n },\n ];\n}\n","import {\n ChangeDetectorRef,\n inject,\n type OnDestroy,\n Pipe,\n type PipeTransform,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { Type, UnsupportedException } from '@rs-x/core';\nimport { AbstractExpression, type IExpression } from '@rs-x/expression-parser';\n\nimport { IExpressionFactoryToken } from './rsx.providers';\n\n@Pipe({\n name: 'rsx',\n pure: false,\n})\nexport class RsxPipe implements PipeTransform, OnDestroy {\n private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n private readonly _expressionFactory = inject(IExpressionFactoryToken);\n private _expression?: IExpression<unknown>;\n private _changedSubscription?: Subscription;\n private _lastExpressionString?: string;\n private _lastContext?: object;\n private _value: unknown;\n\n public transform<T>(\n expression: string | IExpression<T> | null | undefined,\n context?: object,\n ): T {\n if (\n (expression instanceof AbstractExpression &&\n this._expression !== expression) ||\n expression !== this._lastExpressionString ||\n context !== this._lastContext\n ) {\n this.disposeExpression();\n this.createExpression(expression, context);\n }\n\n return this._value as T;\n }\n\n public ngOnDestroy(): void {\n this.disposeExpression();\n }\n\n private createExpression(\n expression: string | IExpression | null | undefined,\n context?: object,\n ): void {\n if (expression instanceof AbstractExpression) {\n this._lastExpressionString = undefined;\n this._expression = expression;\n } else if (Type.isString(expression)) {\n this._lastExpressionString = expression;\n if (context) {\n this._expression = this._expressionFactory.create(context, expression);\n }\n } else if (!Type.isNullOrUndefined(expression)) {\n throw new UnsupportedException(`string or IExpression expected`);\n }\n\n this._lastContext = context;\n\n this.tryToSubscribeToExpression();\n }\n\n private tryToSubscribeToExpression(): void {\n if (!this._expression) {\n return;\n }\n this._changedSubscription = this._expression.changed.subscribe(() => {\n this._value = this._expression!.value;\n this._changeDetectorRef.markForCheck();\n });\n }\n\n private disposeExpression(): void {\n this._changedSubscription?.unsubscribe();\n this._changedSubscription = undefined;\n\n if (this._lastExpressionString) {\n this._expression?.dispose();\n }\n this._expression = undefined;\n }\n}\n","/*\n * Public API Surface of rsx\n */\n\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,uBAAuB,GAAG,IAAI,cAAc,CACvD,4BAA4B;MAGjB,wCAAwC,GACnD,IAAI,cAAc,CAChB,qCAAqC;AAGzC,SAAS,aAAa,GAAA;AACpB,IAAA,OAAO,MAAK;QACV,IACE,kBAAkB,CAAC,OAAO,CACxB,kCAAkC,CAAC,kBAAkB,CACtD,EACD;AACA,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;QAC1B;AACA,QAAA,OAAO,kBAAkB,CAAC,IAAI,CAAC,yBAAyB,CAAC;AAC3D,IAAA,CAAC;AACH;SAEgB,WAAW,GAAA;IACzB,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,UAAU,EAAE,aAAa;AACzB,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,uBAAuB;YAChC,UAAU,EAAE,MACV,kBAAkB,CAAC,GAAG,CACpB,kCAAkC,CAAC,kBAAkB,CACtD;AACJ,SAAA;AACD,QAAA;AACE,Y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","../../../projects/rsx/src/public-api.ts","../../../projects/rsx/src/rs-x-angular.ts"],"sourcesContent":["import { APP_INITIALIZER, InjectionToken, type Provider } from '@angular/core';\n\nimport { InjectionContainer } from '@rs-x/core';\nimport {\n type IExpressionChangeTransactionManager,\n type IExpressionFactory,\n RsXExpressionParserInjectionTokens,\n RsXExpressionParserModule,\n} from '@rs-x/expression-parser';\n\nexport const IExpressionFactoryToken = new InjectionToken<IExpressionFactory>(\n 'IExpressionFactoryProvider',\n);\n\nexport const IExpressionChangeTransactionManagerToken =\n new InjectionToken<IExpressionChangeTransactionManager>(\n 'IExpressionChangeTransactionManager',\n );\n\nfunction initializeRsx(): () => Promise<void> {\n return () => {\n if (\n InjectionContainer.isBound(\n RsXExpressionParserInjectionTokens.IExpressionFactory,\n )\n ) {\n return Promise.resolve();\n }\n return InjectionContainer.load(RsXExpressionParserModule);\n };\n}\n\nexport function providexRsx(): Provider[] {\n return [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeRsx,\n multi: true,\n },\n {\n provide: IExpressionFactoryToken,\n useFactory: () =>\n InjectionContainer.get(\n RsXExpressionParserInjectionTokens.IExpressionFactory,\n ),\n },\n {\n provide: IExpressionChangeTransactionManagerToken,\n useFactory: () =>\n InjectionContainer.get(\n RsXExpressionParserInjectionTokens.IExpressionChangeTransactionManager,\n ),\n },\n ];\n}\n","import {\n ChangeDetectorRef,\n inject,\n type OnDestroy,\n Pipe,\n type PipeTransform,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { Type, UnsupportedException } from '@rs-x/core';\nimport { AbstractExpression, type IExpression } from '@rs-x/expression-parser';\n\nimport { IExpressionFactoryToken } from './rsx.providers';\n\n@Pipe({\n name: 'rsx',\n pure: false,\n})\nexport class RsxPipe implements PipeTransform, OnDestroy {\n private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n private readonly _expressionFactory = inject(IExpressionFactoryToken);\n private _expression?: IExpression<unknown>;\n private _changedSubscription?: Subscription;\n private _lastExpressionString?: string;\n private _lastContext?: object;\n private _ownsExpression = false;\n private _value: unknown;\n\n public transform<T>(\n expression: string | IExpression<T> | null | undefined,\n context?: object,\n ): T {\n if (\n (expression instanceof AbstractExpression &&\n this._expression !== expression) ||\n expression !== this._lastExpressionString ||\n context !== this._lastContext\n ) {\n this.disposeExpression();\n this.createExpression(expression, context);\n }\n\n return this._value as T;\n }\n\n public ngOnDestroy(): void {\n this.disposeExpression();\n }\n\n private createExpression(\n expression: string | IExpression | null | undefined,\n context?: object,\n ): void {\n if (expression instanceof AbstractExpression) {\n this._lastExpressionString = undefined;\n this._expression = expression;\n this._ownsExpression = false;\n } else if (Type.isString(expression)) {\n this._lastExpressionString = expression;\n if (context) {\n this._expression = this._expressionFactory.create(context, expression);\n this._ownsExpression = true;\n }\n } else if (!Type.isNullOrUndefined(expression)) {\n throw new UnsupportedException(`string or IExpression expected`);\n }\n\n this._lastContext = context;\n\n this.tryToSubscribeToExpression();\n }\n\n private tryToSubscribeToExpression(): void {\n if (!this._expression) {\n return;\n }\n this._changedSubscription = this._expression.changed.subscribe(() => {\n this._value = this._expression!.value;\n this._changeDetectorRef.markForCheck();\n });\n }\n\n private disposeExpression(): void {\n if (this._ownsExpression) {\n this._expression?.dispose();\n }\n this._ownsExpression = false;\n this._changedSubscription?.unsubscribe();\n this._changedSubscription = undefined;\n this._expression = undefined;\n }\n}\n","/*\n * Public API Surface of rsx\n */\n\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,uBAAuB,GAAG,IAAI,cAAc,CACvD,4BAA4B;MAGjB,wCAAwC,GACnD,IAAI,cAAc,CAChB,qCAAqC;AAGzC,SAAS,aAAa,GAAA;AACpB,IAAA,OAAO,MAAK;QACV,IACE,kBAAkB,CAAC,OAAO,CACxB,kCAAkC,CAAC,kBAAkB,CACtD,EACD;AACA,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;QAC1B;AACA,QAAA,OAAO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AW,GAAG,SAAS;IAC9B;uGAxEW,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBAJnB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,KAAK;AACX,oBAAA,IAAI,EAAE,KAAK;AACZ,iBAAA;;;ACjBD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rs-x/angular",
3
- "version": "0.4.22",
3
+ "version": "1.0.2",
4
4
  "description": "Angular integration for RS-X, providing the RsxPipe",
5
5
  "type": "module",
6
6
  "module": "fesm2022/rs-x-angular.mjs",
@@ -35,11 +35,11 @@
35
35
  "provenance": true
36
36
  },
37
37
  "peerDependencies": {
38
- "@angular/core": ">=21.1.0",
39
38
  "@angular/common": ">=21.1.0",
40
- "rxjs": ">=7.8.0",
41
- "@rs-x/core": "^0.4.0",
42
- "@rs-x/expression-parser": "^0.4.0"
39
+ "@angular/core": ">=21.1.0",
40
+ "@rs-x/core": "^1.0.0",
41
+ "@rs-x/expression-parser": "^1.0.0",
42
+ "rxjs": ">=7.8.0"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@rs-x/core": {
@@ -9,6 +9,7 @@ declare class RsxPipe implements PipeTransform, OnDestroy {
9
9
  private _changedSubscription?;
10
10
  private _lastExpressionString?;
11
11
  private _lastContext?;
12
+ private _ownsExpression;
12
13
  private _value;
13
14
  transform<T>(expression: string | IExpression<T> | null | undefined, context?: object): T;
14
15
  ngOnDestroy(): void;