{"action":"created","issue":{"url":"https://api.github.com/repos/sorrycc/blog/issues/79","repository_url":"https://api.github.com/repos/sorrycc/blog","labels_url":"https://api.github.com/repos/sorrycc/blog/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/sorrycc/blog/issues/79/comments","events_url":"https://api.github.com/repos/sorrycc/blog/issues/79/events","html_url":"https://github.com/sorrycc/blog/issues/79","id":394533301,"node_id":"MDU6SXNzdWUzOTQ1MzMzMDE=","number":79,"title":"发布 umi 2.3，区块","user":{"login":"sorrycc","id":35128,"node_id":"MDQ6VXNlcjM1MTI4","avatar_url":"https://avatars1.githubusercontent.com/u/35128?v=4","gravatar_id":"","url":"https://api.github.com/users/sorrycc","html_url":"https://github.com/sorrycc","followers_url":"https://api.github.com/users/sorrycc/followers","following_url":"https://api.github.com/users/sorrycc/following{/other_user}","gists_url":"https://api.github.com/users/sorrycc/gists{/gist_id}","starred_url":"https://api.github.com/users/sorrycc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorrycc/subscriptions","organizations_url":"https://api.github.com/users/sorrycc/orgs","repos_url":"https://api.github.com/users/sorrycc/repos","events_url":"https://api.github.com/users/sorrycc/events{/privacy}","received_events_url":"https://api.github.com/users/sorrycc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-12-28T02:54:10Z","updated_at":"2018-12-28T03:57:01Z","closed_at":null,"author_association":"OWNER","body":"[English version](https://github.com/sorrycc/blog/issues/79#issuecomment-450277885) | 中文版\r\n\r\n## 重要更新\r\n\r\n* 新增 umi block 命令和[区块市场](https://github.com/umijs/umi-blocks)\r\n* 升级 babel、webpack 等依赖到最新，并锁定版本，[#1695](https://github.com/umijs/umi/pull/1695)，[#1602](https://github.com/umijs/umi/pull/1602)，[#1543](https://github.com/umijs/umi/pull/1543)\r\n* 新增 [umi-request](https://github.com/umijs/umi-request) 请求库\r\n* 支持在 page 目录下通过 `_mock.js` 声明 mock，通过 locales 组织多语言，便于把 mock、国际化、model、service、compoent 和路由组织到一起，[#1503](https://github.com/umijs/umi/pull/1503)，[#1513](https://github.com/umijs/umi/pull/1513)\r\n* 新增 umi inspect 命令，用于检查 webpack 配置等\r\n* 新增 umi config 命令，用于通过命令行修改配置\r\n* 更新 create-umi@0.7，支持创建 ant-design-pro 空壳脚手架，然后通过 umi block 一个个添加页面\r\n\r\n## umi block\r\n\r\n不知大家是如何使用 ant-design-pro，我们自己有项目的使用方式是整个 clone 下来，然后把不需要的一个个删掉。先不评价这种方式是否合适，我们这里探索一种反着来的使用方式，即先有一个 ant-design-pro 的空壳，然后一个个页面往上加。\r\n\r\numi block（区块）类似 [ice](https://github.com/alibaba/ice)，可以让我们在项目里快速添加页面。但与 ice 不同的是，umi 的 block 是一个完整可子运行的模块，包含路由、组件、mock 数据、国际化文本，如果有用 dva，还可以包含 model 和 service 等，所以借此，大家也可以有另一种组织代码的方式。\r\n\r\n### 视频介绍\r\n\r\n由 @yutingzhao1991 录制，可以在 [bilibili](https://www.bilibili.com/video/av39190963/) 或 [youtube](https://www.youtube.com/watch?v=JHgkufY22XQ&feature=youtu.be) 看到。\r\n\r\n### 5 分钟入门 umi block\r\n\r\n先创建项目。\r\n\r\n```bash\r\n# 创建项目，选 ant-design-pro\r\n$ yarn create umi\r\n\r\n# 安装依赖\r\n$ yarn\r\n\r\n# 启动项目\r\n$ yarn start\r\n```\r\n\r\n再新开命令行窗口安装区块。\r\n\r\n```bash\r\n# 列表，看看有哪些区块\r\n$ npx umi block list\r\n\r\n# 新增区块\r\n$ npx umi block add ant-design-pro/Monitor\r\n```\r\n\r\n## 其他更新\r\n\r\n* 修改 `umi/locale` 引用为 `umi-plugin-react/locale`，解决 typescript 和 eslint 的问题，[#1716](https://github.com/umijs/umi/pull/1716)\r\n* 添加 [umi-example-monorepo](https://github.com/umijs/umi-example-monorepo)，支持分包组织代码\r\n* 支持 terserjs 作为 minifier，[#1667](https://github.com/umijs/umi/pull/1667)\r\n* 修复 mock 里 method 为 delete 时 body 丢失的问题，[#1706](https://github.com/umijs/umi/pull/1706)\r\n* 修复 `/404` 路由配置 redirect 后出错的问题，[#1538](https://github.com/umijs/umi/issues/1538)\r\n* 改进 types 定义，[#1519](https://github.com/umijs/umi/pull/1519)\r\n* cssModulesExcludes 支持正则，[#1511](https://github.com/umijs/umi/pull/1511)\r\n* umi-plugin-react 的 title 配置支持多语言，[#1482](https://github.com/umijs/umi/pull/1482)\r\n* 修复某些网络环境下 undefined network 的问题，[#1474](https://github.com/umijs/umi/pull/1474)\r\n* 修复 umi-test 某些情况下使用 typescript 不正常的问题，[#1437](https://github.com/umijs/umi/pull/1437)\r\n* 支持直接 import from umi，[#1493](https://github.com/umijs/umi/issues/1493)\r\n* locale 添加 formatHTMLMessage 方法，[#1664](https://github.com/umijs/umi/pull/1664)\r\n\r\n## 升级到 umi@2.3\r\n\r\n如果你是用 umi@2，umi@2.3 不包含 break change，可直接升级；如果用 umi@1.x，请参考 https://umijs.org/zh/guide/migration.html 升级。\r\n"},"comment":{"url":"https://api.github.com/repos/sorrycc/blog/issues/comments/450284769","html_url":"https://github.com/sorrycc/blog/issues/79#issuecomment-450284769","issue_url":"https://api.github.com/repos/sorrycc/blog/issues/79","id":450284769,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDI4NDc2OQ==","user":{"login":"zywcode","id":4060640,"node_id":"MDQ6VXNlcjQwNjA2NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/4060640?v=4","gravatar_id":"","url":"https://api.github.com/users/zywcode","html_url":"https://github.com/zywcode","followers_url":"https://api.github.com/users/zywcode/followers","following_url":"https://api.github.com/users/zywcode/following{/other_user}","gists_url":"https://api.github.com/users/zywcode/gists{/gist_id}","starred_url":"https://api.github.com/users/zywcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zywcode/subscriptions","organizations_url":"https://api.github.com/users/zywcode/orgs","repos_url":"https://api.github.com/users/zywcode/repos","events_url":"https://api.github.com/users/zywcode/events{/privacy}","received_events_url":"https://api.github.com/users/zywcode/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T03:57:01Z","updated_at":"2018-12-28T03:57:01Z","author_association":"NONE","body":"赞"}}
{"actor":{"display_login":"zywcode"}}