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

feat: custom decorator with decorators manager #102

Closed
wants to merge 4 commits into from

Conversation

Lellansin
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@codecov-io
Copy link

codecov-io commented Jan 7, 2019

Codecov Report

Merging #102 into master will decrease coverage by 0.82%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
- Coverage   81.65%   80.83%   -0.83%     
==========================================
  Files          75       76       +1     
  Lines        2197     2228      +31     
  Branches      323      327       +4     
==========================================
+ Hits         1794     1801       +7     
- Misses        281      305      +24     
  Partials      122      122
Impacted Files Coverage Δ
packages/midway-core/src/loader.ts 80.76% <100%> (+0.18%) ⬆️
packages/context/src/index.ts 100% <100%> (ø) ⬆️
packages/midway-core/src/container.ts 85.6% <100%> (+0.1%) ⬆️
packages/context/src/base/Manager.ts 14.28% <14.28%> (ø)

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 5a89373...57c7c52. Read the comment docs.

@Lellansin
Copy link
Contributor Author

目前问题:如果在 app.ts 里面的 module.exports = (app) => app.xxx.register( .... ) 里面注册,那么很可能出现的问题是用户无法劫持原有的方法:因为 controller 上的一些对象可能已经被内部框架持有,此时注册装饰器要劫持其方法已经晚了。

packages/midway-web/test/enhance.test.ts Outdated Show resolved Hide resolved
@czy88840616
Copy link
Member

@kurten 也看看

@kurten
Copy link
Contributor

kurten commented Jan 9, 2019

  • 这个实现不是很好诶,可以开这个issue讨论一下具体实现方案

@czy88840616
Copy link
Member

czy88840616 commented Jan 9, 2019

@kurten #85 #86 这个。

@Lellansin 把你的实现在 issue 里描述下吧,光看 PR 没有头绪。

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.

None yet

4 participants