Add `@sentry/conventions` dependency and use its constants for registered keys
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 53/100
- Issue 類型
- 重構
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react-native, typescript
研究方向
Start with packages/core/package.json and the internal entry points src/js/tracing/ops.ts and src/js/tracing/semanticAttributes.ts, then inspect the listed files containing the keys. Check the installed @sentry/conventions version to confirm its exported constant names, and read packages/core/AGENTS.md for the dependency approval rule. Done when registered keys use the conventions constants, the documentation rules are updated, and the listed build, dependency, API report, and TypeScript compatibility checks pass.
由索引模型根據 Issue 內容生成。
描述
The SDK hardcodes attribute keys and span ops as strings. For keys that Sentry Conventions already registers, use the constants from @sentry/conventions instead. Nothing changes on the wire.
Dependency
- Add
@sentry/conventionstodependenciesinpackages/core/package.json. - Use the same range as
@sentry/core(^0.16.0today). On 0.x a caret only allows patch updates, so a different range ships a second copy. @sentry/corealready loads@sentry/conventions/attributesat runtime, so the module is already in app bundles./opadds about 11 KB unminified.- Import only through the subpaths
@sentry/conventions/attributesand@sentry/conventions/op. The package ships root-levelattributes.jsandop.jsfiles, so this also works with older Metro versions that ignoreexports. - From now on, bump it together with each
@sentry/*JS bump.
Keys to swap
| Today | Constant |
|---|---|
ops navigation, ui.action, http.client |
NAVIGATION, UI_ACTION, HTTP_CLIENT |
ops app.update.check, app.update.download |
APP_UPDATE_CHECK, APP_UPDATE_DOWNLOAD |
app.vitals.start.type, app.vitals.start.screen |
APP_VITALS_START_TYPE, APP_VITALS_START_SCREEN |
sentry.origin, sentry.release, sentry.replay_id |
SENTRY_* |
log attributes device.brand, device.family, device.model, os.name, os.version |
DEVICE_*, OS_* |
thread.id, thread.name, http.query |
THREAD_*, HTTP_QUERY |
Docs
Add a rule to packages/core/AGENTS.md and the code-guidelines skill: attribute keys and ops come from @sentry/conventions, and a new key needs a Sentry Conventions PR merged first.
Acceptance criteria
- Existing tests pass unchanged.
yarn buildpasses from a clean state.yarn circularDepCheckpasses.yarn api-report:checkshows no change.- The TS 3.8 compat job stays green.
Agent notes
- Keep
src/js/tracing/ops.tsandsrc/js/tracing/semanticAttributes.tsas the internal entry points, re-exporting from conventions, so imports elsewhere don't change. Neither file is in the public API report. - Where the keys are:
- Ops:
tracing/ops.ts,tracing/onSpanEndUtils.ts,integrations/expoupdateslistener.ts. - Log attributes:
integrations/logEnricherIntegration.ts. - Thread keys:
tracing/span.ts,profiling/uiProfilingIntegration.ts. http.query:integrations/devicecontext.ts.
- Ops:
- In 0.33 the op exports are named without a suffix (
NAVIGATION,HTTP_CLIENT). The 0.16 package uses*_SPAN_OPnames, so check which version is installed after the range bump. - Adding a dependency needs maintainer approval (AGENTS.md: Ask first).
- 主要語言
- TypeScript
- 星號
- 1.8k
- 分支
- 371
- 平均合併
- 22 小時 3 分鐘
- 30 天內合併 PR
- 106
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-react-native 的其他 Issue
-
React-Native
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-react-native#7073 · 1 則留言 ·
維護者通常 1 天內回覆
-
Improvement React-Native
難度 2/5 1-3 小時 新手友好度 80/100
getsentry/sentry-react-native#7055 · 1 則留言 ·
維護者通常 1 天內回覆
-
React-Native Replays Task
難度 2/5 1-3 小時 新手友好度 88/100
getsentry/sentry-react-native#6680 · 1 則留言 ·
維護者通常 1 天內回覆
-
Improvement React-Native
難度 2/5 1-3 小時 新手友好度 68/100
getsentry/sentry-react-native#6143 · 2 則留言 ·
維護者通常 1 天內回覆
-
React-Native Task User Feedbacks
難度 2/5 1-3 小時 新手友好度 84/100
getsentry/sentry-react-native#5932 · 2 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-react-native 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
danielmiessler/LifeOS#3028 ·
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)未關閉
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 90/100
Koenkk/zigbee2mqtt#33855 ·
維護者通常 1 天內回覆