惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
N
News | PayPal Newsroom
GbyAI
GbyAI
B
Blog RSS Feed
博客园_首页
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
D
Docker
美团技术团队
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
Forbes - Security
Forbes - Security
雷峰网
雷峰网
Help Net Security
Help Net Security
V2EX - 技术
V2EX - 技术
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
Recent Commits to openclaw:main
Recent Commits to openclaw:main
B
Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Jina AI
Jina AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cloudbric
Cloudbric
T
Troy Hunt's Blog
Hacker News: Ask HN
Hacker News: Ask HN
AI
AI
P
Proofpoint News Feed
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Last Watchdog
The Last Watchdog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Schneier on Security
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
Google Online Security Blog
Google Online Security Blog
S
Security Affairs
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - x3d

deepin 23 一个可用 mysql-workbench 版本 8.0.36 基于 Maxwell 实现 MySQL 数据实时迁移到 Mongodb 本地开发环境 通过Podman 手动从头搭建 Ubuntu 容器镜像 intel ax203/ax201 无线网卡驱动 firmware 居然有问题 Direct firmware load for iwlwifi-bz-b0-hr-b0-94.ucode failed with error -2 在安卓平板上搭建 webdav 服务 近期不要选aliyun cloud linux 镜像 一点 PHP 中优雅的将JSON/XML/YAML 等数据反序列化成指定的类对象 开始收割了 PHP Composer 虚拟依赖包 - 实现按需载入钉钉对应功能模块的 php sdk 盘点之原地踏步三 盘点之原地踏步二 apijson 初探 Apache Synapse ESB erupt api Think3 ORM 《超文本和超链接》的时间线整理 MEAF框架概念检索工具 现代企业架构框架MEAF初次解读
盘点之原地踏步一:weui 的一点探索
x3d · 2022-12-25 · via 博客园 - x3d

2022的最后这一个月,自己很忙,每天起早贪黑,但是停下来一盘算,仍然是没什么有价值的可复用的产出物,一如过去这些年。

想探索基于企微或钉钉这种群件(groupware,我倾向于这么叫,至今最为激进的钉钉也仍然没有超越群件当初定义的三范式)平台做新时代下的业务流程性功能开发的可行性,一路下来发现坑不少,一个多月时间都花在填坑上了。

最后是在企微应用要求尽量遵循 weui 风格这一点上,这几天就一直在摸索这一块;为什么是“摸索”;weui 从官方产出物来看,只有 css 定义 和 一些 examples,没有文档;尽管官方也有 react-weui、以及市面上还有一些第三方维护的 weui 的组件化封装。

因而,我在想 weui 到底是什么。

第一反应,它是微信官方定义的一套视觉语言,不过这一块的完整概念是以前在 ant.design 的网站上“设计”板块看到的。

二,因为在考虑如何基于 weui 的语言实现更有生产力的组件化应用,在翻看各种相关库和源代码,看到 vant 的代码,用了 vue 的 create util 模块,里面提到了 createBEM,然后发现 BEM 的线索,最后搜索发现,是 Block__Element--Modifier 这样的一套前端组件化方法。回过头来,在 weui 官方 github 的 wiki 里也看到了一段描述,它从 1.0 开始也是启用了 bem 的命名方式。


/**
 * bem helper
 * b() // 'button'
 * b('text') // 'button__text'
 * b({ disabled }) // 'button button--disabled'
 * b('text', { disabled }) // 'button__text button__text--disabled'
 * b(['disabled', 'primary']) // 'button button--disabled button--primary'
 */
export function createBEM(name: string) {
  return (el?: Mods, mods?: Mods): Mods => {
    if (el && typeof el !== 'string') {
      mods = el;
      el = '';
    }

    el = el ? `${name}__${el}` : name;

    return `${el}${genBem(el, mods)}`;
  };
}

export type BEM = ReturnType<typeof createBEM>;

export function createNamespace(name: string) {
  const prefixedName = `van-${name}`;

三、在脑子里尝试从 weui 官方的 less 定义和 example 中提取组件的时候,发现了 vant 与它的一种潜在可能的联系性,猜测 vant 也许是有赞在微信生态中生存过程消化 weui 的一个技术副产物。

四、时间线

bem 代码仓库 最早的提交时间;

Initial commit
floatdrop committed on Aug 24, 2014


https://github.com/Tencent/weui/

init weui
jfengjiang committed on Sep 25, 2015


react-weui 代码仓库最早的提交时间;

init
progrape committed on Dec 14, 2015


vant 最早提交时间

Author: niunai 
Date:   Tue Dec 27 20:11:05 2016 +0800

    init

而我最早关注前端组件化大概也是这个时候,2015-01-27 23:47

阿里前端框架Alice是个不错的选择

但是,我毕竟不是个纯前端,很早的时候,生存所迫,技术变成只是我的一种手段,而非单一信仰,因而没法在技术前沿推进。

只能从一个使用者角度,感受,跟进。

当我试着站在开发者角度,发现没有必要文档时,想利用现成工具如 @vant/cli 自己去做一些整理时,才稍稍能找回技术者的感觉。