-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs: add progressive usage #268
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
Conversation
Current coverage is 97.89% (diff: 100%)@@ master #268 diff @@
==========================================
Files 34 34
Lines 904 904
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 885 885
Misses 19 19
Partials 0 0
|
fengmk2
left a comment
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.
原来这也是渐进式
d3c5049 to
fefd429
Compare
|
@popomore @fengmk2 @dead-horse 这个可以 review 了。 |
fb2cea2 to
b01fd34
Compare
|
@fengmk2 当然是「progressive」啦~ @popomore review 下? https://www.zhihu.com/question/51907207 |
| module.exports = { | ||
| get isIOS() { | ||
| const iosReg = /iphone|ipad|ipod/i; | ||
| return iosReg.test(this.get('user-agent'); |
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.
这里也少了括号
|
|
||
| ```json | ||
| { | ||
| "name": "egg-ua", |
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.
这个时候其实可以不提 name 和 version,发模块才需要
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.
package.json 的定义里面, 这 2 个 required 的
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.
npm 才需要吧
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.
done
| "framework": "example-framework" | ||
| }, | ||
| "dependencies": { | ||
| "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.
这个不需要配了吧
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.
嗯
| 假设我们有一段分析 UA 的代码,实现以下功能: | ||
|
|
||
| ```js | ||
| ctx.isAndroid(); |
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.
这是 getter 吧?
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.
嗯, 改改
| ctx.isIOS(); | ||
| ``` | ||
|
|
||
| 通过之前的教程,大家一定可以很快的写出来,我们快速 review 下: |
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.
review 改成回顾?
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.
改了
| }; | ||
| ``` | ||
|
|
||
| **注意:在插件还没发布前,可以通过 `npm link` 的方式进行本地测试,具体参见 [npm-link](https://docs.npmjs.com/cli/link)。** |
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.
如果测试的话可以直接在 dependencies 里面写路径吧?
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.
写路径是需要 npm i 的吧? 每次修改都需要重新 install
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.
恩
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.
link 吧
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.
嗯,这个不用改
Checklist
npm testpassesAffected core subsystem(s)
Description of change
渐进式开发的文档