npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hellobikefe/dora

v0.0.1

Published

hellobike-micro-frontend-lib

Downloads

1

Readme

taro小程序微前端集成框架

dora是一个哈啰出行的开源的taro小程序微前端集成框架,具有把多页业务拆分并集成编译的与通讯的能力,解耦了业务与业务,降低了总体的复杂度与多业务线合作难度

集成编译

dora具有集成编译功能,app与在subapp中添加以下config既可以运行,会自动集成各业务线的路由, 可以参考demo仓库

事件通讯

dora使用事件通讯来解耦业务线与业务线之间的关系,在subapp的config中可以定义事件来监听整个app的运行周期与自定义事件

  componentDidShow () {
    doraEvent.emit({
      eventName : 'app:componentDidShow',
      args : {},
    });
  }
  event : {
    'app:componentDidShow' : (arg) => {
      console.log('subapp 启动');
      console.log('持续检测用户当前订单是否偏离导航,触发安全机制。');
    },
    'app:componentDidHide' : (arg) => {
      console.log('subapp 启动');
      console.log('推入后台暂停检测');
    },
  },

在小程序componentDidShow时候就会打印

子父通讯与桥接

dora使用ctx来桥接父与子仓库的通讯

setCtx

import useCtx from '../../../../../src/export/useCtx';

setCtx({
  moduleA: ()=>{
    return '我来自父app'
  }
})

useCtx

<View className='index'>
  我是subapp的页面
  <View >
    {useCtx().moduleA()}
  </View>
</View>

版本控制

dora update

dora update 把所有subapp的版本切换为父应用中的版本

dora publish

dora publish 把当前目录publish到父仓库中去,请确定你拥有父仓库与子仓库的push权限

demo

https://github.com/hellof2e/doraAppExample 父应用demo https://github.com/hellof2e/doraSubappExample 子应用demo

指令

命令
Options:
  -V, --version     output the version number
  -h, --help        display help for command
Commands:
  publish           发布子应用代码至父应用
  update [options]  更新子应用
  help [command]    display help for command