Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eggjs/egg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2f2b7e8914802545612d082b6376a242ec1f5767
Choose a base ref
...
head repository: eggjs/egg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d68ab6ad3d758708f84163a1dc270938be06cff4
Choose a head ref
Loading
Showing with 5,533 additions and 4,474 deletions.
  1. +0 −30 .autod.conf.js
  2. +1 −4 .eslintrc
  3. +65 −0 .github/ISSUE_TEMPLATE/bug-report-cn.yml
  4. +65 −0 .github/ISSUE_TEMPLATE/bug-report.yml
  5. +0 −34 .github/ISSUE_TEMPLATE/bug_report.md
  6. +0 −32 .github/ISSUE_TEMPLATE/bug_report_cn.md
  7. +21 −0 .github/ISSUE_TEMPLATE/feature-request-cn.yml
  8. +23 −0 .github/ISSUE_TEMPLATE/feature-request.yml
  9. +0 −17 .github/ISSUE_TEMPLATE/feature_request.md
  10. +27 −0 .github/ISSUE_TEMPLATE/rfc-cn.yml
  11. +31 −0 .github/ISSUE_TEMPLATE/rfc.yml
  12. +0 −23 .github/ISSUE_TEMPLATE/rfc_cn.md
  13. +7 −7 .github/dependabot.yml
  14. +1 −1 .github/workflows/chainalert.yml
  15. +0 −2 .github/workflows/codeql-analysis.yml
  16. +4 −5 .github/workflows/gh-pages.yml
  17. +13 −31 .github/workflows/nodejs.yml
  18. +34 −0 .github/workflows/pr-contributor-welcome.yml
  19. +14 −0 .github/workflows/release.yml
  20. +23 −0 .github/workflows/vercel-preview.yml
  21. +21 −0 .github/workflows/vercel-production.yml
  22. +7 −1 .gitignore
  23. +380 −14 History.md → CHANGELOG.md
  24. +49 −3 CONTRIBUTING.md
  25. +51 −7 CONTRIBUTING.zh-CN.md
  26. +5 −3 README.md
  27. +4 −2 README.zh-CN.md
  28. +16 −0 SECURITY.md
  29. +3 −0 app/extend/context.js
  30. +0 −16 app/middleware/meta.js
  31. +5 −3 app/middleware/site_file.js
  32. +16 −1 config/config.default.js
  33. +77 −14 index.d.ts
  34. +0 −2 index.js
  35. +1 −0 index.test-d.ts
  36. +1 −1 lib/agent.js
  37. +21 −2 lib/application.js
  38. +1 −4 lib/core/base_context_logger.js
  39. +4 −6 lib/core/context_httpclient.js
  40. +10 −39 lib/core/dnscache_httpclient.js
  41. +10 −44 lib/core/httpclient.js
  42. +37 −0 lib/core/httpclient_next.js
  43. +15 −4 lib/core/logger.js
  44. +7 −3 lib/core/messenger/ipc.js
  45. +2 −2 lib/core/messenger/local.js
  46. +7 −2 lib/core/singleton.js
  47. +4 −3 lib/core/utils.js
  48. +38 −14 lib/egg.js
  49. +0 −42 lib/jsdoc/context.jsdoc
  50. +0 −48 lib/jsdoc/request.jsdoc
  51. +0 −5 lib/jsdoc/response.jsdoc
  52. +1 −1 lib/loader/app_worker_loader.js
  53. +0 −3 lib/start.js
  54. +79 −73 package.json
  55. +0 −15 scripts/jsdoc.js
  56. +4 −11 site/config/config.ts
  57. +88 −93 site/docs/advanced/cluster-client.zh-CN.md
  58. +71 −75 site/docs/advanced/framework.zh-CN.md
  59. +6 −6 site/docs/advanced/index.md
  60. +6 −6 site/docs/advanced/index.zh-CN.md
  61. +10 −7 site/docs/advanced/loader-update.zh-CN.md
  62. +168 −171 site/docs/advanced/loader.zh-CN.md
  63. +105 −120 site/docs/advanced/plugin.zh-CN.md
  64. +14 −10 site/docs/advanced/view-plugin.md
  65. +57 −58 site/docs/advanced/view-plugin.zh-CN.md
  66. +26 −27 site/docs/basics/app-start.zh-CN.md
  67. +31 −34 site/docs/basics/config.zh-CN.md
  68. +2 −2 site/docs/basics/controller.md
  69. +258 −272 site/docs/basics/controller.zh-CN.md
  70. +14 −17 site/docs/basics/env.zh-CN.md
  71. +38 −38 site/docs/basics/extend.zh-CN.md
  72. +12 −12 site/docs/basics/index.md
  73. +12 −12 site/docs/basics/index.zh-CN.md
  74. +1 −1 site/docs/basics/middleware.md
  75. +31 −37 site/docs/basics/middleware.zh-CN.md
  76. +71 −75 site/docs/basics/objects.zh-CN.md
  77. +29 −34 site/docs/basics/plugin.zh-CN.md
  78. +43 −51 site/docs/basics/router.zh-CN.md
  79. +32 −34 site/docs/basics/schedule.zh-CN.md
  80. +35 −40 site/docs/basics/service.zh-CN.md
  81. +36 −35 site/docs/basics/structure.zh-CN.md
  82. +72 −74 site/docs/community/CONTRIBUTING.zh-CN.md
  83. +20 −20 site/docs/community/faq.zh-CN.md
  84. +1 −1 site/docs/community/index.md
  85. +7 −2 site/docs/community/index.zh-CN.md
  86. +4 −4 site/docs/community/style-guide.zh-CN.md
  87. +111 −116 site/docs/core/cluster-and-ipc.zh-CN.md
  88. +47 −54 site/docs/core/cookie-and-session.zh-CN.md
  89. +3 −1 site/docs/core/deployment.md
  90. +48 −47 site/docs/core/deployment.zh-CN.md
  91. +23 −0 site/docs/core/development.md
  92. +73 −52 site/docs/core/development.zh-CN.md
  93. +3 −3 site/docs/core/error-handling.md
  94. +52 −57 site/docs/core/error-handling.zh-CN.md
  95. +130 −165 site/docs/core/httpclient.zh-CN.md
  96. +19 −24 site/docs/core/i18n.zh-CN.md
  97. +11 −11 site/docs/core/index.md
  98. +11 −11 site/docs/core/index.zh-CN.md
  99. +75 −91 site/docs/core/logger.zh-CN.md
  100. +18 −0 site/docs/core/security.md
  101. +162 −167 site/docs/core/security.zh-CN.md
  102. +132 −181 site/docs/core/unittest.zh-CN.md
  103. +42 −40 site/docs/core/view.zh-CN.md
  104. +5 −5 site/docs/index.md
  105. +2 −2 site/docs/index.zh-CN.md
  106. +40 −39 site/docs/intro/egg-and-koa.zh-CN.md
  107. +9 −9 site/docs/intro/index.zh-CN.md
  108. +0 −1 site/docs/intro/migration.md
  109. +69 −68 site/docs/intro/migration.zh-CN.md
  110. +29 −30 site/docs/intro/progressive.zh-CN.md
  111. +2 −2 site/docs/intro/quickstart.md
  112. +57 −52 site/docs/intro/quickstart.zh-CN.md
  113. +48 −54 site/docs/tutorials/assets.zh-CN.md
  114. +5 −1 site/docs/tutorials/index.md
  115. +9 −6 site/docs/tutorials/index.zh-CN.md
  116. +10 −1 site/docs/tutorials/mysql.md
  117. +101 −84 site/docs/tutorials/mysql.zh-CN.md
  118. +76 −89 site/docs/tutorials/passport.zh-CN.md
  119. +10 −10 site/docs/tutorials/proxy.zh-CN.md
  120. +49 −56 site/docs/tutorials/restful.zh-CN.md
  121. +1 −1 site/docs/tutorials/sequelize.md
  122. +63 −60 site/docs/tutorials/sequelize.zh-CN.md
  123. +184 −208 site/docs/tutorials/socketio.zh-CN.md
  124. +7 −25 site/docs/tutorials/typescript.md
  125. +135 −164 site/docs/tutorials/typescript.zh-CN.md
  126. BIN site/public/img_egg/qrcode_egg_channel.png
  127. +36 −5 test/app/extend/application.test.js
  128. +10 −13 test/app/extend/context.test.js
  129. +4 −4 test/app/extend/request.test.js
  130. +41 −2 test/app/middleware/body_parser.test.js
  131. +2 −3 test/app/middleware/meta.test.js
  132. +1 −2 test/app/middleware/override_method.test.js
  133. +19 −0 test/app/middleware/site_file.test.js
  134. +0 −7 test/async/index.test.js
  135. +3 −3 test/{async/_async.js → asyncSupport.test.js}
  136. +0 −2 test/bench/server.js
  137. +28 −29 test/doc.test.js
  138. +1 −3 test/fixtures/apps/agent-app/plugins/mock-client/mock_client.js
  139. +11 −0 test/fixtures/apps/app-die-ignore-code/app/router.js
  140. +3 −0 test/fixtures/apps/app-die-ignore-code/config/config.default.js
  141. +3 −0 test/fixtures/apps/app-die-ignore-code/package.json
  142. +6 −0 test/fixtures/apps/app-enableFastContextLogger/app/controller/home.js
  143. +3 −0 test/fixtures/apps/app-enableFastContextLogger/app/router.js
  144. +5 −0 test/fixtures/apps/app-enableFastContextLogger/config/config.default.js
  145. +3 −0 test/fixtures/apps/app-enableFastContextLogger/package.json
  146. +33 −0 test/fixtures/apps/app-runInAnonymousContextScope-withRequest/app.js
  147. +1 −0 test/fixtures/apps/app-runInAnonymousContextScope-withRequest/config/config.default.js
  148. +3 −0 test/fixtures/apps/app-runInAnonymousContextScope-withRequest/config/config.unittest.js
  149. +3 −0 test/fixtures/apps/app-runInAnonymousContextScope-withRequest/package.json
  150. +13 −0 test/fixtures/apps/app-runInAnonymousContextScope/app.js
  151. +1 −0 test/fixtures/apps/app-runInAnonymousContextScope/config/config.default.js
  152. +3 −0 test/fixtures/apps/app-runInAnonymousContextScope/config/config.unittest.js
  153. +3 −0 test/fixtures/apps/app-runInAnonymousContextScope/package.json
  154. +1 −3 test/fixtures/apps/app-server-customized-client-error/config/config.default.js
  155. +1 −3 test/fixtures/apps/app-server-timeout/app/router.js
  156. +1 −1 test/fixtures/apps/app-ts-esm/app/controller/foo.ts
  157. +32 −0 test/fixtures/apps/app-ts-type-check/normal.ts
  158. +9 −3 test/fixtures/apps/app-ts-type-check/tsconfig.json
  159. +1 −1 test/fixtures/apps/app-ts-type-check/yadan.d.ts
  160. +43 −1 test/fixtures/apps/app-ts/app/controller/foo.ts
  161. +7 −0 test/fixtures/apps/app-ts/config/config.ts
  162. +1 −0 test/fixtures/apps/app-ts/lib/logger.ts
  163. +3 −7 test/fixtures/apps/app-ts/tsconfig.json
  164. +1 −3 test/fixtures/apps/boot-app/agent.js
  165. +1 −3 test/fixtures/apps/boot-app/app.js
  166. +1 −6 test/fixtures/apps/cluster_mod_app/lib/registry_client.js
  167. +6 −8 test/fixtures/apps/ctx-background/app/controller/app.js
  168. +1 −3 test/fixtures/apps/ctx-background/app/controller/custom.js
  169. +5 −7 test/fixtures/apps/ctx-background/app/controller/error.js
  170. +4 −6 test/fixtures/apps/ctx-background/app/controller/home.js
  171. +11 −0 test/fixtures/apps/custom-logger/app/router.js
  172. +1 −3 test/fixtures/apps/custom-logger/config/config.default.js
  173. +28 −6 test/fixtures/apps/demo/app.js
  174. +1 −1 test/fixtures/apps/docapp/app/middleware/koastatic.js
  175. +1 −1 test/fixtures/apps/dumpconfig-circular/app.js
  176. +1 −1 test/fixtures/apps/dumpconfig/app.js
  177. +15 −0 test/fixtures/apps/dumptiming-slowBootActionMinDuration/app.js
  178. +6 −0 test/fixtures/apps/dumptiming-slowBootActionMinDuration/config/config.default.js
  179. +1 −0 test/fixtures/apps/dumptiming-slowBootActionMinDuration/config/plugin.js
  180. +3 −0 test/fixtures/apps/dumptiming-slowBootActionMinDuration/package.json
  181. +5 −0 test/fixtures/apps/favicon-function/app/controller/home.js
  182. +5 −0 test/fixtures/apps/favicon-function/app/router.js
  183. +7 −0 test/fixtures/apps/favicon-function/config/config.default.js
  184. +3 −0 test/fixtures/apps/favicon-function/package.json
  185. +21 −0 test/fixtures/apps/httpclient-next-overwrite/app.js
  186. +8 −0 test/fixtures/apps/httpclient-next-overwrite/config/config.default.js
  187. +3 −0 test/fixtures/apps/httpclient-next-overwrite/package.json
  188. +6 −0 test/fixtures/apps/httpclient-next-with-tracer/config/config.default.js
  189. +8 −0 test/fixtures/apps/httpclient-next-with-tracer/config/plugin.js
  190. +3 −0 test/fixtures/apps/httpclient-next-with-tracer/package.json
  191. +54 −1 test/fixtures/apps/httpclient-tracer/app.js
  192. +3 −5 test/fixtures/apps/logger-level-debug/app/router.js
  193. +6 −0 test/fixtures/apps/logrotator-app/config/config.default.js
  194. +1 −0 test/fixtures/apps/master-worker-started-worker_threads/config/config.default.js
  195. +8 −0 test/fixtures/apps/master-worker-started-worker_threads/dispatch.js
  196. +3 −0 test/fixtures/apps/master-worker-started-worker_threads/node_modules/egg/index.js
  197. +3 −0 test/fixtures/apps/master-worker-started-worker_threads/node_modules/egg/package.json
  198. +3 −0 test/fixtures/apps/master-worker-started-worker_threads/package.json
  199. +1 −1 test/fixtures/apps/mock-production-app-do-not-force/config/map.json
  200. +1 −1 test/fixtures/apps/mock-production-app/config/map.json
  201. +5 −7 test/fixtures/apps/multiple-view-engine/ejs.js
  202. +4 −6 test/fixtures/apps/multiple-view-engine/nunjucks.js
  203. +21 −0 test/fixtures/apps/tracer-demo/app/controller/foo.js
  204. +1 −0 test/fixtures/apps/tracer-demo/app/router.js
  205. +3 −3 test/fixtures/apps/tracer-demo/tracer.js
  206. +3 −6 test/lib/application.test.js
  207. +6 −9 test/lib/cluster/app_worker.test.js
  208. +3 −6 test/lib/cluster/cluster-client-error.test.js
  209. +6 −6 test/lib/cluster/cluster-client.test.js
  210. +57 −5 test/lib/cluster/master.test.js
  211. +3 −5 test/lib/core/context_httpclient_timeout.test.js
  212. +12 −100 test/lib/core/dnscache_httpclient.test.js
  213. +213 −119 test/lib/core/httpclient.test.js
  214. +15 −2 test/lib/core/httpclient_tracer_demo.test.js
  215. +1 −3 test/lib/core/loader/load_boot.test.js
  216. +7 −9 test/lib/core/loader/load_service.test.js
  217. +64 −20 test/lib/core/logger.test.js
  218. +30 −6 test/lib/core/messenger/ipc.test.js
  219. +5 −5 test/lib/core/singleton.test.js
  220. +29 −0 test/lib/core/utils.test.js
  221. +45 −33 test/lib/egg.test.js
  222. +9 −14 test/lib/plugins/development.test.js
  223. 0 test/lib/plugins/empty.txt
  224. +5 −3 test/lib/plugins/logrotator.test.js
  225. +1 −4 test/lib/plugins/schedule.test.js
  226. +5 −8 test/lib/plugins/watcher.test.js
  227. +0 −4 test/lib/start.test.js
  228. +2 −6 test/ts/index.test.js
  229. +17 −8 test/utils.js
  230. +8 −0 vercel.json
