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

About block #17

Open
nikogu opened this issue Jun 6, 2019 · 3 comments
Open

About block #17

nikogu opened this issue Jun 6, 2019 · 3 comments

Comments

@nikogu
Copy link
Member

nikogu commented Jun 6, 2019

背景

umi 和 antdpro@v4 已经逐步推出了区块(block)的概念,我觉得这个是一个很好的方式,可以高效的解决业务组件使用的问题。

在之前我在内网也做过类似的东西,我认为代码片段是业务组件最适合的载体。

但是目前 umi block 还停留在解决 antd pro 添加页面区块的程度,离体系化的业务组件平台还有一定差距。

smallfish 能做什么

第一步:smallfish 接入 umi block

我觉得 smallfish 以前端赋能为基准的解决方法,代码片段是很好的一个方式能够让开发者快去使用组件以及二次开发,能够让他们脱离 copy & past 的重复工作的黑洞。

我觉得可以就用 umi block 的方案,没必要自己搞,不过在使用方式上 smallfish 还是要封装一个插件,比如 smallfish-plugin-umi-block,然后配置化开启后:

{
  umiBlock: true,
}

就可以使用 smallfish umi-block add 等 umi block 的命令了。

第二步:建立平台

远期规划

第一步只是说打通了 smallfish 和 umi block,并没有解决高效承载各方业务组件的问题,需要达成这样的目的,我们需要一个类似于 npm 的平台,能够想管理 npm 包一样管理我们的代码片段。

所以承载代码片段的底层还是 npm,也就是说每个业务组件还是一个 npm 包(这点 umi block 也是一样的),但是不同的是我们能够让每个人都能够方便的上传和下载,需要有以下几个东西:

  • 规范:怎么写一个业务组件包
  • 工具:开发、上传、下载
  • 平台:展现、注册业务组件
@nikogu
Copy link
Member Author

nikogu commented Jun 6, 2019

@rockSandy @JIACHENG9 有空看看。

@JIACHENG9
Copy link
Contributor

区块有个地方能查看就行,工具去下载看起来暂不着急

@nikogu
Copy link
Member Author

nikogu commented Jun 6, 2019

下周先搞个插件支持 umi block 我觉得就可以了,后面再看发展情况是否需要做扩展。

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

No branches or pull requests

2 participants