Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

v4.0.0-rc.12

Pre-release
Pre-release
Compare
Choose a tag to compare
@sorrycc sorrycc released this 14 Apr 07:59
· 407 commits to master since this release

1、新增 umi preview 命令,用于产物预览和调试,支持 mock 和 proxy。

$ umi preview

2、新增 browser terminal 支持,可在浏览器往命令行里打日志

此功能复刻自 https://github.com/patak-dev/vite-plugin-terminal。

有些开发者会更希望在命令行里看到项目里通过 console 输出的日志,比如我。因为命令行日志不会随着刷新而失效,大家可能都经历过一些一闪而过的页面,想截屏都难;同时命令行日志还可以做物理存储,导出后可以方便他人排查。

开发者在项目中这么写,

import { terminal } from 'umi';
terminal.log(`Some info from the app`);
terminal.log({
  json: { foo: 'bar' },
});
terminal.info(`Hey terminal, A message from the browser`);
terminal.warn(`Watch out, warning from the browser`);
terminal.error(`Ups, testing an error message from the browser`);

然后就可以在命令行中看到日志,

3、max 内置 stylelint 和 eslint,执行 max lint 时无需手动安装

4、修复 mfsu cache invalidate 机制,减少不必要的依赖 rebuild

5、修复 mfsu 对于 exportsFields 的支持,比如 swiper/react 已可能正常使用

6、initial-state 插件删除默认的 Loading 文本

7、升级 babel、webpack、react-router、vite 和 esbuild 到最新

8、umi g 支持 api routes、mock 和 component

9、access 插件修复无权限且没有配置 fallback 时的渲染问题