30 changes: 0 additions & 30 deletions .autod.conf.js

This file was deleted.

5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": "eslint-config-egg",
"parserOptions": {
"ecmaVersion": 2017
}
"extends": "eslint-config-egg"
}
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-cn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 🐛 Egg Bug 反馈
description: 如发现 Egg 框架中的 Bug,请及时在此汇报。
labels: [bug]
body:
- type: textarea
attributes:
label: |
在此输入你需要反馈的 Bug 具体信息(Bug in Detail):
placeholder: |
1. 我做了什么。
2. 我的预期值。
3. 我实际得到的结果。
4. 可以的话,请提供一些截图、视频作为附件以复现症状。
validations:
required: true
- type: textarea
attributes:
label: 可复现问题的仓库地址(Reproduction Repo)
description: |
1. 请使用 `npm init egg --type=simple bug` 创建最小可复现问题的代码。
2. 在 GitHub 中上传该代码项目,并在此处粘贴地址。你也可以直接将你的仓库压缩为 zip 文件直接以附件形式提交。
placeholder: |
https://github.com/YOUR_REPOSITORY_URL
validations:
required: true
- type: input
attributes:
label: Node 版本号:
description: |
你的当前复现问题的 Node 版本号:
placeholder: |
使用 “node -v” 命令,在控制台得到版本号(例如:v8.5.0)。
validations:
required: true
- type: input
attributes:
label: Eggjs 版本号:
description: |
你的当前复现问题 Eggjs 版本号:
placeholder: |
请直接在“package.json”中查阅(例如:3.1.0)。
validations:
required: true
- type: input
attributes:
label: "相关插件名称与版本号(PlugIn and Name):"
description: |
插件名称以及版本号:
placeholder: |
请直接在“package.json”中查阅(例如:egg-mysql,3.1.1)。
validations:
required: true
- type: input
attributes:
label: "操作平台与版本号(Platform and Version):"
description: |
你的操作平台与版本号:
placeholder: |
Windows 10 专业版(21H2)
validations:
required: true
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 🐛 Bug Report For Eggjs
description: Report an issue if something isn't working as expected 🤔.
labels: [bug]
body:
- type: textarea
attributes:
label: |
Your detail info about the Bug:
placeholder: |
1. What I did.
2. What I expected to happen.
3. What I actually got.
4. If possible, images/videos as attachments are welcomed to show the bug.
validations:
required: true
- type: textarea
attributes:
label: Reproduction Repo
description: |
1. Please use `npm init egg --type=simple bug` to create your smallest repo.
2. Submit it in the GitHub and paste your URL here. You can also attach your zip file directly.
placeholder: |
https://github.com/YOUR_REPOSITORY_URL or your zip file
validations:
required: true
- type: input
attributes:
label: Node Version
description: |
What's your Node's version?
placeholder: |
Use "node -v" in your console to get it (e.g: v8.5.0).
validations:
required: true
- type: input
attributes:
label: Eggjs Version
description: |
What's your Eggjs version?
placeholder: |
See it directly in your "package.json" file (e.g: 3.1.0)
validations:
required: true
- type: input
attributes:
label: Plugin Name and its version
description: |
What's your plugin's name and version?
placeholder: |
See them directly in your "package.json" file (e.g: egg-mysql, 3.1.1)
validations:
required: true
- type: input
attributes:
label: Platform and its version
description: |
What's your platform and its version?
placeholder: |
Windows 10 Professional(21H2)
validations:
required: true
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report_cn.md

