sentry-miniapp 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -1,22 +1,35 @@
1
1
  # Sentry Miniapp SDK — Mini Program Monitoring SDK
2
2
 
3
- ![npm version](https://img.shields.io/npm/v/sentry-miniapp)
4
- ![npm downloads/month](https://img.shields.io/npm/dm/sentry-miniapp)
5
- ![github forks](https://img.shields.io/github/forks/lizhiyao/sentry-miniapp?style=social)
6
- ![github stars](https://img.shields.io/github/stars/lizhiyao/sentry-miniapp?style=social)
3
+ [![npm version](https://img.shields.io/npm/v/sentry-miniapp)](https://www.npmjs.com/package/sentry-miniapp)
4
+ [![npm downloads/month](https://img.shields.io/npm/dm/sentry-miniapp)](https://www.npmjs.com/package/sentry-miniapp)
5
+ [![github forks](https://img.shields.io/github/forks/lizhiyao/sentry-miniapp?style=social)](https://github.com/lizhiyao/sentry-miniapp/network/members)
6
+ [![github stars](https://img.shields.io/github/stars/lizhiyao/sentry-miniapp?style=social)](https://github.com/lizhiyao/sentry-miniapp/stargazers)
7
7
  ![test coverage](https://img.shields.io/badge/test%20coverage-100%25-brightgreen.svg)
8
- ![license](https://img.shields.io/github/license/lizhiyao/sentry-miniapp)
8
+ [![license](https://img.shields.io/github/license/lizhiyao/sentry-miniapp)](./LICENSE)
9
9
 
10
10
  [简体中文](./README.md) | English
11
11
 
12
- A **mini program monitoring SDK** built on `@sentry/core` (v10.45.0), providing **error monitoring**, **performance monitoring**, offline caching, and distributed tracing. Supports WeChat, Alipay, ByteDance, Baidu, QQ, DingTalk, Kuaishou mini programs and cross-platform frameworks (Taro / uni-app).
12
+ A **mini program monitoring SDK** built on `@sentry/core`, providing **error monitoring**, **performance monitoring**, offline caching, and distributed tracing. Supports WeChat, Alipay, ByteDance, Baidu, QQ, DingTalk, Kuaishou mini programs and cross-platform frameworks (Taro / uni-app).
13
13
 
14
14
  > **What are Mini Programs?** Mini programs (小程序) are lightweight apps that run inside super-apps like WeChat, Alipay, and ByteDance/Douyin. They form a massive ecosystem in China with **hundreds of millions of daily active users**, but have no direct equivalent in the Western tech stack. Think of them as a hybrid between PWAs and native apps, but hosted within a platform's sandbox.
15
15
 
16
- > **Version Notes**
17
- >
18
- > - `v1.x.x`: New architecture based on Sentry V10 core. Full support for WeChat, Alipay, ByteDance, Baidu, QQ, DingTalk, Kuaishou mini programs and cross-platform frameworks (Taro / uni-app).
19
- > - `v0.x.x`: Legacy version, no longer maintained.
16
+ > **📰 Featured Article (Chinese)**: [《我把 Sentry 接进了 7 端小程序:从异常捕获、Breadcrumb 到 Source Map 定位》](https://juejin.cn/post/7621871037853843465) — multi-platform integration, Breadcrumb context, offline buffering, and Source Map workflow walked through end-to-end. If you find this project useful, please consider giving it a ⭐ Star.
17
+
18
+ <details>
19
+ <summary><b>🆕 What's New: v1.3 v1.8 (click to expand)</b></summary>
20
+
21
+ | Version | Highlights |
22
+ |---|---|
23
+ | **v1.8.0** | AI-assisted integration skill — auto onboarding via Claude Code / Cursor |
24
+ | **v1.7.0** | New `tracesSampler` for dynamic sampling; complete Source Map configuration guide |
25
+ | **v1.6.0** | 13 enhancements + 16 fixes; enabled esbuild minification — bundle size reduced by ~**59%** |
26
+ | **v1.5.0** | Performance enhancements (configurable thresholds / slow `setData` detection / memory sampling); new page lifecycle, user interaction, and Console breadcrumbs; route integration covers all platforms |
27
+ | **v1.4.0** | `NetworkBreadcrumbs` captures Request / Response body; configurable offline cache limit; deprecated `showReportDialog` in favor of `captureFeedback` |
28
+ | **v1.3.0** | 🎯 Build pipeline rewrite (Vite + bundle-inline): **zero external deps**, fully resolves the `miniprogram_npm` module-resolution issue; 🎯 built-in Source Map path normalization across all platforms |
29
+
30
+ See [CHANGELOG.md](./CHANGELOG.md) for full details.
31
+
32
+ </details>
20
33
 
21
34
  ---
22
35
 
@@ -167,13 +180,15 @@ Sentry.addBreadcrumb({
167
180
  ### Custom Performance Measurement
168
181
 
169
182
  ```javascript
170
- // Mark start point
171
- Sentry.addPerformanceMark('api-request-start');
172
- // ... perform operation
173
- Sentry.addPerformanceMark('api-request-end');
174
-
175
- // Measure the interval
176
- Sentry.measurePerformance('fetch-user-data', 'api-request-start', 'api-request-end');
183
+ await Sentry.startSpan(
184
+ {
185
+ name: 'fetch-user-data',
186
+ op: 'http.client',
187
+ },
188
+ async () => {
189
+ await fetchUserData();
190
+ },
191
+ );
177
192
  ```
178
193
 
179
194
  ### Dynamic Sampling (tracesSampler)
package/README.md CHANGED
@@ -1,20 +1,33 @@
1
1
  # Sentry Miniapp SDK — 小程序监控 SDK
2
2
 
3
- ![npm version](https://img.shields.io/npm/v/sentry-miniapp)
4
- ![npm download](https://img.shields.io/npm/dm/sentry-miniapp)
5
- ![github forks](https://img.shields.io/github/forks/lizhiyao/sentry-miniapp?style=social)
6
- ![github stars](https://img.shields.io/github/stars/lizhiyao/sentry-miniapp?style=social)
3
+ [![npm version](https://img.shields.io/npm/v/sentry-miniapp)](https://www.npmjs.com/package/sentry-miniapp)
4
+ [![npm download](https://img.shields.io/npm/dm/sentry-miniapp)](https://www.npmjs.com/package/sentry-miniapp)
5
+ [![github forks](https://img.shields.io/github/forks/lizhiyao/sentry-miniapp?style=social)](https://github.com/lizhiyao/sentry-miniapp/network/members)
6
+ [![github stars](https://img.shields.io/github/stars/lizhiyao/sentry-miniapp?style=social)](https://github.com/lizhiyao/sentry-miniapp/stargazers)
7
7
  ![test coverage](https://img.shields.io/badge/test%20coverage-100%25-brightgreen.svg)
8
- ![license](https://img.shields.io/github/license/lizhiyao/sentry-miniapp)
8
+ [![license](https://img.shields.io/github/license/lizhiyao/sentry-miniapp)](./LICENSE)
9
9
 
10
10
  简体中文 | [English](./README.en.md)
11
11
 
12
- 一个基于 `@sentry/core` (v10.45.0) 核心构建的**小程序监控 SDK**,提供**异常监控**、**性能监控**、离线缓存、分布式追踪等能力。支持微信、支付宝、字节跳动、百度、QQ、钉钉、快手等多端小程序及 Taro / uni-app 等跨端框架。
12
+ 一个基于 `@sentry/core` 核心构建的**小程序监控 SDK**,提供**异常监控**、**性能监控**、离线缓存、分布式追踪等能力。支持微信、支付宝、字节跳动、百度、QQ、钉钉、快手等多端小程序及 Taro / uni-app 等跨端框架。
13
13
 
14
- > **💡 版本说明**
15
- >
16
- > - `v1.x.x`:全新架构,基于 Sentry V10 核心,全面支持微信、支付宝、字节跳动、百度、QQ、钉钉、快手等多端小程序及主流跨端框架(Taro / uni-app 等)。
17
- > - `v0.x.x`:旧版本,已停止维护。
14
+ > **📰 最新文章**:[《我把 Sentry 接进了 7 端小程序:从异常捕获、Breadcrumb 到 Source Map 定位》](https://juejin.cn/post/7621871037853843465) — 多端统一接入、Breadcrumb 上下文、弱网兜底、Source Map 实战,一篇串完整套方案。觉得有用请帮忙点个 ⭐ Star,让更多小程序团队找到它。
15
+
16
+ <details>
17
+ <summary><b>🆕 v1.3 → v1.8 What's New(点击展开)</b></summary>
18
+
19
+ | 版本 | 亮点 |
20
+ |---|---|
21
+ | **v1.8.0** | AI 辅助接入 skill — Claude Code / Cursor 自动引导集成 |
22
+ | **v1.7.0** | 新增 `tracesSampler` 动态采样;新增 Source Map 完整配置指南 |
23
+ | **v1.6.0** | 13 项功能优化 + 16 项问题修复;启用 esbuild 压缩,包体积减少约 **59%** |
24
+ | **v1.5.0** | Performance 增强(可配阈值 / setData 慢渲染检测 / 内存采集);新增页面生命周期、用户交互、Console 三类 Breadcrumb;Route 集成全平台适配 |
25
+ | **v1.4.0** | NetworkBreadcrumbs 抓 Request / Response Body;离线缓存上限可配;废弃 `showReportDialog` 引导至 `captureFeedback` |
26
+ | **v1.3.0** | 🎯 重构构建(迁移 Vite + bundle-inline):对外**零依赖**,彻底修掉「`miniprogram_npm` 模块解析」问题;🎯 内置 Source Map 路径自动抹平,跨端堆栈统一映射 |
27
+
28
+ 完整变更见 [CHANGELOG.md](./CHANGELOG.md)。
29
+
30
+ </details>
18
31
 
19
32
  ---
20
33
 
@@ -168,13 +181,15 @@ Sentry.addBreadcrumb({
168
181
  ### 自定义性能测速 (Performance)
169
182
 
170
183
  ```javascript
171
- // 标记起始点
172
- Sentry.addPerformanceMark('api-request-start');
173
- // ... 执行耗时操作
174
- Sentry.addPerformanceMark('api-request-end');
175
-
176
- // 测量并记录该区间
177
- Sentry.measurePerformance('fetch-user-data', 'api-request-start', 'api-request-end');
184
+ await Sentry.startSpan(
185
+ {
186
+ name: 'fetch-user-data',
187
+ op: 'http.client',
188
+ },
189
+ async () => {
190
+ await fetchUserData();
191
+ },
192
+ );
178
193
  ```
179
194
 
180
195
  ### 动态采样 (tracesSampler)