File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
dts-plugin/src/core/configurations
webpack-bundler-runtime/src Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/webpack-bundler-runtime ' : patch
3
+ ' @module-federation/dts-plugin ' : patch
4
+ ' @module-federation/sdk ' : patch
5
+ ---
6
+
7
+ fix: support decode encode remote name
Original file line number Diff line number Diff line change 1
- import { MANIFEST_EXT , parseEntry } from '@module-federation/sdk' ;
1
+ import {
2
+ MANIFEST_EXT ,
3
+ parseEntry ,
4
+ ENCODE_NAME_PREFIX ,
5
+ decodeName ,
6
+ } from '@module-federation/sdk' ;
2
7
import { utils } from '@module-federation/managers' ;
3
8
import { HostOptions , RemoteInfo } from '../interfaces/HostOptions' ;
4
9
import { validateOptions } from '../lib/utils' ;
@@ -39,14 +44,18 @@ export const retrieveRemoteInfo = (options: {
39
44
remote : string ;
40
45
} ) : RemoteInfo => {
41
46
const { hostOptions, remoteAlias, remote } = options ;
47
+ let decodedRemote = remote ;
48
+ if ( decodedRemote . startsWith ( ENCODE_NAME_PREFIX ) ) {
49
+ decodedRemote = decodeName ( decodedRemote , ENCODE_NAME_PREFIX ) ;
50
+ }
42
51
43
- const parsedInfo = parseEntry ( remote , undefined , '@' ) ;
52
+ const parsedInfo = parseEntry ( decodedRemote , undefined , '@' ) ;
44
53
45
54
const url =
46
55
'entry' in parsedInfo
47
56
? parsedInfo . entry
48
- : parsedInfo . name === remote
49
- ? remote
57
+ : parsedInfo . name === decodedRemote
58
+ ? decodedRemote
50
59
: '' ;
51
60
52
61
const zipUrl = url ? buildZipUrl ( hostOptions , url ) : '' ;
Original file line number Diff line number Diff line change @@ -32,3 +32,4 @@ export const MFModuleType = {
32
32
} ;
33
33
34
34
export const MODULE_DEVTOOL_IDENTIFIER = '__MF_DEVTOOLS_MODULE_INFO__' ;
35
+ export const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX' ;
Original file line number Diff line number Diff line change 1
- export const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX' ;
2
1
export const FEDERATION_SUPPORTED_TYPES = [ 'script' ] ;
2
+ export { ENCODE_NAME_PREFIX } from '@module-federation/sdk' ;
Original file line number Diff line number Diff line change 1
1
import { attachShareScopeMap } from './attachShareScopeMap' ;
2
2
import type { RemoteEntryExports } from './types' ;
3
3
import { RemotesOptions } from './types' ;
4
- import { decodeName } from '@module-federation/sdk' ;
5
- import { ENCODE_NAME_PREFIX } from './constant' ;
4
+ import { decodeName , ENCODE_NAME_PREFIX } from '@module-federation/sdk' ;
6
5
7
6
export function remotes ( options : RemotesOptions ) {
8
7
const {
You can’t perform that action at this time.
0 commit comments