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

写了个新前端 UI 库玩具

  •  
  •   ClassicOldSong ·
    ClassicOldSong · Oct 30, 2021 via iPhone · 3320 views
    This topic created in 1683 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
        1
    Cbdy  
       Oct 30, 2021
    js 还是用 template literals 弄 dsl 吧,像 vue 、htm 、emotion 做得那样
    ClassicOldSong
        2
    ClassicOldSong  
    OP
       Oct 30, 2021 via iPhone
    @Cbdy 原本就是想看看纯 js 的极限在什么地方
    另外 template literal 的话势必涉及到一定程度的解析编译,也逃不过正则,我希望这个库能够运行在一些非常极端的条件下比如没有正则的单片机 js runtime 下,所以就变成了这个样子
    lujjjh
        3
    lujjjh  
       Oct 30, 2021 via iPhone
    ClassicOldSong
        4
    ClassicOldSong  
    OP
       Oct 30, 2021 via iPhone
    @lujjjh 挺好的,但 coffee 的语义和 js 还是不太一样。。。
    Cbdy
        5
    Cbdy  
       Oct 31, 2021
    @ClassicOldSong runtime 不够 aot 来凑
    ClassicOldSong
        6
    ClassicOldSong  
    OP
       Oct 31, 2021 via iPhone
    @Cbdy 其实挺够的
    没有 virtualdom ,整体体积只有 3kb ,指哪打哪也不需要 AOT 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5581 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 01:35 · PVG 09:35 · LAX 18:35 · JFK 21:35
    ♥ Do have faith in what you're doing.