しろは なるせ(shiroha naruse) 白羽 鸣濑是一名鸟白岛上的巫女,经常站在海岸边眺望大海。
Naruse是一个在小程序内支持使用 react 开发,同时在小程序内部支持 热更新 的解决方案 特性
🔥 原生react开发体验(生命周期,多组件开发,你想要的都有)
🚀 热更新代码(无需等待小程序繁琐的审核!)
🧱 完善的配套开发工具(webpack插件, 类型提示...)
pnpm
# 编译最新版本代码
pnpm build
# alipay
pnpm demo:alipay
# 修改 /demo/demo-alipay/advert/index.tsx 动态刷新效果
# 使用淘宝或者支付宝开发者小程序打开 /demo/demo-alipay 即可
因为 naruse 可能会经常涉及到多个库之间依赖运行,例如:naruse-webpack-runner 与 naruse-alipay 与 react-like-hooks 同时运行的情况,所以推荐使用 concurrently 运行多个开发
例子:
# 以 naruse-webpack-runner 的 demo 与 naruse-alipay 为例
pnpm concurrently --kill-others-on-fail "pnpm --filter naruse-webpack-runner dev:demo" "pnpm --filter naruse-alipay dev"
naruse 需要新增版本时,需要使用 changeset 来管理版本号,具体使用方法可以参考 changeset
# 1. 新增版本更新内容,根据修改内容选择不同的更迭版本
# 如果有多次修改则需要多次执行
pnpm changeset add
# 2. 生成版本号
pnpm changeset version
# 3. 重新打包
pnpm build
# 4. 合并到主分支