爱意满满的作品展示区。
ClassicOldSong

写了个新前端 UI 库玩具

  •  
  •   ClassicOldSong ·
    ClassicOldSong · Oct 30, 2021 via iPhone · 3751 views
    This topic created in 1842 days ago, the information mentioned may be changed or developed.
    更多是一个技术验证,不过看起来可用性也还是有一些的

    不需要编译,在原生 JS 语义的范围内我觉得能做成这样已经挺极限了

    NPM: https://www.npmjs.com/package/singui

    GitHub: https://github.com/ClassicOldSong/SingUI

    在线体验(也是暂时的使用文档):
    https://stackblitz.com/edit/singui-demo?file=index.js
    6 replies  •  2021-10-31 13:52:49 +08:00
    Cbdy
    Cbdy
    Oct 30, 2021
    1
    js 还是用 template literals 弄 dsl 吧,像 vue 、htm 、emotion 做得那样
    ClassicOldSong
    ClassicOldSong
    OP
    Oct 30, 2021 via iPhone
    2
    @Cbdy 原本就是想看看纯 js 的极限在什么地方
    另外 template literal 的话势必涉及到一定程度的解析编译,也逃不过正则,我希望这个库能够运行在一些非常极端的条件下比如没有正则的单片机 js runtime 下,所以就变成了这个样子
    lujjjh
    lujjjh
    Oct 30, 2021 via iPhone
    3
    ClassicOldSong
    ClassicOldSong
    OP
    Oct 30, 2021 via iPhone
    4
    @lujjjh 挺好的,但 coffee 的语义和 js 还是不太一样。。。
    Cbdy
    Cbdy
    Oct 31, 2021
    5
    @ClassicOldSong runtime 不够 aot 来凑
    ClassicOldSong
    ClassicOldSong
    OP
    Oct 31, 2021 via iPhone
    6
    @Cbdy 其实挺够的
    没有 virtualdom ,整体体积只有 3kb ,指哪打哪也不需要 AOT 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4984 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 01:52 · PVG 09:52 · LAX 17:52 · JFK 20:52
    ♥ Do have faith in what you're doing.