diff --git a/packages/icejs/package.json b/packages/icejs/package.json index b2ab1a8443..9f03b48e5a 100644 --- a/packages/icejs/package.json +++ b/packages/icejs/package.json @@ -1,6 +1,6 @@ { "name": "ice.js", - "version": "1.17.7", + "version": "1.17.8", "description": "command line interface and builtin plugin for icejs", "author": "ice-admin@alibaba-inc.com", "homepage": "", @@ -22,7 +22,7 @@ }, "dependencies": { "@alib/build-scripts": "^0.1.13", - "build-plugin-app-core": "1.4.3", + "build-plugin-app-core": "1.4.5", "build-plugin-helmet": "1.0.2", "build-plugin-ice-auth": "1.7.3", "build-plugin-ice-config": "1.8.1", diff --git a/packages/plugin-app-core/CHANGELOG.md b/packages/plugin-app-core/CHANGELOG.md index 3052190cad..cd7320dd38 100644 --- a/packages/plugin-app-core/CHANGELOG.md +++ b/packages/plugin-app-core/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.4.5 + +- [fix] lose `errorBoundary` type define + ## 1.4.4 - [feat] add baidu/kuaishou env judge diff --git a/packages/plugin-app-core/package.json b/packages/plugin-app-core/package.json index 61f9f80bd7..7b07982a1b 100644 --- a/packages/plugin-app-core/package.json +++ b/packages/plugin-app-core/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-app-core", - "version": "1.4.4", + "version": "1.4.5", "description": "the core plugin for icejs and raxjs.", "author": "ice-admin@alibaba-inc.com", "homepage": "", @@ -42,4 +42,4 @@ "url": "https://github.com/alibaba/ice/tree/master/packages/plugin-app-core" }, "gitHead": "07ac7bb07162aac8c90778dd1de4a2060f8df498" -} +} \ No newline at end of file diff --git a/packages/plugin-app-core/src/generator/templates/common/types.ts.ejs b/packages/plugin-app-core/src/generator/templates/common/types.ts.ejs index fff4f95d60..0c87bc898b 100644 --- a/packages/plugin-app-core/src/generator/templates/common/types.ts.ejs +++ b/packages/plugin-app-core/src/generator/templates/common/types.ts.ejs @@ -45,6 +45,7 @@ export interface IApp { mountNode?: HTMLElement; addProvider?: ({ children }: { children: FrameworkNode }) => FrameworkElement; getInitialData?: (ctx?: IContext) => Promise; + errorBoundary?: boolean; ErrorBoundaryFallback?: (error: any) => FrameworkComponentType, onErrorBoundaryHander?: (error: Error, componentStack: string) => any; onLaunch?: (options?: any) => any; diff --git a/packages/plugin-stark-module/CHANGELOG.md b/packages/plugin-stark-module/CHANGELOG.md index 97eb2aad46..4d3a5c050f 100644 --- a/packages/plugin-stark-module/CHANGELOG.md +++ b/packages/plugin-stark-module/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.0.1 +- [fix] set `devServer.contentBase` the right way. + ## 2.0.0 - [feat] support built-in babel plugin to append lifecycle. diff --git a/packages/plugin-stark-module/package.json b/packages/plugin-stark-module/package.json index ad79d43b96..6be9dc26cf 100644 --- a/packages/plugin-stark-module/package.json +++ b/packages/plugin-stark-module/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-stark-module", - "version": "2.0.0", + "version": "2.0.1", "description": "build-scripts plugin for build stark module", "main": "lib/index.js", "files": [ diff --git a/packages/plugin-stark-module/src/setUMDConfig.ts b/packages/plugin-stark-module/src/setUMDConfig.ts index 1330cb99ce..fab0b016ac 100644 --- a/packages/plugin-stark-module/src/setUMDConfig.ts +++ b/packages/plugin-stark-module/src/setUMDConfig.ts @@ -35,7 +35,7 @@ const getConfig: GetConfig = ({ context, onGetWebpackConfig }, { modules, output config.plugin('MiniCssExtractPlugin').tap(([args]) => [{ ...args, filename: filenameStrategy ? `${filenameStrategy}.css` : './[name]/index.css' }]); // hack with multi publicpath - config.devServer.contentBase(path.join(rootDir, 'dist')); + config.devServer.contentBase(output); config.devServer.writeToDisk(true); }); }; diff --git a/packages/react-app-renderer/CHANGELOG.md b/packages/react-app-renderer/CHANGELOG.md index 016b343bc2..2073b42889 100644 --- a/packages/react-app-renderer/CHANGELOG.md +++ b/packages/react-app-renderer/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## 2.0.3 + +- [fix] origin appConfig object was modified + ## 2.0.2 - [fix] throw error when not setting route type -- [feat] throw error when not using the BrowserRouter \ No newline at end of file +- [feat] throw error when not using the BrowserRouter diff --git a/packages/react-app-renderer/package.json b/packages/react-app-renderer/package.json index 897f13e0a4..3d5b9b872f 100644 --- a/packages/react-app-renderer/package.json +++ b/packages/react-app-renderer/package.json @@ -1,6 +1,6 @@ { "name": "react-app-renderer", - "version": "2.0.2", + "version": "2.0.3", "description": "", "author": "ice-admin@alibaba-inc.com", "homepage": "https://github.com/alibaba/ice#readme", diff --git a/packages/react-app-renderer/src/server.tsx b/packages/react-app-renderer/src/server.tsx index 979deba185..4842d53277 100644 --- a/packages/react-app-renderer/src/server.tsx +++ b/packages/react-app-renderer/src/server.tsx @@ -34,11 +34,25 @@ function renderInServer(context, options) { } export default function reactAppRendererWithSSR(context, options) { - const { appConfig } = options || {}; + const cloneOptions = deepClone(options); + const { appConfig } = cloneOptions || {}; appConfig.router = appConfig.router || {}; if (appConfig.router.type !== 'browser') { throw new Error('[SSR]: Only support BrowserRouter when using SSR. You should set the router type to "browser". For more detail, please visit https://ice.work/docs/guide/basic/router'); } appConfig.router.type = 'static'; - return renderInServer(context, options); + return renderInServer(context, cloneOptions); +} + +function deepClone(config) { + if(typeof config !== 'object' || config === null) { + return config; + } + const ret = {}; + Object.getOwnPropertyNames(config).forEach((key: string) => { + if (Object.prototype.hasOwnProperty.call(config, key)) { + ret[key] = deepClone(config[key]); + } + }); + return ret; } diff --git a/yarn.lock b/yarn.lock index 494fc7e147..567c2bb073 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4897,29 +4897,6 @@ buffer@^5.2.1, buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" -build-plugin-app-core@1.4.3: - version "1.4.3" - resolved "https://registry.nlark.com/build-plugin-app-core/download/build-plugin-app-core-1.4.3.tgz?cache=0&sync_timestamp=1620638854118&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbuild-plugin-app-core%2Fdownload%2Fbuild-plugin-app-core-1.4.3.tgz#a1fc6db973a5caa1dcc188e3e1e0d6ff1435c2d7" - integrity sha1-ofxtuXOlyqHcwYjj4eDW/xQ1wtc= - dependencies: - "@builder/app-helpers" "^2.0.0" - chalk "^4.0.0" - chokidar "^3.4.1" - create-app-shared "^0.2.0" - ejs "^3.0.1" - fs-extra "^8.1.0" - globby "^11.0.0" - history "^4.9.0" - lodash.debounce "^4.0.8" - miniapp-history "^0.1.0" - miniapp-renderer "^0.1.4" - prettier "^2.0.2" - query-string "^6.13.1" - rax-app-renderer "^2.0.0" - rax-use-router "^3.0.0" - react-app-renderer "^2.0.0" - universal-env "^3.0.0" - build-plugin-miniapp@0.1.7: version "0.1.7" resolved "https://registry.nlark.com/build-plugin-miniapp/download/build-plugin-miniapp-0.1.7.tgz#f60b67d6d0d480a7f93961c7f29c2fe724bdf32d"