diff --git a/packages/ice/package.json b/packages/ice/package.json index 211368f6ce..851ee4292d 100644 --- a/packages/ice/package.json +++ b/packages/ice/package.json @@ -64,7 +64,7 @@ "detect-port": "^1.3.0", "dotenv": "^16.0.0", "dotenv-expand": "^8.0.3", - "ejs": "^3.1.6", + "ejs": "^3.1.10", "fast-glob": "^3.2.11", "find-up": "^5.0.0", "fs-extra": "^10.0.0", diff --git a/packages/plugin-intl/CHANGELOG.md b/packages/plugin-intl/CHANGELOG.md index 1ade93256c..361c15fe90 100644 --- a/packages/plugin-intl/CHANGELOG.md +++ b/packages/plugin-intl/CHANGELOG.md @@ -1,5 +1,9 @@ # @ice/plugin-intl +## 1.0.2 + +fix: compat with the navigator language return with underslash. + ## 1.0.1 ### Patch Changes diff --git a/packages/plugin-intl/package.json b/packages/plugin-intl/package.json index 67f897422b..c907706d24 100644 --- a/packages/plugin-intl/package.json +++ b/packages/plugin-intl/package.json @@ -1,6 +1,6 @@ { "name": "@ice/plugin-intl", - "version": "1.0.1", + "version": "1.0.2", "description": "react intl plugin for ice.js 3.", "files": [ "esm", diff --git a/packages/plugin-intl/src/runtime.tsx b/packages/plugin-intl/src/runtime.tsx index 5d4139a736..e2831bdfdc 100644 --- a/packages/plugin-intl/src/runtime.tsx +++ b/packages/plugin-intl/src/runtime.tsx @@ -9,9 +9,10 @@ const cache = createIntlCache(); const getDefaultLocale = () => { // @ts-ignore - return (typeof window !== 'undefined' && window.__ICE_DEFAULT_LOCALE__) || + const defaultLocale = (typeof window !== 'undefined' && window.__ICE_DEFAULT_LOCALE__) || (typeof navigator !== 'undefined' && navigator.language) || 'zh-CN'; + return defaultLocale.replace('_', '-'); }; const getLocaleMessages = () => { diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index 650534cc32..96e812545a 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,9 @@ # @ice/runtime +## 1.4.9 + +Fix: add export of useAsyncValue in single route mode + ## 1.4.8 ### Patch Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index eb4070c4ef..1bd960900d 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@ice/runtime", - "version": "1.4.8", + "version": "1.4.9", "description": "Runtime module for ice.js", "type": "module", "types": "./esm/index.d.ts", diff --git a/packages/runtime/src/singleRouter.tsx b/packages/runtime/src/singleRouter.tsx index 2a65cd10e5..06d4b30783 100644 --- a/packages/runtime/src/singleRouter.tsx +++ b/packages/runtime/src/singleRouter.tsx @@ -309,6 +309,10 @@ export const useRevalidator = () => { throw new Error('useRevalidator is not supported in single router mode'); }; +export const useAsyncValue = () => { + throw new Error('useAsyncValue is not supported in single router mode'); +}; + export const getSingleRoute = async ( routes: RouteItem[], basename: string, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8dfc36deea..204cbf4a0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1705,8 +1705,8 @@ importers: specifier: ^8.0.3 version: 8.0.3 ejs: - specifier: ^3.1.6 - version: 3.1.8 + specifier: ^3.1.10 + version: 3.1.10 fast-glob: specifier: ^3.2.11 version: 3.2.12 @@ -12457,6 +12457,14 @@ packages: /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + /ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + jake: 10.8.5 + dev: false + /ejs@3.1.8: resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==} engines: {node: '>=0.10.0'} diff --git a/website/docs/guide/advanced/icestark.md b/website/docs/guide/advanced/icestark.md index 47fdafd7ea..ade9bb3019 100644 --- a/website/docs/guide/advanced/icestark.md +++ b/website/docs/guide/advanced/icestark.md @@ -96,6 +96,16 @@ export default defineConfig(() => ({ })); ``` +但如果你的主应用是ice2,微应用是ice3,记得在ice3微应用的入口文件,通常是 app.tsx 文件中,调用 @ice/stark-app 中的 `setLibraryName` 方法,设置子应用模块的全局变量名称,通常是 package.json 中的 `name`。 +```ts +import {setLibraryName} from '@ice/stark-app'; + +setLibraryName('microName'); + +// ...其他app.tsx的代码,如export mount, export unmount等等 + +``` + 应用入口可以配置相关生命周期执行行为(可选): ```ts title="ice.config.mts"