@luigi-project/client-support-angular 21.1.0-dev.20260410920 → 21.1.0-dev.202604120057

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
@@ -92,23 +92,46 @@ providers: [
92
92
  ]
93
93
  ```
94
94
 
95
+ ### Preload component
96
+ This library offers a preload component which allows Luigi to preload Angular micro frontends in the background and improving navigation performance when switching between view groups.
97
+
98
+ #### Add the preload route
99
+ ```javascript
100
+ import { LuigiPreloadComponent } from '@luigi-project/client-support-angular';
101
+ ...
102
+ { path: 'luigi-client-support-preload', component: LuigiPreloadComponent }
103
+ ```
104
+ #### Example Luigi config
105
+ To enable it in luigi config it needs to be set like this:
106
+ ```javascript
107
+ Luigi.setConfig({
108
+ navigation: {
109
+ preloadViewGroups: true,
110
+ viewGroupSettings: {
111
+ vg1: {
112
+ preloadUrl: 'https://path.to.angular.app#/luigi-client-support-preload'
113
+ }
114
+ },
115
+ nodes: () => [...]
116
+ }
117
+ })
118
+ ```
119
+ Detailed information can be found [here](https://docs.luigi-project.io/docs/navigation-parameters-reference?section=preloadviewgroups) and in the [advanced section](https://docs.luigi-project.io/docs/navigation-advanced?section=view-groups)
120
+
95
121
  ### LuigiAutoRoutingService
96
122
 
97
123
  This service cannot be used directly, but it provides useful features on how to synchronize your Angular application with Luigi navigation.
98
124
 
99
125
  For example, when the user navigates through different pages within a micro frontend, you can use this feature to update Luigi accordingly. (You can also find more information about this process in the [micro frontend routing](https://docs.luigi-project.io/docs/microfrontend-routing) document.)
100
126
 
101
- ### Preload component
102
-
103
- In your Angular route configuration, you can add in any of the following preload components:
104
-
127
+ #### Examples
105
128
  ```javascript
106
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: true }}
107
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: : {"truncate": "*/projects"} }}
108
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: : {"truncate": "/projects"} }}
109
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2' }}
110
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2', fromContext: true}}
111
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2', fromContext: 'localContext'}}
129
+ {path: 'sample1',component: Sample1Component, data: { fromVirtualTreeRoot: true }}
130
+ {path: 'sample2',component: Sample2Component, data: { fromVirtualTreeRoot: : {"truncate": "*/projects"} }}
131
+ {path: 'sample3',component: Sample3Component, data: { fromVirtualTreeRoot: : {"truncate": "/projects"} }}
132
+ {path: 'sample4',component: Sample4Component, data: { luigiRoute: '/home/sample4' }}
133
+ {path: 'sample5',component: Sample5Component, data: { luigiRoute: '/home/sample5', fromContext: true}}
134
+ {path: 'sample6',component: Sample6Component, data: { luigiRoute: '/home/sample6', fromContext: 'localContext'}}
112
135
  ```
113
136
 
114
137
  Under the hood, these components make use of Luigi's [linkManager](https://docs.luigi-project.io/docs/luigi-client-api?section=linkmanager) in the following way:
@@ -124,22 +147,21 @@ For `data: { fromVirtualTreeRoot: true }`, once we load Sample1Component, this L
124
147
  ```
125
148
  In the above case, the specified string (e.g. `projects`) will be cut off from the beginning of the current micro frontend route before being sent to Luigi Core. This can be useful when the micro frontend is not served under the webroot, but under a subfolder. If the truncate string starts with `*`, the route will be truncated after the first occurrence of the string following `*`.
126
149
 
127
- For `data: { luigiRoute: '/home/sample2' }`, this Luigi Client API method is called:
150
+ For `data: { luigiRoute: '/home/sample4' }`, this Luigi Client API method is called:
128
151
  ```javascript
129
152
  luigiClient.linkManager().withoutSync().navigate(data.luigiRoute);
130
153
  ```
131
154
 
132
- For `data: { luigiRoute: '/home/sample2', fromContext: true }`, this Luigi Client API method is called:
155
+ For `data: { luigiRoute: '/home/sample5', fromContext: true }`, this Luigi Client API method is called:
133
156
  ```javascript
134
157
  luigiClient.linkManager().fromClosestContext().withoutSync().navigate(data.luigiRoute);
135
158
  ```
136
159
 
137
- For `data: { luigiRoute: '/home/sample2', fromContext: 'localContext' }`, this Luigi Client API method is called:
160
+ For `data: { luigiRoute: '/home/sample6', fromContext: 'localContext' }`, this Luigi Client API method is called:
138
161
  ```javascript
139
162
  luigiClient.linkManager().fromContext('localContext').withoutSync().navigate(data.luigiRoute);
140
163
  ```
141
164
 
142
-
143
165
  ### LuigiRouteStrategy
