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

fix#simulateComponents 使用策略模式构建快应用组件模拟系统 #4385

Closed
wants to merge 5,092 commits into from

Conversation

Qiyu8
Copy link
Collaborator

@Qiyu8 Qiyu8 commented Sep 4, 2019

这个 PR 做了什么? (简要描述所做更改)
FIX#4336
从丰富的Taro组件(源自微信小程序组件)转换到相对滞后的快应用组件会有很大的挑战,大体可以分为以下三类转换模型:
1.使用Taro兼容库组件模拟
比如Icon、Image和RichText等快应用支持的组件
2.使用快应用原生组件模拟
比如Form、CheckboxGroup、CoverView、Ad等快应用不支持的组件可暂时使用快应用支持的组件替换掉,至少先保证页面可以预览。
3.快应用特有组件或用户自定义组件不模拟
在Taro里面直接写快应用组件也是可以的,那这种情况就无需模拟了,比如list、popup等
翻了一下设计模式,发现上述三种转换模型比较适合使用策略模式来实现
image
于是基于这个模型实现了组件模拟系统,欢迎大家多提意见~

这个 PR 是什么类型? (至少选择一个)

X错误修复(Bugfix) issue id #4336
新功能(Feature)
代码重构(Refactor)
TypeScript 类型定义修改(Typings)
文档修改(Docs)
代码风格更新(Code style update)
其他,请描述(Other, please describe):
这个 PR 满足以下需求:

提交到 master 分支
Commit 信息遵循 Angular Style Commit Message Conventions
所有测试用例已经通过
代码遵循相关包中的 .eslintrc, .tslintrc, .stylelintrc 所规定的规范
在本地测试可用,不会影响到其它功能
这个 PR 涉及以下平台:

微信小程序
支付宝小程序
百度小程序
头条小程序
QQ 轻应用
X快应用平台(QuickApp)
Web 平台(H5)
移动端(React-Native)
其它需要 Reviewer 或社区知晓的内容:

yuche and others added 30 commits July 24, 2019 10:22
fix(taro-weapp): 修复state上空对象变为有数据时,子组件不会去setData
showTabBarRedDot hideTabBarRedDot setTabBarBadge removeTabBarBadge
feat(rn): 让页面组件在RN环境能自定义navigationOptions
* feat: add babel plugin preval

* fix: change preval plugin deps

* refactor(cli): 使用适配 babel@6 的 plugin-preval 版本
…S#3901)

Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.10...4.17.15)

Signed-off-by: dependabot-preview[bot] <[email protected]>
)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.11...4.17.13)

Signed-off-by: dependabot-preview[bot] <[email protected]>
@yuche yuche self-requested a review September 4, 2019 06:30
@luckyadam
Copy link
Member

碉堡了

@Issacpeng
Copy link
Collaborator

刚好出现类似问题,PR采用的是白名单制度,目前看可以优先保证类似page转换时的流程能够顺利执行。
1)如果白名单有所增加,可能还需要再补充处理 异常情况
2)同时还需在完成后对源码进行修复,重新补全未转换的page

@luckyadam 是否还有更完善的思路?
报错如下图:
image

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

Successfully merging this pull request may close these issues.

【快应用】Taroize之后转快应用大量组件报错