Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: configuration inject plugin and more in production environment #680

Merged
merged 35 commits into from
Oct 27, 2020

Conversation

czy88840616
Copy link
Member

@czy88840616 czy88840616 commented Oct 21, 2020

调整

这个版本修改比较大,列举变化

  • 1、调整 web 框架写法,使得本地开发和构建后的行为一致
  • 2、把 midway 的加载放到 egg 的构造器 load 方法之前,修复入口在编译后注入 app/config/logger 失败的问题(其实就是一的问题引起的)
  • 3、本地开发时,agent/worker 的 ioc 容器分开(v1 的时候就是分开的,但是在 v2 单进程模式调整的时候变成了同一个,还是一的问题)
  • 4、(有争议)调整生命周期行为,屏蔽在 agent 下的 configuration 加载(本地行为和上一个版本一致,这样才能保证只触发一次)
  • 5、在一个进程中包含多个 ioc 容器的时候,共享 object definition(执行加速,只扫描目录一次)

其他的

  • 1、恢复了老版本的所有 case 的单测(兼容性测试)
  • 2、移除了 pluginContext(用户用不到)
  • 3、Container 和 MidwayContainer 合并,保留 MidwayContainer,移除 Container
  • 4、BaseFramework 和 Loader 合并,保留 BaseFramework
  • 5、重构生命周期命名
beforeInitialize -> beforeContainerInitialize
beforeDirectoryLoad -> afterContainerInitialize
afterDirectoryLoad -> afterContainerDirectoryLoad
afterInitalize -> afterContainerReady

@gitpod-io
Copy link

gitpod-io bot commented Oct 21, 2020

@codecov-io
Copy link

codecov-io commented Oct 21, 2020

Codecov Report

Merging #680 into 2.x will increase coverage by 1.21%.
The diff coverage is 92.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x     #680      +/-   ##
==========================================
+ Coverage   85.98%   87.19%   +1.21%     
==========================================
  Files          96       96              
  Lines        4045     4123      +78     
  Branches      659      685      +26     
==========================================
+ Hits         3478     3595     +117     
+ Misses        554      515      -39     
  Partials       13       13              
Impacted Files Coverage Δ
packages/core/src/interface.ts 100.00% <ø> (ø)
packages/core/src/util/staticConfig.ts 94.87% <ø> (ø)
packages/decorator/src/annotation/schedule.ts 100.00% <ø> (ø)
packages/decorator/src/index.ts 100.00% <ø> (ø)
packages/rabbitmq/src/interface.ts 100.00% <ø> (ø)
packages/core/src/context/applicationContext.ts 97.98% <33.33%> (-1.34%) ⬇️
packages/web-express/src/framework.ts 74.57% <33.33%> (+4.87%) ⬆️
packages/web-koa/src/framework.ts 74.59% <33.33%> (+4.73%) ⬆️
packages/web/src/devFramework.ts 66.66% <66.66%> (ø)
packages/rabbitmq/src/framework.ts 95.23% <75.00%> (-2.27%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c606128...8356e59. Read the comment docs.

@czy88840616 czy88840616 changed the title Fix egg loader fix: configuration inject plugin/logger/app and more in production environment Oct 21, 2020
@czy88840616 czy88840616 changed the title fix: configuration inject plugin/logger/app and more in production environment fix: configuration inject plugin and more in production environment Oct 21, 2020
@czy88840616 czy88840616 requested a review from kurten October 26, 2020 09:48
@czy88840616
Copy link
Member Author

用户侧业务测试通过。

@czy88840616 czy88840616 merged commit 41bce5d into 2.x Oct 27, 2020
@czy88840616 czy88840616 deleted the fix_egg_loader branch October 27, 2020 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants