You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libs/native-federation/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ We will at least provide a new version of this package per Angular major. If nec
29
29
30
30
## Migration from Module Federation
31
31
32
-
If you currently use Angular with Module Federation, you can follow our Migration Guide to migrate to Native Federation and Angular's new fast esbuild-based build system.
32
+
If you currently use Angular with Module Federation, you can follow our [Migration Guide](https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/docs/migrate.md) to migrate to Native Federation and Angular's new fast esbuild-based build system.
@@ -12,154 +12,155 @@ Native Federation for Angular is a thin wrapper around the esbuild builder that
12
12
- Update your solution to the newest version of `@angular-architects/module-federation` (!)
13
13
- Have a look to our [FAQs about sharing packages with Native Federation](share-faq.md)
14
14
15
+
In general, you need Native Federation for Angular 18.1 and Module Federation 18.x.
16
+
15
17
## Migration for Angular CLI projects
16
18
17
19
1. Remove Module Federation from your poject(s):
18
20
19
-
```
20
-
ng g @angular-architects/module-federation:remove --project xyz
21
-
```
21
+
```
22
+
ng g @angular-architects/module-federation:remove --project xyz
23
+
```
22
24
23
25
2. Update your workspace to the new esbuild-based build system:
24
26
25
-
```
26
-
ng update @angular/cli --name use-application-builder
27
-
```
27
+
```
28
+
ng update @angular/cli --name use-application-builder
29
+
```
28
30
29
31
3. Initialize Native Federation for your projects:
30
32
31
-
```
32
-
ng add @angular-architects/native-federation --project xyz --type remote --port 4201
33
-
```
33
+
```
34
+
ng add @angular-architects/native-federation --project xyz --type remote --port 4201
35
+
```
34
36
35
-
**Remarks:** Use type `remote` or type `dynamic-host`.
37
+
**Remarks:** Use type `remote` or type `dynamic-host`.
36
38
37
39
4. Adjust your `federation.config.js` generated for Native Federation. You can mostly copy over the settings from your `webpack.config.js` used for Module Federation before.
38
40
39
41
5. Update your EcmaScript imports in your source code. Make sure, you import from `@angular-architects/native-federation` instead of from `@angular-architects/module-federation`. Please also note that the signature of `loadRemoteModule` has been simplified:
40
42
41
-
```typescript
42
-
// Before
43
-
import { loadRemoteModule } from '@angular-architects/module-federation';
Please also note that loadRemoteModule now always points to a logical name that is resolved via the shell's federation manifest (`src/assets/federation.manifest.json` or `public/federation.manifest.json`):
81
-
82
-
```json
83
-
{
84
-
"mfe1": "http://localhost:4201/remoteEntry.json"
85
-
}
86
-
```
87
-
88
-
Please also note that the remoteEntry is now a `.json` file.
Please also note that loadRemoteModule now always points to a logical name that is resolved via the shell's federation manifest (`src/assets/federation.manifest.json` or `public/federation.manifest.json`):
83
+
84
+
```json
85
+
{
86
+
"mfe1": "http://localhost:4201/remoteEntry.json"
87
+
}
88
+
```
89
+
90
+
Please also note that the remoteEntry is now a `.json` file.
89
91
90
92
6. If everything works, delete your `webpack.config.js`
91
93
92
-
93
94
## Migration for Nx projects
94
95
95
96
1. Remove Module Federation from your poject(s):
96
97
97
-
```
98
-
nx g @angular-architects/module-federation:remove --project xyz
99
-
```
98
+
```
99
+
nx g @angular-architects/module-federation:remove --project xyz
100
+
```
100
101
101
102
2. Initialize Native Federation for your projects:
102
103
103
-
```
104
-
npm i @angular-architects/native-federation
104
+
```
105
+
npm i @angular-architects/native-federation
105
106
106
-
nx g @angular-architects/native-federation:init --project xyz --type remote --port 4201
107
-
```
107
+
nx g @angular-architects/native-federation:init --project xyz --type remote --port 4201
108
+
```
108
109
109
-
**Remarks:** Use type `remote` or type `dynamic-host`.
110
+
**Remarks:** Use type `remote` or type `dynamic-host`.
110
111
111
-
3. Adjust your federation.config.js generated for Native Federation. You can mostly copy over the settings from your `webpack.config.js` used for Module Federation before.
112
+
3. Adjust your `federation.config.js` generated for Native Federation. You can mostly copy over the settings from your `webpack.config.js` used for Module Federation before.
112
113
113
114
4. Update your EcmaScript imports in your source code. Make sure, you import from `@angular-architects/native-federation` instead of from `@angular-architects/module-federation`. Please also note that the signature of `loadRemoteModule` has been simplified:
114
115
115
-
```typescript
116
-
// Before
117
-
import { loadRemoteModule } from '@angular-architects/module-federation';
Please also note that loadRemoteModule now always points to a logical name that is resolved via the shell's federation manifest (`src/assets/federation.manifest.json` or `public/federation.manifest.json`):
155
-
156
-
```json
157
-
{
158
-
"mfe1": "http://localhost:4201/remoteEntry.json"
159
-
}
160
-
```
161
-
162
-
Please also note that the remoteEntry is now a `.json` file.
Please also note that loadRemoteModule now always points to a logical name that is resolved via the shell's federation manifest (`src/assets/federation.manifest.json` or `public/federation.manifest.json`):
156
+
157
+
```json
158
+
{
159
+
"mfe1": "http://localhost:4201/remoteEntry.json"
160
+
}
161
+
```
162
+
163
+
Please also note that the remoteEntry is now a `.json` file.
163
164
164
165
5. If everything works, delete your `webpack.config.js`
0 commit comments