Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support use react write miniapp (#3393) #3344

Merged
merged 99 commits into from
Aug 6, 2020
Merged

Conversation

chenbin92
Copy link
Collaborator

@chenbin92 chenbin92 commented Jul 13, 2020

raxjs 0.1.0-1 版本

plugin-core

为 raxjs 和 icejs 提供运行时能力

  • raxjs & icejs 运行时模板
    • raxjs 模板
    • icejs 模板
    • 应用入口(runApp)
    • 生命周期(appCycles、pageCycles)
      • icejs + react 小程序
      • icejs 项目
      • rax web 项目
    • 自动引入 app.json
    • 路由实例化
    • 自定义路由
  • 提供加载插件的运行时(plugin-xx/runtime.ts)的能力
  • 提供项目临时文件 generator 生成器能力

create-cli-utils(raxjs & icejs)

  • 基于 build-scripts 封装 raxjs 包提供 CLI 和插件集能力
  • 基于 build-scripts 封装 icejs 包提供 CLI 和插件集能力
  • 封装 raxjs & icejs 公共的 create-cli-utils 文件包

create-app-shared

  • 提供 Rax&React 通用的 API
function createShareAPI({ withRourer, createElement, useEffect, loadRuntimeModules }) {
  const { usePageShow, usePageHide } = createUsePageLifeCycle({ useEffect });
  return {
    createApp: createApp({ loadRuntimeModules }),

    // 路由
    withRouter: enhanceWithRouter({ withRourer, createElement }),
    createHistory,
    getHistory,

    // 生命周期
    emitLifeCycles,
    usePageShow,
    usePageHide,
    withPageLifeCycle,

    // 工具方法
    pathRedirect,
    registerNativeEventListeners,
    addNativeEventListener,
    removeNativeEventListener
  };
};

完整示例

  • examples/basic-spa:icejs 示例
  • examples/with-miniapp: icejs + React 小程序示例
  • examples/with-rax-web: raxjs 示例
  • examples/with-rax-mimiapp: raxjs 小程序示例

p0

p1

730 版本发布

  • web app framework
  • raxjs beta 版本
    • raxjs web 链路
    • raxjs 小程序链路
  • icejs beta 版本
    • 小程序链路
    • 生命周期

807 版本发布

  • icejs 发布支持小程序正式版本
  • raxjs 发布业务可用版本

DONE

其他

  • icejs 中后台项目路由使用 routes.ts,其他配置在 app.json 的 routes 中
  • rax MPA 多入口的配置问题
  • document
  • App Shell 概念不透出,走静态构建

@chenbin92 chenbin92 requested review from imsobear and SoloJiang July 13, 2020 01:50
@imsobear imsobear changed the title [WIP] Feat/v2 [WIP] Feat/MP Jul 15, 2020
@chenbin92 chenbin92 requested a review from ClarkXia August 5, 2020 03:05
@chenbin92 chenbin92 changed the title [WIP] Feat/MP feat: support use react write miniapp (#3393) Aug 6, 2020
@chenbin92 chenbin92 merged commit 974e0a0 into release-next Aug 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat/v2 branch August 6, 2020 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants