-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(typings): add class EggLoader #2321
Merged
+44
−0
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a8b7c9f
chore(typings): add class EggLoader
waitingsong 830bc28
chore(typings): add class AppWorkerLoader
waitingsong afeb38c
chore(typings): add class AgentWorkerLoader
waitingsong 68d7892
chore(typings): add class Subscription
waitingsong a06d98d
fix(typings): Property 'scope' does not exist on type 'EggAppInfo'.
waitingsong 08cb99e
chore(typings): change elements of EggAppConfig['view'] optional
waitingsong 0eb73c4
chore(typings): revert to 6c32d1098fcc1
waitingsong 1d40935
chore(typings): comment private method of EggLoader out
waitingsong 71424c8
chore(typings): remove private method
waitingsong 8bc69a1
chore(typings): export types
waitingsong 73cd071
chore: prune
waitingsong 5a6f37f
Merge branch 'master' into ts
waitingsong c59b991
Merge branch 'master' into ts
popomore fad30ec
Merge branch 'master' into ts
popomore 184edcd
Merge branch 'master' into ts
popomore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
EggLoader 里其实有很多暴露出来的方法可能是需要在上层框架中用到的,也需要补一下吧,比如
getLoadUnits
,loadToApp
,loadToContext
这些?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.
方法比较多,如果在 EggCore 里面添加 index.d.ts 可能更清晰些。 不过我对 typings 合并(到egg)机制不大清楚
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.
不用,你直接加 d.ts 到 egg-core 中,然后在 egg 中 import 进来就行了,typings 合并到 egg 那个只是适用于上层框架、插件的
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.
@whxaxes 你的意思是在 egg-core 项目中添加
egg-core/index.d.ts
文件么?不过
EggAppInfo
这个类型是在egg/index.d.ts
中定义的啊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.
可以有两种方式
import { EggLoaderOptions } from 'egg'
,这样会循环依赖,但问题不大,运行是没有问题的export { EggLoaderOptions } from 'egg-core'