Skip to content

Commit

Permalink
Merge branch 'master' into release/next
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Jun 19, 2024
2 parents 15c8200 + 41498f0 commit 80bf9e2
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/ice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-intl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# @ice/plugin-intl

## 1.0.2

fix: compat with the navigator language return with underslash.

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-intl/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-intl/src/runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# @ice/runtime

## 1.4.9

Fix: add export of useAsyncValue in single route mode

## 1.4.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/runtime/src/singleRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 10 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions website/docs/guide/advanced/icestark.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 80bf9e2

Please sign in to comment.