Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@atian25
Copy link
Member

@atian25 atian25 commented Jan 16, 2017

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 16, 2017

Current coverage is 97.89% (diff: 100%)

Merging #268 into master will not change coverage

@@             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          

Powered by Codecov. Last update 8f8d5ae...7b55c27

Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来这也是渐进式

@atian25 atian25 force-pushed the progressive branch 2 times, most recently from d3c5049 to fefd429 Compare January 17, 2017 03:29
@atian25 atian25 removed the WIP label Jan 17, 2017
@atian25
Copy link
Member Author

atian25 commented Jan 17, 2017

@popomore @fengmk2 @dead-horse 这个可以 review 了。

@popomore popomore mentioned this pull request Jan 17, 2017
31 tasks
@atian25 atian25 force-pushed the progressive branch 2 times, most recently from fb2cea2 to b01fd34 Compare January 17, 2017 09:18
@atian25
Copy link
Member Author

atian25 commented Jan 18, 2017

@fengmk2 当然是「progressive」啦~

@popomore review 下?

https://www.zhihu.com/question/51907207

image


image


image

module.exports = {
get isIOS() {
const iosReg = /iphone|ipad|ipod/i;
return iosReg.test(this.get('user-agent');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也少了括号


```json
{
"name": "egg-ua",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个时候其实可以不提 name 和 version,发模块才需要

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json 的定义里面, 这 2 个 required 的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm 才需要吧

Copy link
Member Author

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": "*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不需要配了吧

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

假设我们有一段分析 UA 的代码,实现以下功能:

```js
ctx.isAndroid();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是 getter 吧?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯, 改改

ctx.isIOS();
```

通过之前的教程,大家一定可以很快的写出来,我们快速 review 下:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review 改成回顾?

Copy link
Member Author

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)。**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果测试的话可以直接在 dependencies 里面写路径吧?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写路径是需要 npm i 的吧? 每次修改都需要重新 install

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link 吧

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,这个不用改

@popomore popomore merged commit 43e2161 into master Jan 18, 2017
@popomore popomore deleted the progressive branch January 18, 2017 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants