xiaohuoni / goji

React ❤️ Mini Program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goji

🚧 Work in Progress 🚧

React ❤️ Mini Program

Visions

Write React code, run on Mini Programs.

Support these platforms:

  • Wechat
  • Baidu
  • Alipay
  • Toutiao
  • Kuai App ( TBD )
  • Web ( TBD )

Use TARGET=alipay before yarn start to test different platforms.

Usage

import React, { useState } from 'react'
import { View, Text, Button, render } from 'fard' // will rename later
import './index.styl'

const App = () => {
  const [count, setCount] = useState(0)
  return (
    <View>
      <Text>{count}</Text>
      <Button onClick={() => setCount(count + 1)}>+</Button>
    </View>
  )
}

render(App)

For more details see packages/demo-webpack.

Architecture

image

Goji is inspired from fard and remax.

This picture show the architecture of fard.

And here is an article about fard: fard:fre 转小程序的新思路

How to contribute

Since fard use monorepo managed by lerna you should install lerna at first.

npm i -g lerna

Then install all dependencies:

lerna bootstrap

For more details of how to use Lerna see the official documents.

For example run these commands if you'd like to run fard-demo with Webpack:

cd packages/demo-webpack
yarn build

About

React ❤️ Mini Program

License:MIT License


Languages

Language:TypeScript 81.3%Language:JavaScript 10.5%Language:HTML 7.4%Language:CSS 0.9%