@luigi-project/client-support-angular 21.1.0-dev.20260480053 → 21.1.0-dev.20260490045
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 +36 -14
- package/package.json +1 -1
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
|
-
|
|
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: '
|
|
107
|
-
{path: '
|
|
108
|
-
{path: '
|
|
109
|
-
{path: '
|
|
110
|
-
{path: '
|
|
111
|
-
{path: '
|
|
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/
|
|
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/
|
|
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/
|
|
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**.
|
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.
|
|
21
|
+
"version": "21.1.0-dev.20260490045",
|
|
22
22
|
"module": "fesm2022/luigi-project-client-support-angular.mjs",
|
|
23
23
|
"typings": "types/luigi-project-client-support-angular.d.ts",
|
|
24
24
|
"exports": {
|