Skip to content

Commit

Permalink
Merge pull request #7025 from alibaba/release/next
Browse files Browse the repository at this point in the history
Release @ice/app 3.5.1
  • Loading branch information
ClarkXia authored Nov 25, 2024
2 parents e14dc87 + f0c2dde commit 6b3167a
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 27 deletions.
9 changes: 9 additions & 0 deletions packages/ice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.5.1

### Patch Changes

- Updated dependencies [4130611d]
- Updated dependencies [2e274966]
- @ice/rspack-config@1.2.1
- @ice/runtime@1.5.1

## 3.5.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/app",
"version": "3.5.0",
"version": "3.5.1",
"description": "provide scripts and configuration used by web framework ice",
"type": "module",
"main": "./esm/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/jsx-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ice/jsx-runtime

## 0.3.1

### Patch Changes

- 2e274966: fix: export createElement for backward compatibility

## 0.3.0

### Minor Changes
Expand Down
5 changes: 3 additions & 2 deletions packages/jsx-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/jsx-runtime",
"version": "0.3.0",
"version": "0.3.1",
"description": "JSX runtime for ice.",
"files": [
"esm",
Expand Down Expand Up @@ -34,7 +34,8 @@
"jsx-runtime"
],
"dependencies": {
"style-unit": "^3.0.4"
"style-unit": "^3.0.4",
"@swc/helpers": "^0.5.13"
},
"devDependencies": {
"@ice/pkg": "^1.5.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/jsx-runtime/src/createElement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createElement as reactCreateElement } from 'react';
import { hijackElementProps } from './style.js';
export function createElement(type: any, props: any, ...children: any[]) {
return reactCreateElement(type, hijackElementProps(props), ...children);
}
1 change: 1 addition & 0 deletions packages/jsx-runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './prod.js';
export { createElement } from './createElement.js';
6 changes: 6 additions & 0 deletions packages/miniapp-react-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ice/miniapp-react-dom

## 1.1.1

### Patch Changes

- @ice/miniapp-runtime@1.2.1

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/miniapp-react-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/miniapp-react-dom",
"version": "1.1.0",
"version": "1.1.1",
"description": "like react-dom, but for miniapps.",
"type": "module",
"types": "./esm/index.d.ts",
Expand Down
7 changes: 7 additions & 0 deletions packages/miniapp-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.2.1

### Patch Changes

- Updated dependencies [2e274966]
- @ice/runtime@1.5.1

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/miniapp-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/miniapp-runtime",
"version": "1.2.0",
"version": "1.2.1",
"description": "ice runtime for miniapps.",
"type": "module",
"types": "./esm/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"plugin"
],
"dependencies": {
"@ice/jsx-runtime": "^0.3.0",
"@ice/jsx-runtime": "^0.3.1",
"@swc/helpers": "^0.5.1",
"accept-language-parser": "^1.5.0",
"universal-cookie": "^4.0.4",
Expand All @@ -56,8 +56,8 @@
"webpack-dev-server": "4.15.0"
},
"peerDependencies": {
"@ice/app": "^3.5.0",
"@ice/runtime": "^1.5.0"
"@ice/app": "^3.5.1",
"@ice/runtime": "^1.5.1"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 8 additions & 0 deletions packages/plugin-miniapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.1

### Patch Changes

- cce46e9b: fix: should check skeleton file existed before read
- @ice/miniapp-runtime@1.2.1
- @ice/miniapp-react-dom@1.1.1

## 1.2.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-miniapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/plugin-miniapp",
"version": "1.2.0",
"version": "1.2.1",
"description": "ice.js plugin for miniapp.",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -50,8 +50,8 @@
"sax": "^1.2.4"
},
"devDependencies": {
"@ice/app": "^3.5.0",
"@ice/runtime": "^1.5.0",
"@ice/app": "^3.5.1",
"@ice/runtime": "^1.5.1",
"webpack": "^5.88.0"
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ export default class MiniPlugin {
path: pagePath,
isNative,
stylePath: isNative ? this.getStylePath(pagePath) : undefined,
templatePath: isNative ? this.getTemplatePath(pagePath) : undefined,
skeletonPath: isNative ? this.getSkeletonExtraPath(pagePath) : undefined,
};
}),
Expand Down Expand Up @@ -690,10 +691,10 @@ export default class MiniPlugin {
}
this.addEntry(path.resolve(__dirname, '..', 'template/custom-wrapper'), 'custom-wrapper', META_TYPE.STATIC);

