From e52b5232aebbf25f67760df3fae12e25874201dc Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 17:03:09 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20modifyHistroy=E6=94=B9=E4=B8=BAmodif?= =?UTF-8?q?yCreateHistroy,=E9=81=BF=E5=85=8D=E6=89=A7=E8=A1=8C=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=88=9B=E5=BB=BA=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fes-plugin-qiankun/src/micro/runtime/runtime.tpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl index d8e62d47..d0597a4f 100644 --- a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl +++ b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl @@ -1,4 +1,4 @@ -import { createMemoryHistory } from '@@/core/coreExports'; +import { createMemoryHistory, getHistory } from '@@/core/coreExports'; import qiankunRender, { clientRenderOptsStack, history } from './lifecycles'; @@ -14,16 +14,18 @@ export function modifyClientRenderOpts(memo) { }; } -export function modifyHistroy(memo) { +export function modifyCreateHistroy(memo) { if (history.url) { - const memoHistroy = createMemoryHistory(); - memoHistroy.push(history.url) - return memoHistroy + return createMemoryHistory } return memo; } export function onRouterCreated({ router }) { + if(history.url) { + const memoryHistory = getHistory(); + memoryHistory.push(history.url) + } if(history.onRouterInit){ history.onRouterInit(router) } From 2097206e197c29b93a72eb0530576c3f2c68da74 Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 17:03:38 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20modifyHistroy=E6=94=B9=E4=B8=BAmodif?= =?UTF-8?q?yCreateHistroy,=E9=81=BF=E5=85=8D=E6=89=A7=E8=A1=8C=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=88=9B=E5=BB=BA=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/reference/config/README.md | 6 ++++++ .../src/plugins/generateFiles/core/plugin/index.js | 2 +- .../src/plugins/misc/route/template/routes.tpl | 10 +++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/zh/reference/config/README.md b/docs/zh/reference/config/README.md index b4d3e4c4..bcb22cbc 100644 --- a/docs/zh/reference/config/README.md +++ b/docs/zh/reference/config/README.md @@ -296,6 +296,12 @@ export default { 配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 `publicPath` 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 `publicPath` 的值设为 CDN 的值就可以。 +## router + +- 类型: `object` +- 默认值: `{ mode: 'hash' }` +- 详情: 配置路由,具体请查看指南中关于路由的介绍 + ## singular - 类型: `boolean` - 默认值: `false` diff --git a/packages/fes-preset-built-in/src/plugins/generateFiles/core/plugin/index.js b/packages/fes-preset-built-in/src/plugins/generateFiles/core/plugin/index.js index 2680eff5..171ceca9 100644 --- a/packages/fes-preset-built-in/src/plugins/generateFiles/core/plugin/index.js +++ b/packages/fes-preset-built-in/src/plugins/generateFiles/core/plugin/index.js @@ -28,7 +28,7 @@ export default function (api) { // 修改路由 'patchRoutes', // 修改histror - 'modifyHistroy', + 'modifyCreateHistroy', // 生成router时触发 'onRouterCreated' ] diff --git a/packages/fes-preset-built-in/src/plugins/misc/route/template/routes.tpl b/packages/fes-preset-built-in/src/plugins/misc/route/template/routes.tpl index 55fddff5..1d89a137 100644 --- a/packages/fes-preset-built-in/src/plugins/misc/route/template/routes.tpl +++ b/packages/fes-preset-built-in/src/plugins/misc/route/template/routes.tpl @@ -20,11 +20,15 @@ export const createRouter = (routes) => { if (router) { return router; } - history = plugin.applyPlugins({ - key: 'modifyHistroy', + const createHistory = plugin.applyPlugins({ + key: 'modifyCreateHistroy', type: ApplyPluginsType.modify, - initialValue: {{{ CREATE_HISTORY }}}(ROUTER_BASE), + args: { + base: ROUTER_BASE + }, + initialValue: {{{ CREATE_HISTORY }}}, }); + history = createHistory(ROUTER_BASE) router = createVueRouter({ history, routes From 6b8852afec56f8171e47676d076ec3696fdbf2af Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 17:04:31 +0800 Subject: [PATCH 3/8] chore(release): publish --- lerna.json | 2 +- packages/create-fes-app/package.json | 2 +- packages/fes-plugin-qiankun/package.json | 2 +- packages/fes-plugin-request/package.json | 6 +++--- packages/fes-preset-built-in/package.json | 2 +- packages/fes/package.json | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lerna.json b/lerna.json index 766a428c..a715ef21 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "changelog": { "repo": "WeBankFinTech/fes.js", "cacheDir": ".changelog", diff --git a/packages/create-fes-app/package.json b/packages/create-fes-app/package.json index 851f77a2..fbc95d2a 100644 --- a/packages/create-fes-app/package.json +++ b/packages/create-fes-app/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/create-fes-app", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "description": "create a app base on fes.js", "main": "lib/index.js", "files": [ diff --git a/packages/fes-plugin-qiankun/package.json b/packages/fes-plugin-qiankun/package.json index b77632ef..4998a06b 100644 --- a/packages/fes-plugin-qiankun/package.json +++ b/packages/fes-plugin-qiankun/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-qiankun", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "description": "@fesjs/plugin-qiankun", "main": "lib/index.js", "files": [ diff --git a/packages/fes-plugin-request/package.json b/packages/fes-plugin-request/package.json index c33adac0..a0084fda 100644 --- a/packages/fes-plugin-request/package.json +++ b/packages/fes-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-request", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "description": "@fesjs/plugin-request", "main": "lib/index.js", "files": [ @@ -31,7 +31,7 @@ "vue": "^3.0.5" }, "dependencies": { - "axios": "0.21.1", - "@fesjs/compiler": "^2.0.0-rc.5" + "@fesjs/compiler": "^2.0.0-rc.5", + "axios": "0.21.1" } } diff --git a/packages/fes-preset-built-in/package.json b/packages/fes-preset-built-in/package.json index 8a90a087..23417d92 100644 --- a/packages/fes-preset-built-in/package.json +++ b/packages/fes-preset-built-in/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/preset-built-in", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "description": "@fesjs/preset-built-in", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/fes/package.json b/packages/fes/package.json index 827c3b78..0963358c 100644 --- a/packages/fes/package.json +++ b/packages/fes/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/fes", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { @@ -40,7 +40,7 @@ ], "dependencies": { "@fesjs/compiler": "^2.0.0-rc.5", - "@fesjs/preset-built-in": "^2.0.0-rc.26", + "@fesjs/preset-built-in": "^2.0.0-rc.27", "@fesjs/runtime": "^2.0.0-rc.5", "@umijs/utils": "3.3.3", "resolve-cwd": "^3.0.0" From 2dd7207abfb12380350a0a3bee892f65694c650f Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 20:13:25 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=203.0=E7=9A=84css-minimizer-webpack-pl?= =?UTF-8?q?ugin=E4=B8=8D=E6=8F=90=E4=BE=9Bsourcemap=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/commands/webpackConfig/css.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/css.js b/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/css.js index 86c9785b..95dd53fe 100644 --- a/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/css.js +++ b/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/css.js @@ -102,9 +102,7 @@ export default function createCssWebpackConfig({ if (!isDev) { webpackConfig.optimization .minimizer('css') - .use(require.resolve('css-minimizer-webpack-plugin'), [{ - sourceMap: config.devtool !== false - }]); + .use(require.resolve('css-minimizer-webpack-plugin'), [{}]); } return (options) => { From 694677879b63143d3f1659572b66fdac2fb2644d Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 20:13:47 +0800 Subject: [PATCH 5/8] chore(release): publish --- lerna.json | 2 +- packages/fes-preset-built-in/package.json | 2 +- packages/fes/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index a715ef21..5c61256d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.27", + "version": "2.0.0-rc.28", "changelog": { "repo": "WeBankFinTech/fes.js", "cacheDir": ".changelog", diff --git a/packages/fes-preset-built-in/package.json b/packages/fes-preset-built-in/package.json index 23417d92..4b2e2ade 100644 --- a/packages/fes-preset-built-in/package.json +++ b/packages/fes-preset-built-in/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/preset-built-in", - "version": "2.0.0-rc.27", + "version": "2.0.0-rc.28", "description": "@fesjs/preset-built-in", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/fes/package.json b/packages/fes/package.json index 0963358c..df413894 100644 --- a/packages/fes/package.json +++ b/packages/fes/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/fes", - "version": "2.0.0-rc.27", + "version": "2.0.0-rc.28", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { @@ -40,7 +40,7 @@ ], "dependencies": { "@fesjs/compiler": "^2.0.0-rc.5", - "@fesjs/preset-built-in": "^2.0.0-rc.27", + "@fesjs/preset-built-in": "^2.0.0-rc.28", "@fesjs/runtime": "^2.0.0-rc.5", "@umijs/utils": "3.3.3", "resolve-cwd": "^3.0.0" From 53654d945d11345fbd123ed1f2da9f19d2aa15b3 Mon Sep 17 00:00:00 2001 From: lucaszhu Date: Wed, 2 Jun 2021 14:35:47 +0800 Subject: [PATCH 6/8] Update layout.md --- docs/zh/reference/plugin/plugins/layout.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/reference/plugin/plugins/layout.md b/docs/zh/reference/plugin/plugins/layout.md index b5583001..3e583132 100644 --- a/docs/zh/reference/plugin/plugins/layout.md +++ b/docs/zh/reference/plugin/plugins/layout.md @@ -19,7 +19,7 @@ ```js export default { layout: { - navigation: 'side + navigation: 'side' } } ``` @@ -261,4 +261,4 @@ export const access = { } }; -``` \ No newline at end of file +``` From bcdccf02db54700623d5262df103577bf77bcaf5 Mon Sep 17 00:00:00 2001 From: harrywan Date: Tue, 8 Jun 2021 14:49:00 +0800 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81css=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/guide/css.md | 14 +++ .../src/plugins/commands/webpackConfig/css.js | 93 +++++++++++-------- packages/fes-template/.fes.js | 3 + packages/fes-template/src/pages/index.vue | 21 ++++- 4 files changed, 89 insertions(+), 42 deletions(-) diff --git a/docs/zh/guide/css.md b/docs/zh/guide/css.md index e5968698..0cfaed03 100644 --- a/docs/zh/guide/css.md +++ b/docs/zh/guide/css.md @@ -23,5 +23,19 @@ Fes.js 中约定 `src/global.css` 为全局样式,如果存在此文件,会 ``` +## CSS Modules +支持 `Vue` 的 [CSS Modules](https://vue-loader.vuejs.org/zh/guide/css-modules.html#%E7%94%A8%E6%B3%95) 用法,可以直接使用: +```vue + From 51531d37824283e4faf2b2d35efcdb8dd1073351 Mon Sep 17 00:00:00 2001 From: harrywan Date: Tue, 8 Jun 2021 14:49:53 +0800 Subject: [PATCH 8/8] chore(release): publish --- lerna.json | 2 +- packages/fes-preset-built-in/package.json | 2 +- packages/fes/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index 5c61256d..77398e55 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.28", + "version": "2.0.0-rc.29", "changelog": { "repo": "WeBankFinTech/fes.js", "cacheDir": ".changelog", diff --git a/packages/fes-preset-built-in/package.json b/packages/fes-preset-built-in/package.json index 4b2e2ade..208a09c0 100644 --- a/packages/fes-preset-built-in/package.json +++ b/packages/fes-preset-built-in/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/preset-built-in", - "version": "2.0.0-rc.28", + "version": "2.0.0-rc.29", "description": "@fesjs/preset-built-in", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/fes/package.json b/packages/fes/package.json index df413894..cb80cbb4 100644 --- a/packages/fes/package.json +++ b/packages/fes/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/fes", - "version": "2.0.0-rc.28", + "version": "2.0.0-rc.29", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { @@ -40,7 +40,7 @@ ], "dependencies": { "@fesjs/compiler": "^2.0.0-rc.5", - "@fesjs/preset-built-in": "^2.0.0-rc.28", + "@fesjs/preset-built-in": "^2.0.0-rc.29", "@fesjs/runtime": "^2.0.0-rc.5", "@umijs/utils": "3.3.3", "resolve-cwd": "^3.0.0"