@bleedingdev/modern-js-create 3.2.0-ultramodern.47 → 3.2.0-ultramodern.49
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/dist/index.js +39 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -574,6 +574,7 @@ const ULTRACITE_VERSION = '7.7.0';
|
|
|
574
574
|
const I18NEXT_VERSION = '26.2.0';
|
|
575
575
|
const REACT_VERSION = '^19.2.6';
|
|
576
576
|
const REACT_DOM_VERSION = '^19.2.6';
|
|
577
|
+
const REACT_ROUTER_DOM_VERSION = '7.16.0';
|
|
577
578
|
const PNPM_VERSION = '11.4.0';
|
|
578
579
|
const WORKSPACE_PACKAGE_VERSION = 'workspace:*';
|
|
579
580
|
const GENERATED_CONTRACT_PATH = '.modernjs/ultramodern-generated-contract.json';
|
|
@@ -1087,7 +1088,8 @@ function appDependencies(scope, packageSource, app) {
|
|
|
1087
1088
|
[ultramodern_workspace_packageName(scope, 'shared-contracts')]: WORKSPACE_PACKAGE_VERSION,
|
|
1088
1089
|
[ultramodern_workspace_packageName(scope, 'shared-design-tokens')]: WORKSPACE_PACKAGE_VERSION,
|
|
1089
1090
|
react: REACT_VERSION,
|
|
1090
|
-
'react-dom': REACT_DOM_VERSION
|
|
1091
|
+
'react-dom': REACT_DOM_VERSION,
|
|
1092
|
+
'react-router-dom': REACT_ROUTER_DOM_VERSION
|
|
1091
1093
|
};
|
|
1092
1094
|
if ('shell' === app.kind) {
|
|
1093
1095
|
dependencies['@modern-js/plugin-bff'] = modernPackageSpecifier('@modern-js/plugin-bff', packageSource);
|
|
@@ -2911,7 +2913,20 @@ export default function ShellCartPage() {
|
|
|
2911
2913
|
}
|
|
2912
2914
|
function createShellRemoteComponents() {
|
|
2913
2915
|
return `import { createLazyComponent } from '@module-federation/modern-js-v3/react';
|
|
2914
|
-
import { getInstance } from '@module-federation/modern-js-v3/runtime';
|
|
2916
|
+
import { getInstance, loadRemote } from '@module-federation/modern-js-v3/runtime';
|
|
2917
|
+
import type { JSX } from 'react';
|
|
2918
|
+
|
|
2919
|
+
type RemoteComponentModule = {
|
|
2920
|
+
default: () => JSX.Element;
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2923
|
+
const loadRemoteComponent = async (specifier: string) => {
|
|
2924
|
+
const module = await loadRemote<RemoteComponentModule>(specifier);
|
|
2925
|
+
if (!module) {
|
|
2926
|
+
throw new Error(\`Remote module unavailable: \${specifier}\`);
|
|
2927
|
+
}
|
|
2928
|
+
return module;
|
|
2929
|
+
};
|
|
2915
2930
|
|
|
2916
2931
|
const remoteFallback =
|
|
2917
2932
|
({ error }: { error: Error }) =>
|
|
@@ -2921,42 +2936,42 @@ export const Header = createLazyComponent({
|
|
|
2921
2936
|
export: 'default',
|
|
2922
2937
|
fallback: remoteFallback,
|
|
2923
2938
|
instance: getInstance(),
|
|
2924
|
-
loader: () =>
|
|
2939
|
+
loader: () => loadRemoteComponent('explore/Header'),
|
|
2925
2940
|
loading: null,
|
|
2926
2941
|
});
|
|
2927
2942
|
export const StorePicker = createLazyComponent({
|
|
2928
2943
|
export: 'default',
|
|
2929
2944
|
fallback: remoteFallback,
|
|
2930
2945
|
instance: getInstance(),
|
|
2931
|
-
loader: () =>
|
|
2946
|
+
loader: () => loadRemoteComponent('explore/StorePicker'),
|
|
2932
2947
|
loading: null,
|
|
2933
2948
|
});
|
|
2934
2949
|
export const Recommendations = createLazyComponent({
|
|
2935
2950
|
export: 'default',
|
|
2936
2951
|
fallback: remoteFallback,
|
|
2937
2952
|
instance: getInstance(),
|
|
2938
|
-
loader: () =>
|
|
2953
|
+
loader: () => loadRemoteComponent('explore/Recommendations'),
|
|
2939
2954
|
loading: null,
|
|
2940
2955
|
});
|
|
2941
2956
|
export const ProductPage = createLazyComponent({
|
|
2942
2957
|
export: 'default',
|
|
2943
2958
|
fallback: remoteFallback,
|
|
2944
2959
|
instance: getInstance(),
|
|
2945
|
-
loader: () =>
|
|
2960
|
+
loader: () => loadRemoteComponent('decide/ProductPage'),
|
|
2946
2961
|
loading: null,
|
|
2947
2962
|
});
|
|
2948
2963
|
export const MiniCart = createLazyComponent({
|
|
2949
2964
|
export: 'default',
|
|
2950
2965
|
fallback: remoteFallback,
|
|
2951
2966
|
instance: getInstance(),
|
|
2952
|
-
loader: () =>
|
|
2967
|
+
loader: () => loadRemoteComponent('checkout/MiniCart'),
|
|
2953
2968
|
loading: null,
|
|
2954
2969
|
});
|
|
2955
2970
|
export const CartPage = createLazyComponent({
|
|
2956
2971
|
export: 'default',
|
|
2957
2972
|
fallback: remoteFallback,
|
|
2958
2973
|
instance: getInstance(),
|
|
2959
|
-
loader: () =>
|
|
2974
|
+
loader: () => loadRemoteComponent('checkout/CartPage'),
|
|
2960
2975
|
loading: null,
|
|
2961
2976
|
});
|
|
2962
2977
|
`;
|
|
@@ -3258,7 +3273,20 @@ export default function ${componentName}() {
|
|
|
3258
3273
|
}
|
|
3259
3274
|
function createDecideRemoteComponents() {
|
|
3260
3275
|
return `import { createLazyComponent } from '@module-federation/modern-js-v3/react';
|
|
3261
|
-
import { getInstance } from '@module-federation/modern-js-v3/runtime';
|
|
3276
|
+
import { getInstance, loadRemote } from '@module-federation/modern-js-v3/runtime';
|
|
3277
|
+
import type { JSX } from 'react';
|
|
3278
|
+
|
|
3279
|
+
type RemoteComponentModule = {
|
|
3280
|
+
default: () => JSX.Element;
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
const loadRemoteComponent = async (specifier: string) => {
|
|
3284
|
+
const module = await loadRemote<RemoteComponentModule>(specifier);
|
|
3285
|
+
if (!module) {
|
|
3286
|
+
throw new Error(\`Remote module unavailable: \${specifier}\`);
|
|
3287
|
+
}
|
|
3288
|
+
return module;
|
|
3289
|
+
};
|
|
3262
3290
|
|
|
3263
3291
|
const remoteFallback =
|
|
3264
3292
|
({ error }: { error: Error }) =>
|
|
@@ -3268,14 +3296,14 @@ export const AddToCart = createLazyComponent({
|
|
|
3268
3296
|
export: 'default',
|
|
3269
3297
|
fallback: remoteFallback,
|
|
3270
3298
|
instance: getInstance(),
|
|
3271
|
-
loader: () =>
|
|
3299
|
+
loader: () => loadRemoteComponent('checkout/AddToCart'),
|
|
3272
3300
|
loading: null,
|
|
3273
3301
|
});
|
|
3274
3302
|
export const Recommendations = createLazyComponent({
|
|
3275
3303
|
export: 'default',
|
|
3276
3304
|
fallback: remoteFallback,
|
|
3277
3305
|
instance: getInstance(),
|
|
3278
|
-
loader: () =>
|
|
3306
|
+
loader: () => loadRemoteComponent('explore/Recommendations'),
|
|
3279
3307
|
loading: null,
|
|
3280
3308
|
});
|
|
3281
3309
|
`;
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
|
-
"version": "3.2.0-ultramodern.
|
|
24
|
+
"version": "3.2.0-ultramodern.49",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
26
|
"main": "./dist/index.js",
|
|
27
27
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/node": "^25.9.1",
|
|
42
42
|
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
43
43
|
"tsx": "^4.22.3",
|
|
44
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.
|
|
44
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.49"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"start": "node ./dist/index.js"
|
|
55
55
|
},
|
|
56
56
|
"ultramodern": {
|
|
57
|
-
"frameworkVersion": "3.2.0-ultramodern.
|
|
57
|
+
"frameworkVersion": "3.2.0-ultramodern.49"
|
|
58
58
|
}
|
|
59
59
|
}
|