144
166
 
145
167
  To use **LuigiAutoRoutingService**, this library defines a new **RouteReuseStrategy** named **LuigiRouteStrategy**.
@@ -9,10 +9,10 @@ import { first, filter } from 'rxjs/operators';
9
9
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
10
 
11
11
  class LuigiPreloadComponent {
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiPreloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: LuigiPreloadComponent, isStandalone: true, selector: "lib-client-support-angular", ngImport: i0, template: "<p luigipreload=\"luigipreload\"></p>\n" }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiPreloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: LuigiPreloadComponent, isStandalone: true, selector: "lib-client-support-angular", ngImport: i0, template: "<p luigipreload=\"luigipreload\"></p>\n" }); }
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiPreloadComponent, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiPreloadComponent, decorators: [{
16
16
  type: Component,
17
17
  args: [{ selector: 'lib-client-support-angular', template: "<p luigipreload=\"luigipreload\"></p>\n" }]
18
18
  }] });
@@ -31,9 +31,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
31
31
  * In the normal workflow this message would picked up by Luigi Core which then sends the response back.
32
32
  */
33
33
  class LuigiMockModule {
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: LuigiMockModule }); }
36
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiMockModule, providers: [
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.7", ngImport: i0, type: LuigiMockModule }); }
36
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiMockModule, providers: [
37
37
  {
38
38
  provide: APP_INITIALIZER,
39
39
  useFactory: LuigiMockEngine.initPostMessageHook,
@@ -41,7 +41,7 @@ class LuigiMockModule {
41
41
  }
42
42
  ] }); }
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiMockModule, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiMockModule, decorators: [{
45
45
  type: NgModule,
46
46
  args: [{
47
47
  providers: [
@@ -150,10 +150,10 @@ class LuigiContextServiceImpl {
150
150
  this.subject.next(obj);
151
151
  });
152
152
  }
153
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiContextServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
154
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiContextServiceImpl, providedIn: 'root' }); }
153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiContextServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
154
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiContextServiceImpl, providedIn: 'root' }); }
155
155
  }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiContextServiceImpl, decorators: [{
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiContextServiceImpl, decorators: [{
157
157
  type: Injectable,
158
158
  args: [{
159
159
  providedIn: 'root'
@@ -278,10 +278,10 @@ class LuigiAutoRoutingService {
278
278
  isClientInitialized() {
279
279
  return isLuigiClientInitialized();
280
280
  }
281
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAutoRoutingService, deps: [{ token: i1.Router }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.Injectable }); }
282
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAutoRoutingService, providedIn: 'root' }); }
281
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAutoRoutingService, deps: [{ token: i1.Router }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.Injectable }); }
282
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAutoRoutingService, providedIn: 'root' }); }
283
283
  }
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAutoRoutingService, decorators: [{
284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAutoRoutingService, decorators: [{
285
285
  type: Injectable,
286
286
  args: [{
287
287
  providedIn: 'root'
@@ -316,9 +316,9 @@ const staticRoutes = [
316
316
  ];
317
317
  class LuigiAngularSupportModule {
318
318
  constructor(navigation, context) { }
319
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAngularSupportModule, deps: [{ token: LuigiAutoRoutingService }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.NgModule }); }
320
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: LuigiAngularSupportModule, imports: [i1.RouterModule] }); }
321
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAngularSupportModule, providers: [
319
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAngularSupportModule, deps: [{ token: LuigiAutoRoutingService }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.NgModule }); }
320
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.7", ngImport: i0, type: LuigiAngularSupportModule, imports: [i1.RouterModule] }); }
321
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAngularSupportModule, providers: [
322
322
  {
323
323
  provide: LuigiContextService,
324
324
  useClass: LuigiContextServiceImpl
@@ -329,7 +329,7 @@ class LuigiAngularSupportModule {
329
329
  }
330
330
  ], imports: [RouterModule.forChild(staticRoutes)] }); }
331
331
  }
332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LuigiAngularSupportModule, decorators: [{
332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: LuigiAngularSupportModule, decorators: [{
333
333
  type: NgModule,
334
334
  args: [{
335
335
  imports: [RouterModule.forChild(staticRoutes)],
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "publishConfig": {
19
19
  "tag": "client-support-angular"
20
20
  },
21
- "version": "21.1.0-dev.20260410920",
21
+ "version": "21.1.0-dev.202604120057",
22
22
  "module": "fesm2022/luigi-project-client-support-angular.mjs",
23
23
  "typings": "types/luigi-project-client-support-angular.d.ts",
24
24
  "exports": {
@@ -30,5 +30,6 @@
30
30
  "default": "./fesm2022/luigi-project-client-support-angular.mjs"
31
31
  }
32
32
  },
33
- "sideEffects": false
33
+ "sideEffects": false,
34
+ "type": "module"
34
35
  }