@bleedingdev/modern-js-create 3.2.0-ultramodern.49 → 3.2.0-ultramodern.50
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 +139 -15
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2734,23 +2734,52 @@ function createShellPage() {
|
|
|
2734
2734
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
2735
2735
|
import { Helmet } from '@modern-js/runtime/head';
|
|
2736
2736
|
import { useLocation } from '@modern-js/plugin-tanstack/runtime';
|
|
2737
|
+
import { useEffect, useState, type ComponentType } from 'react';
|
|
2737
2738
|
import { ultramodernLocalisedUrls } from '../ultramodern-route-metadata';
|
|
2738
|
-
import { Header, MiniCart, StorePicker } from '../remote-components';
|
|
2739
2739
|
import { ultramodernUiMarker } from '../../ultramodern-build';
|
|
2740
2740
|
|
|
2741
2741
|
const languageCodes = ['en', 'cs'] as const;
|
|
2742
2742
|
|
|
2743
2743
|
${createLocalizedHeadComponent()}
|
|
2744
|
+
type HomeRouteRemotes = {
|
|
2745
|
+
Header: ComponentType;
|
|
2746
|
+
MiniCart: ComponentType;
|
|
2747
|
+
StorePicker: ComponentType;
|
|
2748
|
+
};
|
|
2749
|
+
|
|
2750
|
+
const useHomeRouteRemotes = () => {
|
|
2751
|
+
const [remotes, setRemotes] = useState<HomeRouteRemotes | null>(null);
|
|
2752
|
+
|
|
2753
|
+
useEffect(() => {
|
|
2754
|
+
let mounted = true;
|
|
2755
|
+
import('../remote-components').then(({ Header, MiniCart, StorePicker }) => {
|
|
2756
|
+
if (mounted) {
|
|
2757
|
+
setRemotes({ Header, MiniCart, StorePicker });
|
|
2758
|
+
}
|
|
2759
|
+
});
|
|
2760
|
+
|
|
2761
|
+
return () => {
|
|
2762
|
+
mounted = false;
|
|
2763
|
+
};
|
|
2764
|
+
}, []);
|
|
2765
|
+
|
|
2766
|
+
return remotes;
|
|
2767
|
+
};
|
|
2768
|
+
|
|
2744
2769
|
export default function ShellHome() {
|
|
2745
2770
|
const { i18nInstance, language } = useModernI18n();
|
|
2746
2771
|
const t = i18nInstance['t'].bind(i18nInstance);
|
|
2747
2772
|
const location = useLocation();
|
|
2748
2773
|
const suffix = locationSuffix(location);
|
|
2774
|
+
const remotes = useHomeRouteRemotes();
|
|
2775
|
+
const Header = remotes?.Header;
|
|
2776
|
+
const MiniCart = remotes?.MiniCart;
|
|
2777
|
+
const StorePicker = remotes?.StorePicker;
|
|
2749
2778
|
|
|
2750
2779
|
return (
|
|
2751
2780
|
<main className="commerce-shell">
|
|
2752
2781
|
<LocalizedHead />
|
|
2753
|
-
<Header />
|
|
2782
|
+
{Header ? <Header /> : null}
|
|
2754
2783
|
<div className="commerce-shell-actions">
|
|
2755
2784
|
<nav aria-label={t('shell.language.switcher')} className="commerce-language">
|
|
2756
2785
|
{languageCodes.map(code => (
|
|
@@ -2764,7 +2793,7 @@ export default function ShellHome() {
|
|
|
2764
2793
|
</a>
|
|
2765
2794
|
))}
|
|
2766
2795
|
</nav>
|
|
2767
|
-
<MiniCart />
|
|
2796
|
+
{MiniCart ? <MiniCart /> : null}
|
|
2768
2797
|
</div>
|
|
2769
2798
|
<section className="commerce-page commerce-hero">
|
|
2770
2799
|
<p className="commerce-eyebrow">{t('shell.hero.eyebrow')}</p>
|
|
@@ -2779,7 +2808,7 @@ export default function ShellHome() {
|
|
|
2779
2808
|
</a>
|
|
2780
2809
|
</div>
|
|
2781
2810
|
</section>
|
|
2782
|
-
<StorePicker />
|
|
2811
|
+
{StorePicker ? <StorePicker /> : null}
|
|
2783
2812
|
<p data-testid="ultramodern-preset">presetUltramodern workspace</p>
|
|
2784
2813
|
<p data-build-marker={ultramodernUiMarker.build} data-testid="ultramodern-ui-marker">
|
|
2785
2814
|
{ultramodernUiMarker.appId}:{ultramodernUiMarker.version}
|
|
@@ -2793,22 +2822,51 @@ function createShellTractorsPage() {
|
|
|
2793
2822
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
2794
2823
|
import { Helmet } from '@modern-js/runtime/head';
|
|
2795
2824
|
import { useLocation } from '@modern-js/plugin-tanstack/runtime';
|
|
2825
|
+
import { useEffect, useState, type ComponentType } from 'react';
|
|
2796
2826
|
import { ultramodernLocalisedUrls } from '../../ultramodern-route-metadata';
|
|
2797
|
-
import { Header, MiniCart, Recommendations } from '../../remote-components';
|
|
2798
2827
|
|
|
2799
2828
|
const languageCodes = ['en', 'cs'] as const;
|
|
2800
2829
|
|
|
2801
2830
|
${createLocalizedHeadComponent()}
|
|
2831
|
+
type TractorsRouteRemotes = {
|
|
2832
|
+
Header: ComponentType;
|
|
2833
|
+
MiniCart: ComponentType;
|
|
2834
|
+
Recommendations: ComponentType;
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
const useTractorsRouteRemotes = () => {
|
|
2838
|
+
const [remotes, setRemotes] = useState<TractorsRouteRemotes | null>(null);
|
|
2839
|
+
|
|
2840
|
+
useEffect(() => {
|
|
2841
|
+
let mounted = true;
|
|
2842
|
+
import('../../remote-components').then(({ Header, MiniCart, Recommendations }) => {
|
|
2843
|
+
if (mounted) {
|
|
2844
|
+
setRemotes({ Header, MiniCart, Recommendations });
|
|
2845
|
+
}
|
|
2846
|
+
});
|
|
2847
|
+
|
|
2848
|
+
return () => {
|
|
2849
|
+
mounted = false;
|
|
2850
|
+
};
|
|
2851
|
+
}, []);
|
|
2852
|
+
|
|
2853
|
+
return remotes;
|
|
2854
|
+
};
|
|
2855
|
+
|
|
2802
2856
|
export default function ShellTractorsPage() {
|
|
2803
2857
|
const { i18nInstance, language } = useModernI18n();
|
|
2804
2858
|
const t = i18nInstance['t'].bind(i18nInstance);
|
|
2805
2859
|
const location = useLocation();
|
|
2806
2860
|
const suffix = locationSuffix(location);
|
|
2861
|
+
const remotes = useTractorsRouteRemotes();
|
|
2862
|
+
const Header = remotes?.Header;
|
|
2863
|
+
const MiniCart = remotes?.MiniCart;
|
|
2864
|
+
const Recommendations = remotes?.Recommendations;
|
|
2807
2865
|
|
|
2808
2866
|
return (
|
|
2809
2867
|
<main className="commerce-shell">
|
|
2810
2868
|
<LocalizedHead />
|
|
2811
|
-
<Header />
|
|
2869
|
+
{Header ? <Header /> : null}
|
|
2812
2870
|
<div className="commerce-shell-actions">
|
|
2813
2871
|
<nav aria-label={t('shell.language.switcher')} className="commerce-language">
|
|
2814
2872
|
{languageCodes.map(code => (
|
|
@@ -2822,9 +2880,9 @@ export default function ShellTractorsPage() {
|
|
|
2822
2880
|
</a>
|
|
2823
2881
|
))}
|
|
2824
2882
|
</nav>
|
|
2825
|
-
<MiniCart />
|
|
2883
|
+
{MiniCart ? <MiniCart /> : null}
|
|
2826
2884
|
</div>
|
|
2827
|
-
<Recommendations />
|
|
2885
|
+
{Recommendations ? <Recommendations /> : null}
|
|
2828
2886
|
</main>
|
|
2829
2887
|
);
|
|
2830
2888
|
}
|
|
@@ -2834,22 +2892,53 @@ function createShellProductPage() {
|
|
|
2834
2892
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
2835
2893
|
import { Helmet } from '@modern-js/runtime/head';
|
|
2836
2894
|
import { useLocation } from '@modern-js/plugin-tanstack/runtime';
|
|
2895
|
+
import { useEffect, useState, type ComponentType } from 'react';
|
|
2837
2896
|
import { ultramodernLocalisedUrls } from '../../../ultramodern-route-metadata';
|
|
2838
|
-
import { Header, MiniCart, ProductPage } from '../../../remote-components';
|
|
2839
2897
|
|
|
2840
2898
|
const languageCodes = ['en', 'cs'] as const;
|
|
2841
2899
|
|
|
2842
2900
|
${createLocalizedHeadComponent()}
|
|
2901
|
+
type ProductRouteRemotes = {
|
|
2902
|
+
Header: ComponentType;
|
|
2903
|
+
MiniCart: ComponentType;
|
|
2904
|
+
ProductPage: ComponentType;
|
|
2905
|
+
};
|
|
2906
|
+
|
|
2907
|
+
const useProductRouteRemotes = () => {
|
|
2908
|
+
const [remotes, setRemotes] = useState<ProductRouteRemotes | null>(null);
|
|
2909
|
+
|
|
2910
|
+
useEffect(() => {
|
|
2911
|
+
let mounted = true;
|
|
2912
|
+
import('../../../remote-components').then(
|
|
2913
|
+
({ Header, MiniCart, ProductPage }) => {
|
|
2914
|
+
if (mounted) {
|
|
2915
|
+
setRemotes({ Header, MiniCart, ProductPage });
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2918
|
+
);
|
|
2919
|
+
|
|
2920
|
+
return () => {
|
|
2921
|
+
mounted = false;
|
|
2922
|
+
};
|
|
2923
|
+
}, []);
|
|
2924
|
+
|
|
2925
|
+
return remotes;
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2843
2928
|
export default function ShellProductPage() {
|
|
2844
2929
|
const { i18nInstance, language } = useModernI18n();
|
|
2845
2930
|
const t = i18nInstance['t'].bind(i18nInstance);
|
|
2846
2931
|
const location = useLocation();
|
|
2847
2932
|
const suffix = locationSuffix(location);
|
|
2933
|
+
const remotes = useProductRouteRemotes();
|
|
2934
|
+
const Header = remotes?.Header;
|
|
2935
|
+
const MiniCart = remotes?.MiniCart;
|
|
2936
|
+
const ProductPage = remotes?.ProductPage;
|
|
2848
2937
|
|
|
2849
2938
|
return (
|
|
2850
2939
|
<main className="commerce-shell">
|
|
2851
2940
|
<LocalizedHead />
|
|
2852
|
-
<Header />
|
|
2941
|
+
{Header ? <Header /> : null}
|
|
2853
2942
|
<div className="commerce-shell-actions">
|
|
2854
2943
|
<nav aria-label={t('shell.language.switcher')} className="commerce-language">
|
|
2855
2944
|
{languageCodes.map(code => (
|
|
@@ -2863,9 +2952,9 @@ export default function ShellProductPage() {
|
|
|
2863
2952
|
</a>
|
|
2864
2953
|
))}
|
|
2865
2954
|
</nav>
|
|
2866
|
-
<MiniCart />
|
|
2955
|
+
{MiniCart ? <MiniCart /> : null}
|
|
2867
2956
|
</div>
|
|
2868
|
-
<ProductPage />
|
|
2957
|
+
{ProductPage ? <ProductPage /> : null}
|
|
2869
2958
|
</main>
|
|
2870
2959
|
);
|
|
2871
2960
|
}
|
|
@@ -2875,22 +2964,49 @@ function createShellCartPage() {
|
|
|
2875
2964
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
2876
2965
|
import { Helmet } from '@modern-js/runtime/head';
|
|
2877
2966
|
import { useLocation } from '@modern-js/plugin-tanstack/runtime';
|
|
2967
|
+
import { useEffect, useState, type ComponentType } from 'react';
|
|
2878
2968
|
import { ultramodernLocalisedUrls } from '../../ultramodern-route-metadata';
|
|
2879
|
-
import { CartPage, Header } from '../../remote-components';
|
|
2880
2969
|
|
|
2881
2970
|
const languageCodes = ['en', 'cs'] as const;
|
|
2882
2971
|
|
|
2883
2972
|
${createLocalizedHeadComponent()}
|
|
2973
|
+
type CartRouteRemotes = {
|
|
2974
|
+
CartPage: ComponentType;
|
|
2975
|
+
Header: ComponentType;
|
|
2976
|
+
};
|
|
2977
|
+
|
|
2978
|
+
const useCartRouteRemotes = () => {
|
|
2979
|
+
const [remotes, setRemotes] = useState<CartRouteRemotes | null>(null);
|
|
2980
|
+
|
|
2981
|
+
useEffect(() => {
|
|
2982
|
+
let mounted = true;
|
|
2983
|
+
import('../../remote-components').then(({ CartPage, Header }) => {
|
|
2984
|
+
if (mounted) {
|
|
2985
|
+
setRemotes({ CartPage, Header });
|
|
2986
|
+
}
|
|
2987
|
+
});
|
|
2988
|
+
|
|
2989
|
+
return () => {
|
|
2990
|
+
mounted = false;
|
|
2991
|
+
};
|
|
2992
|
+
}, []);
|
|
2993
|
+
|
|
2994
|
+
return remotes;
|
|
2995
|
+
};
|
|
2996
|
+
|
|
2884
2997
|
export default function ShellCartPage() {
|
|
2885
2998
|
const { i18nInstance, language } = useModernI18n();
|
|
2886
2999
|
const t = i18nInstance['t'].bind(i18nInstance);
|
|
2887
3000
|
const location = useLocation();
|
|
2888
3001
|
const suffix = locationSuffix(location);
|
|
3002
|
+
const remotes = useCartRouteRemotes();
|
|
3003
|
+
const Header = remotes?.Header;
|
|
3004
|
+
const CartPage = remotes?.CartPage;
|
|
2889
3005
|
|
|
2890
3006
|
return (
|
|
2891
3007
|
<main className="commerce-shell">
|
|
2892
3008
|
<LocalizedHead />
|
|
2893
|
-
<Header />
|
|
3009
|
+
{Header ? <Header /> : null}
|
|
2894
3010
|
<div className="commerce-shell-actions">
|
|
2895
3011
|
<nav aria-label={t('shell.language.switcher')} className="commerce-language">
|
|
2896
3012
|
{languageCodes.map(code => (
|
|
@@ -2905,7 +3021,7 @@ export default function ShellCartPage() {
|
|
|
2905
3021
|
))}
|
|
2906
3022
|
</nav>
|
|
2907
3023
|
</div>
|
|
2908
|
-
<CartPage />
|
|
3024
|
+
{CartPage ? <CartPage /> : null}
|
|
2909
3025
|
</main>
|
|
2910
3026
|
);
|
|
2911
3027
|
}
|
|
@@ -2938,6 +3054,7 @@ export const Header = createLazyComponent({
|
|
|
2938
3054
|
instance: getInstance(),
|
|
2939
3055
|
loader: () => loadRemoteComponent('explore/Header'),
|
|
2940
3056
|
loading: null,
|
|
3057
|
+
noSSR: true,
|
|
2941
3058
|
});
|
|
2942
3059
|
export const StorePicker = createLazyComponent({
|
|
2943
3060
|
export: 'default',
|
|
@@ -2945,6 +3062,7 @@ export const StorePicker = createLazyComponent({
|
|
|
2945
3062
|
instance: getInstance(),
|
|
2946
3063
|
loader: () => loadRemoteComponent('explore/StorePicker'),
|
|
2947
3064
|
loading: null,
|
|
3065
|
+
noSSR: true,
|
|
2948
3066
|
});
|
|
2949
3067
|
export const Recommendations = createLazyComponent({
|
|
2950
3068
|
export: 'default',
|
|
@@ -2952,6 +3070,7 @@ export const Recommendations = createLazyComponent({
|
|
|
2952
3070
|
instance: getInstance(),
|
|
2953
3071
|
loader: () => loadRemoteComponent('explore/Recommendations'),
|
|
2954
3072
|
loading: null,
|
|
3073
|
+
noSSR: true,
|
|
2955
3074
|
});
|
|
2956
3075
|
export const ProductPage = createLazyComponent({
|
|
2957
3076
|
export: 'default',
|
|
@@ -2959,6 +3078,7 @@ export const ProductPage = createLazyComponent({
|
|
|
2959
3078
|
instance: getInstance(),
|
|
2960
3079
|
loader: () => loadRemoteComponent('decide/ProductPage'),
|
|
2961
3080
|
loading: null,
|
|
3081
|
+
noSSR: true,
|
|
2962
3082
|
});
|
|
2963
3083
|
export const MiniCart = createLazyComponent({
|
|
2964
3084
|
export: 'default',
|
|
@@ -2966,6 +3086,7 @@ export const MiniCart = createLazyComponent({
|
|
|
2966
3086
|
instance: getInstance(),
|
|
2967
3087
|
loader: () => loadRemoteComponent('checkout/MiniCart'),
|
|
2968
3088
|
loading: null,
|
|
3089
|
+
noSSR: true,
|
|
2969
3090
|
});
|
|
2970
3091
|
export const CartPage = createLazyComponent({
|
|
2971
3092
|
export: 'default',
|
|
@@ -2973,6 +3094,7 @@ export const CartPage = createLazyComponent({
|
|
|
2973
3094
|
instance: getInstance(),
|
|
2974
3095
|
loader: () => loadRemoteComponent('checkout/CartPage'),
|
|
2975
3096
|
loading: null,
|
|
3097
|
+
noSSR: true,
|
|
2976
3098
|
});
|
|
2977
3099
|
`;
|
|
2978
3100
|
}
|
|
@@ -3298,6 +3420,7 @@ export const AddToCart = createLazyComponent({
|
|
|
3298
3420
|
instance: getInstance(),
|
|
3299
3421
|
loader: () => loadRemoteComponent('checkout/AddToCart'),
|
|
3300
3422
|
loading: null,
|
|
3423
|
+
noSSR: true,
|
|
3301
3424
|
});
|
|
3302
3425
|
export const Recommendations = createLazyComponent({
|
|
3303
3426
|
export: 'default',
|
|
@@ -3305,6 +3428,7 @@ export const Recommendations = createLazyComponent({
|
|
|
3305
3428
|
instance: getInstance(),
|
|
3306
3429
|
loader: () => loadRemoteComponent('explore/Recommendations'),
|
|
3307
3430
|
loading: null,
|
|
3431
|
+
noSSR: true,
|
|
3308
3432
|
});
|
|
3309
3433
|
`;
|
|
3310
3434
|
}
|
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.50",
|
|
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.50"
|
|
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.50"
|
|
58
58
|
}
|
|
59
59
|
}
|