-
Notifications
You must be signed in to change notification settings - Fork 93
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
Chore (gitignore, file_loader.test.js): Update files #195
Conversation
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
=======================================
Coverage 99.91% 99.91%
=======================================
Files 19 19
Lines 1215 1215
Branches 212 212
=======================================
Hits 1214 1214
Misses 1 1
Continue to review full report at Codecov.
|
@popomore:We must add some deprecated messages to notify users about some NOT-RECOMMANDED methods but keep them still in alive. |
lib/lifecycle.js
Outdated
@@ -106,10 +106,12 @@ class Lifecycle extends EventEmitter { | |||
} | |||
|
|||
registerBeforeStart(scope) { | |||
deprecate('beforeStart is deprecated, please use either didReady or willReady instead.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecate message isn't friendly, I'll create a document for the migration, point to the document later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who will see the doc? And you should know that when a method isn't used any more, we should put it as a deprecated.....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, your doc should be synced with the deprecated methods, this should be right and IMO, I should add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
死马的意思是depd没问题,需要写一份如何升级的文档,并将文档链接写到depd message 里面去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fengmk2 :There're some warnings telling us that we shouldn't use some methods, take 'beforeClose' as an example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就是引用:https://eggjs.org/en/advanced/loader.html#beforestart。 如果可以我在 deprecate 中引用这个连接。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不是 migration 的文档,migration 需要说明老的代码如何迁移到新的写法才是的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fengmk2 :我知道这个不是migration,不过这个文档已经很清楚了,确实还需要一份Migration文档?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我建议就在原有文档基础上进行一些补充说明——就像你们Egg从1.X到2.X一样,在源文档上做更新。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对,只要有这份升级说明即可,是否独立写都没问题。
1. This will fix the issue eggjs/core#195 and gives a good answer to #3362. We should notify users how to upgrade their lifecyle events quickly. 2. Fix some '##title', we should directly use 'title:...' instead. 3. Due to the conflict of typescript of nodejs in the global/local, we've forcely defined the type path.
doc:Add new loaderUpdate.md (#3395) 1. This will fix the issue eggjs/core#195 and gives a good answer to #3362. We should notify users how to upgrade their lifecyle events quickly. 2. Fix some '##title', we should directly use 'title:...' instead. 3. Due to the conflict of typescript of nodejs in the global/local, we've forcely defined the type path.
1) For 'gitignore': Add the 'package-lock.json' to ignore it. 2) For 'file_loader.test.js': Uncomment one unit test to make full unit test passed.
1) For 'gitignore':
Add the 'package-lock.json' to ignore it.
2) For 'file_loader.test.js':
Uncomment one unit test to make full unit test passed.
npm test
passes