const resolveComponentStyleEntry = (name: string, stylePaths: string[]) => {
const resolveComponentStyleEntry = (name: string, stylePaths: string[], ext = this.options.fileType.style) => {
for (const stylePath of stylePaths) {
if (fs.existsSync(stylePath)) {
this.addEntry(stylePath, this.getTargetFilePath(name, this.options.fileType.style), META_TYPE.NORMAL);
this.addEntry(stylePath, this.getTargetFilePath(name, ext), META_TYPE.NORMAL);
break;
}
}
Expand All @@ -709,12 +710,10 @@ export default class MiniPlugin {
this.addEntry(item.templatePath, this.getTemplatePath(item.name), META_TYPE.NORMAL);
}

if (item.skeletonPath) {
if (item.skeletonPath.template) {
this.addEntry(item.skeletonPath.template, this.getTargetFilePath(item.name, `${this.options.fileType.skeletonMidExt}${this.options.fileType.templ}`), META_TYPE.NORMAL);
}
if (item.skeletonPath && item.skeletonPath.template && fs.existsSync(item.skeletonPath.template)) {
this.addEntry(item.skeletonPath.template, this.getTargetFilePath(item.name, `${this.options.fileType.skeletonMidExt}${this.options.fileType.templ}`), META_TYPE.NORMAL);
if (item.skeletonPath.style) {
resolveComponentStyleEntry(this.getTargetFilePath(item.name, this.options.fileType.skeletonMidExt), item.skeletonPath.style);
resolveComponentStyleEntry(item.name, item.skeletonPath.style, `${this.options.fileType.skeletonMidExt}${this.options.fileType.style}`);
}
}
} else {
Expand Down
6 changes: 6 additions & 0 deletions packages/rspack-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ice/rspack-config

## 1.2.1

### Patch Changes

- 4130611d: fix: update splitChunk config

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/rspack-config",
"version": "1.2.0",
"version": "1.2.1",
"repository": "alibaba/ice",
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
Expand Down
5 changes: 3 additions & 2 deletions packages/rspack-config/src/splitChunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export const getVendorStrategy = (options: Configuration['splitChunks']) => {

const getSplitChunks = (_: string, strategy: string | boolean) => {
if (strategy === false) {
// Empty splitChunks configuration if strategy is false.
return {};
// Set minChunks to a large number to disable the splitChunks feature.
// the value of Infinity is not work properly for this version of rspack.
return { minChunks: 100000, cacheGroups: { default: false } };
} else if (typeof strategy === 'string' && ['page-vendors', 'vendors'].includes(strategy)) {
const splitChunksOptions = strategy === 'page-vendors' ? { chunks: 'all' } : {};
return getVendorStrategy(splitChunksOptions);
Expand Down
8 changes: 8 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ice/runtime

## 1.5.1

### Patch Changes

- 2e274966: feat: support hook of onBeforeHydrate
- Updated dependencies [2e274966]
- @ice/jsx-runtime@0.3.1

## 1.5.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/runtime",
"version": "1.5.0",
"version": "1.5.1",
"description": "Runtime module for ice.js",
"type": "module",
"types": "./esm/index.d.ts",
Expand Down Expand Up @@ -54,7 +54,7 @@
"./esm/polyfills/abortcontroller.js"
],
"dependencies": {
"@ice/jsx-runtime": "^0.3.0",
"@ice/jsx-runtime": "^0.3.1",
"@ice/shared": "^1.1.0",
"@remix-run/router": "1.14.2",
"abortcontroller-polyfill": "1.7.5",
Expand Down
3 changes: 3 additions & 0 deletions packages/runtime/src/runClientApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export default async function runClientApp(options: RunClientAppOptions) {
reportRecoverableError(error, errorInfo, { ignoreRuntimeWarning: revalidate });
}),
};
if (appConfig?.app?.onBeforeHydrate) {
appConfig?.app?.onBeforeHydrate();
}
return ReactDOM.hydrateRoot(container, element, hydrateOptions);
});
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type App = Partial<{
strict: boolean;
errorBoundary: boolean;
onRecoverableError: (error: unknown, errorInfo: ErrorStack) => void;
onBeforeHydrate: () => void;
} & Record<AppLifecycle, VoidFunction>>;

export interface ErrorStack {
Expand Down
17 changes: 13 additions & 4 deletions pnpm-lock.yaml

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

0 comments on commit 6b3167a

Please sign in to comment.