-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add document for esm version (#3166)
* docs: add release 3.12 * docs: add 3.12.0 release * docs: up typo * docs: add esm * docs: add api * docs: add ctx.forward
- Loading branch information
1 parent
2e2efbc
commit e68c9e5
Showing
13 changed files
with
585 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
slug: remove-node-14-ci | ||
title: 移除 Node.js v14 的 CI 环境 | ||
authors: [harry] | ||
tags: [node] | ||
|
||
|
||
--- | ||
|
||
最近一段时间,我们发现越来越多的库移除了 Node.js v14 的支持。 | ||
|
||
有些库是升级的大版本,有些库仅仅只升级 minor 版本,这使得依赖他们的业务、模块乃至框架都很难信任社区的 SemVer 版本约定了。 | ||
|
||
为了保持 Midway 的单测正常运行,从 v3.12.0 开始,Midway 移除了 Node.js v14 的 CI,这意味着我们无法测试 Node.js v16 以下社区库的兼容性,只能靠社区库更新的 Changelog 以及我们的经验来保证。 | ||
|
||
如果我们发现某些库只支持特定版本的 Node.js,我们会在 `package.json` 中进行版本限制,如果你发现某些库的版本更新无法在低版本 Node.js 中运行,且 Midway 的组件没有进行限制,请通知我们。 | ||
|
||
最后再次提醒,如果没有强需求,请使用 Node.js v16 以上版本。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
slug: release/3.12.0 | ||
title: Release 3.12.0 | ||
authors: [harry] | ||
tags: [release] | ||
|
||
|
||
|
||
|
||
--- | ||
|
||
升级请参考 [如何更新 Midway](/docs/how_to_update_midway) 中描述,请不要单独升级某个组件包。 | ||
|
||
在经过了几个月的努力更新之后,Midway 迎来了 3.12 版本,这是一个改动比较大的版本。 | ||
|
||
|
||
|
||
## Breaking | ||
|
||
从 v3.12.0 开始,Midway 移除了 Node.js v14 的 CI,原因请参考 [这里](/blog/remove-node-14-ci)。 | ||
|
||
|
||
|
||
## Features | ||
|
||
### 1、ESM 的支持 | ||
|
||
从 v3.12.0 开始,midway 支持创建 ESModule 项目,使用时和传统 CJS 项目会有所不同,由于时间紧迫,我们没有针对所有的组件进行测试,如有兼容性问题,请提交 issue。 | ||
|
||
此外,由于原有的工具体系已经无法很好的兼容 ESM 环境,为了减少维护成本,我们启用了一套全新的工具链,后续普通 CJS 项目也会统一到这一套上来。 | ||
|
||
更多细节请查看 [ESM 文档](/docs/esm)。 | ||
|
||
|
||
|
||
### 2、FaaS 架构变更 | ||
|
||
从 v3.12.0 开始,Midway FaaS 使用全新的一套架构支持现有的 Serverless 平台,这一部分后续将会在文档中体现。 | ||
|
||
|
||
|
||
## 其他的一些变化 | ||
|
||
|
||
|
||
- 1、添加了 `ctx.getApp()` 方法,可以从 ctx 拿到自己 app,打通了整条从 framework,到 app 和 ctx 的链路 | ||
|
||
- 2、core 中的 httpClient 现在支持了所有的 http method | ||
|
||
- 3、增加了一个内部跳转 URL 的 api,`ctx.forward` | ||
|
||
- 4、IoC 容器增加了一个获取对象作用域的 API,`container.getInstanceScope(xxx)` | ||
|
||
|
||
|
||
|
||
|
||
## 依赖更新 | ||
|
||
|
||
具体可以查看 [Changelog](https://midwayjs.org/changelog/v3.12.0)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.