This file was deleted.

21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-cn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 💡 我有一个新点子
description: 我对 Eggjs 框架有一个新的想法(或许我想来实现他)……
labels: [feature request]
body:
- type: markdown
attributes:
value: |
对于 Egg.js 框架,你有一个新的想法?
不过在提交你的新点子之前,麻烦请检阅一下是否之前的帖子中有类似重复的内容。
- type: textarea
attributes:
label: 请详细告知你的新点子(Nice Ideas):
placeholder: |
1. 您期望能够实现什么功能。
2. 您的理由(如:我一直被什么问题困扰……)。
如果方便的话,请提供截屏或者视频等详细信息。
3. 我能够做一些什么(最好是能提供一些伪代码帮助实现)。
validations:
required: true
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 💡 Feature Request For Eggjs
description: I have a suggestion (and may want to implement it)!
labels: [feature request]
body:
- type: markdown
attributes:
value: |
You have an idea how to improve the Eggjs?
Before submitting, please have a look at the existing issues if there's already
something related to your suggestion.
- type: textarea
attributes:
label: "Enter your suggestions in details:"
placeholder: |
1. What I expected to happen?
2. Your reason (e.g: I'm always frustrated with...).
If possible, images or videos are welcome.
3. What I plan to do (Optional but better in pseudo codes).
validations:
required: true
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/rfc-cn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🚀 RFC 提案
description: 我对 Eggjs 框架技术架构功能层面上有重大新增、改进等。
labels: [RFC proposal]
body:
- type: markdown
attributes:
value: |
对于 Eggjs 框架功能你是否有重大的新增或改进之类的想法?
不过在提交你的新想法或方案之前,麻烦请检阅一下是否之前的帖子中有类似重复的内容。
- type: textarea
attributes:
label: 请详细告知你的新解决思路(Your new RFCs):
placeholder: |
1. 描述你希望解决的问题的现状,附上相关的 issue 地址。
如果方便的话,请提供截屏或者视频等详细信息。
2. 我能够做一些什么(譬如具体相关的的 API,描述思路,最好是能提供一些伪代码帮助实现)。
validations:
required: true
- type: checkboxes
attributes:
label: "跟进类型(Follow-up Types):"
description: 此议案跟进类型情况:
options:
- label: 这是某个任务
- label: 这是一个具体的 PR 的地址(URL)
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/rfc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 🚀 RFC Proposals
description: I've got a major improvement (or idea) on the technical architecture of the Eggjs framework.
labels: [RFC proposal]
body:
- type: markdown
attributes:
value: |
Any better new/changable functions for the core technical architecture of the Egg.js framework?
But please make sure there's no duplicated issues related to your idea before submitting.
- type: textarea
attributes:
label: "Please describe your idea in detail:"
placeholder: |
1. Describe the current situation of the problem you want to solve,
and attach the related issue address.
If it is possible, please provide screenshots or videos in detail.
2. What can I do (related APIs, Your ideas, better to provide some pseudo code to help implementations).
validations:
required: true
- type: checkboxes
attributes:
label: Follow-up type
description: The type of the RFC proposals.
options:
- label: Some Task
- label: PR URL(s)
validations:
required: true
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/rfc_cn.md

This file was deleted.

Loading