xiaerfei / voe

:jack_o_lantern: Double thread javascript framework has the same API with Vue3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

voe logo

Voe npm-v

🎃 Double thread javascript framework has the same API with Vue3.

Introduction

voe (发音 /vəʊ/) 的双线程是小程序的底层架构,它通过 web-worker 隔离 web 环境,屏蔽 dom 能力,从而做到绝对的控制力

顺便实现了 vue3 的响应式,依赖收集,状态更新等,但本质不同

Use

yarn add voe
import { render, h, reactive } from '../src'

function App (props) {
  const state = reactive({ count: 0 })
  return () => (
    <view>
      <text>{state.count}</text>
      <button onClick={e => state.count++}>+</button>
    </view>
  )
}

render(<App />)

p.s.

由于用户代码都在 worker 中运行,所以 document、window 等都不能用

但是可以使用 fetch 和 indexDB,双线程的目的就在于此,不是不让用,而是真的没得用

目前还是原型阶段,等我慢慢完善……

About

:jack_o_lantern: Double thread javascript framework has the same API with Vue3


Languages

Language:TypeScript 97.6%Language:JavaScript 2.4%