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

组件化的复用性诱惑与其弊端 #126

Closed
JimmyLv opened this issue Dec 14, 2016 · 1 comment
Closed

组件化的复用性诱惑与其弊端 #126

JimmyLv opened this issue Dec 14, 2016 · 1 comment

Comments

@JimmyLv
Copy link
Owner

JimmyLv commented Dec 14, 2016

Description

源自 INSURANCE | BANK 两个业务领域数据的显示,开发当中复用与否,是否重构出 composition components 的犹豫、纠结、争论…

数据来自后端 API
UI 来自设计师,常常改变
数据改动成本较小
组件是重构的结果,非提前设计所能及也?
组件化前, 共处一个Context 
组件化后, 灵活性降低,分处于不同Context,通过事件和Data Flow维系 => Data 重要性

image

References

@JimmyLv JimmyLv changed the title 组件化的复用诱惑与其弊端 组件化的复用性诱惑与其弊端 Dec 14, 2016
@JimmyLv JimmyLv added this to the 04/2017 Schedule milestone Apr 18, 2017
@JimmyLv JimmyLv self-assigned this Apr 18, 2017
@JimmyLv
Copy link
Owner Author

JimmyLv commented Apr 23, 2017

最佳实践与答案差不多就在于此:前端组件化开发方案及其在React Native中的运用 – ThoughtWorks洞见

最关键的问题还是「团队沟通和角色协作」,组件化带来的是整个团队的合作方式变革。

以及UI组件划分为四种类型:

  • Shared Component: 基础组件,Button,Label之类的大部分其它组件都会用到的基础组件
  • Feature Component: 业务组件,对应到某个业务流程的子组件,但其不对应路由, 他们通过各种组合形成了Pag组件。
  • Page: 与路由对应的Container组件,主要功能就是组合子组件,所有Page组件最好名字都以Page结尾,便于区分。
  • Scene: 应用状态和UI之间的连接器,严格意义上它不算UI组件,主要作用就是把应用的状态和Page组件绑定上,所有的Scene组件以Scene后缀结尾。

评注版:https://diigo.com/09md0y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant