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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@unif/react-native-umeng

v0.9.0

Published

友盟 React Native bridge: U-Share(WeChat/DingTalk) + U-App Analytics (@unif 私有)

Readme

@unif/react-native-umeng

npm CI License Docs

友盟 React Native 新架构桥:U-Share(微信会话 / 钉钉分享)+ U-App 移动统计。

当前仓库开发 / example 验证基线为 React Native 0.86.3React 19.2.3@unif/react-native-design 0.30.0@sbaiahmed1/react-native-blur 6.0.1。design 的 peer 接受 >=0.26.0,react-native 接受 >=0.86.0 —— 两者都不设上限,peer 写窄会把上游每次 minor 都变成 breaking。

iOS 的初始化状态机、Share/Analytics 门禁、TurboModule 注册、AppDelegate/SceneDelegate 转发和 example 配置已通过 native contract、simulator build 与 XCTest。Android CI 已通过 native contract、bootstrap/callback JVM tests、启用 minify 的 release 构建与 merged manifest 核对。真实微信 / 钉钉拉起与回包、iOS URL Scheme / Universal Link / AASA、Android 真机 R8 运行仍须在对应环境验证。

特性

  • U-Share — 微信会话 + 钉钉,支持文本 / 图片 / 链接。
  • 命令式分享面板<ShareSheetHost /> 同时支持默认 Modal 与无遮罩、可嵌入当前页面的 floating 面板。
  • U-App 统计 — 同步的 Analytics.onEvent / signIn / signOut
  • PIPL 合规Common.preInit(config) 只保存 JS 快照;用户同意后,无参 Common.init() 才进入 native/vendor 初始化。
  • 稳定错误契约 — 分享只在成功时 resolve;取消、失败和未安装平台均 reject UmengError
  • 官方 Jest mock — 随包导出 @unif/react-native-umeng/mock

首版不支持朋友圈、QQ 或微博。

安装

RN 工程提供 react / react-native,其余 peerDependencies 使用 Yarn 一次装齐:

yarn add @unif/react-native-umeng \
  '@sbaiahmed1/[email protected]' \
  '@unif/react-native-design@^0.30.0' \
  'react-native-gesture-handler@>=3.0.0 <4.0.0' \
  'react-native-reanimated@^4.6.0' \
  'react-native-reanimated-carousel@>=5.0.0 <6.0.0' \
  'react-native-safe-area-context@>=5' \
  'react-native-svg@>=15' \
  'react-native-worklets@^0.12.1'

React Native Community CLI 项目的 babel.config.js 还必须把 Worklets plugin 放在 plugins 最后:

module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: [
    // 其它 plugin
    'react-native-worklets/plugin',
  ],
};

当前 @unif/react-native-design 组合使用 RNGH 3 与 Carousel 5。Carousel 5 发布 metadata 的 RNGH peer 仍停在 <3,仓库通过 scoped override、窄 allowlist 与漂移检查管理这条已验证例外;不要为消除该 warning 降级 RNGH,也不要使用 --force--legacy-peer-deps

完整依赖范围见安装文档

快速开始

至少挂载一个 <ShareSheetHost />,并放在 design 的 <ThemeProvider> 内。默认 modal 模式可使用 App 根 Host;需要让下层长图继续滚动时,可在当前页面再挂一个 Host,并使用 presentation: 'floating'。多个 Host 同时存在时,最新挂载者承载新 session。

import { ThemeProvider } from '@unif/react-native-design';
import {
  Common,
  Share,
  ShareSheetHost,
  UmengError,
} from '@unif/react-native-umeng';

export function App() {
  return (
    <ThemeProvider>
      <Screen />
      <ShareSheetHost />
    </ThemeProvider>
  );
}

// 1. App 启动、用户授权前:只在 JS 校验、标准化并冻结配置快照
await Common.preInit({
  appkey: 'YOUR_UMENG_APPKEY',
  wechatAppId: 'YOUR_WECHAT_APP_ID',
  wechatAppSecret: 'YOUR_WECHAT_APP_SECRET',
  wechatUniversalLink: 'https://your.host/path/',
  dingtalkAppId: 'YOUR_DINGTALK_APP_ID',
});

// 2. 用户明确同意《隐私协议》后:无参 init 才跨入 native/vendor
await Common.init();

// 3. 只有成功才 resolve;取消 / 失败都在 catch 中处理
try {
  const result = await Share.openSheet(
    {
      type: 'link',
      title: '标题',
      url: 'https://example.com',
    },
    { presentation: 'floating' }
  );
  // result.code === 'success'
} catch (error) {
  if (error instanceof UmengError && error.code === 'E_USER_CANCEL') {
    // 用户取消,通常静默
  }
}

iOS 启用微信时 wechatAppIdwechatAppSecret、绝对 HTTPS wechatUniversalLink 三项必须同时提供;Android 启用微信时前两项必须成组,Universal Link 可省略。初始化开始后更换 config 会 reject E_INVALID_OPTIONS;没先 preInit 直接 init 会 reject E_NOT_INITIALIZED

文档

平台与验证边界

| 平台 | 当前证据 | 仍需验证 | | ------------ | ------------------------------------------------------------------------- | ---------------------------------------------------- | | iOS | native contract、simulator build、31/31 XCTest、三个 TurboModule provider | 真机微信 / 钉钉分享、URL Scheme、Universal Link/AASA | | Android | native contract、JVM tests、minified release build、merged manifest | 真机微信 / 钉钉回跳、真机 R8 运行 | | Web / 模拟器 | JS、文档站和 native 单测可运行 | 不能代替第三方 App 真分享 |

License

MIT