Skip to content

Commit 4d2016c

Browse files
authored
Merge branch 'develop' into lms/feat-browser-standalong-lcp-spans
2 parents a204305 + 56c9fcb commit 4d2016c

File tree

483 files changed

+12726
-1530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

483 files changed

+12726
-1530
lines changed

.claude/settings.local.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(ls:*)",
6+
"Bash(git:*)",
7+
"Bash(yarn:*)",
8+
"WebFetch(domain:github.com)",
9+
"Bash(grep:*)",
10+
"Bash(mv:*)"
11+
],
12+
"deny": []
13+
}
14+
}

.cursor/rules/publishing_release.mdc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
description: Use this rule if you are looking to publish a release for the Sentry JavaScript SDKs
3+
globs:
4+
alwaysApply: false
5+
---
6+
7+
# Publishing a Release
8+
9+
Use these guidelines when publishing a new Sentry JavaScript SDK release.
10+
11+
## Standard Release Process (from develop to master)
12+
13+
The release process is outlined in [publishing-a-release.md](mdc:docs/publishing-a-release.md).
14+
15+
1. Make sure you are on the latest version of the `develop` branch. To confirm this, run `git pull origin develop` to get the latest changes from the repo.
16+
2. Run `yarn changelog` on the `develop` branch and copy the output. You can use `yarn changelog | pbcopy` to copy the output of `yarn changelog` into your clipboard.
17+
3. Decide on a version for the release based on [semver](mdc:https://semver.org). The version should be decided based on what is in included in the release. For example, if the release includes a new feature, we should increment the minor version. If it includes only bug fixes, we should increment the patch version.
18+
4. Create a branch `prepare-release/VERSION`, eg. `prepare-release/8.1.0`, off `develop`.
19+
5. Update [CHANGELOG.md](mdc:CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release from the output of `yarn changelog`. See the `Updating the Changelog` section in [publishing-a-release.md](mdc:docs/publishing-a-release.md) for more details. If you remove changelog entries because they are not applicable, please let the user know.
20+
6. Commit the changes to [CHANGELOG.md](mdc:CHANGELOG.md) with `meta(changelog): Update changelog for VERSION` where `VERSION` is the version of the release, e.g. `meta(changelog): Update changelog for 8.1.0`
21+
7. Push the `prepare-release/VERSION` branch to origin and remind the user that the release PR needs to be opened from the `master` branch.
22+
23+
## Key Commands
24+
25+
- `yarn changelog` - Generate changelog entries
26+
- `yarn lint` - Ensure code quality
27+
- `yarn test` - Run test suite
28+
- `yarn build:dev` - Verify build
29+
30+
## Important Notes
31+
32+
- This repository uses **Git Flow** - target `develop` for feature PRs, not `master`. See [gitflow.md](mdc:docs/gitflow.md) for more details.
33+
- For first-time SDK releases, follow the New SDK Release Checklist [new-sdk-release-checklist.md](mdc:docs/new-sdk-release-checklist.md). If you notice there is something not following the new SDK release checklist, please remind the user.
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
description: Use this rule if you are looking to upgrade a dependency in the Sentry JavaScript SDKs
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Yarn v1 Dependency Upgrades
7+
8+
## Upgrade Process
9+
10+
### Dependency Analysis
11+
12+
```bash
13+
# Check dependency tree
14+
yarn list --depth=0
15+
16+
# Find why package is installed
17+
yarn why [package-name]
18+
```
19+
20+
### Root Workspace vs. Package Dependencies
21+
22+
**CRITICAL**: Understand the difference between dependency types:
23+
24+
- **Root Workspace dependencies**: Shared dev tools, build tools, testing frameworks
25+
- **Package dependencies**: Package-specific runtime and dev dependencies
26+
- Always check if dependency should be in root workspace or package level
27+
28+
### Upgrade Dependencies
29+
30+
**MANDATORY**: Only ever upgrade a single package at a time.
31+
32+
**CRITICAL RULE**: If a dependency is not defined in `package.json` anywhere, the upgrade must be run in the root workspace as the `yarn.lock` file is contained there.
33+
34+
```bash
35+
# Upgrade specific package to latest compatible version
36+
npx yarn-update-dependency@latest [package-name]
37+
```
38+
39+
Avoid upgrading top-level dependencies (defined in `package.json`), especially if they are used for tests. If you are going to upgrade them, ask the user before proceeding.
40+
41+
**REQUIREMENT**: If a `package.json` file is updated, make sure it has a new line at the end.
42+
43+
#### CRITICAL: OpenTelemetry Dependency Constraint
44+
45+
**STOP UPGRADE IMMEDIATELY** if upgrading any dependency with `opentelemetry` in the name and the new version or any of its dependencies uses forbidden OpenTelemetry versions.
46+
47+
**FORBIDDEN VERSION PATTERNS:**
48+
- `2.x.x` versions (e.g., `2.0.0`, `2.1.0`)
49+
- `0.2xx.x` versions (e.g., `0.200.0`, `0.201.0`)
50+
51+
When upgrading OpenTelemetry dependencies:
52+
1. Check the dependency's `package.json` after upgrade
53+
2. Verify the package itself doesn't use forbidden version patterns
54+
3. Verify none of its dependencies use `@opentelemetry/*` packages with forbidden version patterns
55+
4. **Example**: `@opentelemetry/instrumentation-pg@0.52.0` is forbidden because it bumped to core `2.0.0` and instrumentation `0.200.0`
56+
5. If forbidden OpenTelemetry versions are detected, **ABORT the upgrade** and notify the user that this upgrade cannot proceed due to OpenTelemetry v2+ compatibility constraints
57+
58+
#### CRITICAL: E2E Test Dependencies
59+
60+
**DO NOT UPGRADE** the major version of dependencies in test applications where the test name explicitly mentions a dependency version.
61+
62+
**RULE**: For `dev-packages/e2e-tests/test-applications/*`, if the test directory name mentions a specific version (e.g., `nestjs-8`), do not upgrade that dependency beyond the mentioned major version.
63+
64+
**Example**: Do not upgrade the nestjs version of `dev-packages/e2e-tests/test-applications/nestjs-8` to nestjs 9 or above because the test name mentions nestjs 8.
65+
66+
## Safety Protocols
67+
68+
### Pre-Upgrade Checklist
69+
70+
**COMPLETE ALL STEPS** before proceeding with any upgrade:
71+
72+
1. **Backup**: Ensure clean git state or create backup branch
73+
2. **CI Status**: Verify all tests are passing
74+
3. **Lockfile works**: Confirm `yarn.lock` is in a good state (no merge conflicts)
75+
4. **OpenTelemetry Check**: For OpenTelemetry dependencies, verify no forbidden version patterns (`2.x.x` or `0.2xx.x`) will be introduced
76+
77+
### Post-Upgrade Verification
78+
79+
```bash
80+
# rebuild everything
81+
yarn install
82+
83+
# Build the project
84+
yarn build:dev
85+
86+
# Make sure dependencies are deduplicated
87+
yarn dedupe-deps:fix
88+
89+
# Fix any linting issues
90+
yarn fix
91+
92+
# Check circular dependencies
93+
yarn circularDepCheck
94+
```
95+
96+
## Version Management
97+
98+
### Pinning Strategies
99+
100+
- **Exact versions** (`1.2.3`): Use for critical dependencies
101+
- **Caret versions** (`^1.2.3`): Allow minor updates only
102+
- **Latest tag**: Avoid as much as possible other than in certain testing and development scenarios
103+
104+
## Troubleshooting
105+
106+
- **Yarn Version**: Run `yarn --version` - must be yarn v1 (not v2/v3/v4)
107+
- **Lockfile Issues**: Verify yarn.lock exists and is properly maintained. Fix merge conflicts by running `yarn install`
108+
109+
## Best Practices
110+
111+
### Security Audits
112+
113+
```bash
114+
# Check for security vulnerabilities
115+
yarn audit
116+
117+
# Fix automatically fixable vulnerabilities
118+
yarn audit fix
119+
120+
# Install security patches only
121+
yarn upgrade --security-only
122+
```
123+
124+
### Check for Outdated Dependencies
125+
126+
```bash
127+
# Check all outdated dependencies
128+
yarn outdated
129+
130+
# Check specific package
131+
yarn outdated [package-name]
132+
133+
# Check dependencies in specific workspace
134+
yarn workspace [workspace-name] outdated
135+
```
136+
137+
### Using yarn info for Dependency Inspection
138+
139+
Use `yarn info` to inspect package dependencies before and after upgrades:
140+
141+
```bash
142+
# Check current version and dependencies
143+
yarn info <package-name>
144+
145+
# Check specific version dependencies
146+
yarn info <package-name>@<version>
147+
148+
# Check dependencies field specifically
149+
yarn info <package-name>@<version> dependencies
150+
151+
# Check all available versions
152+
yarn info <package-name> versions
153+
```
154+
155+
The `yarn info` command provides detailed dependency information without requiring installation, making it particularly useful for:
156+
- Verifying OpenTelemetry packages don't introduce forbidden version patterns (`2.x.x` or `0.2xx.x`)
157+
- Checking what dependencies a package will bring in before upgrading
158+
- Understanding package version history and compatibility
159+
160+
### Documentation
161+
162+
- Update README or code comments if dependency change affects usage of the SDK or its integrations
163+
- Notify team of significant changes

.cursor/rules/sdk_development.mdc

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
description: Guidelines for working on the Sentry JavaScript SDK monorepo
3+
alwaysApply: true
4+
---
5+
6+
# SDK Development Rules
7+
8+
You are working on the Sentry JavaScript SDK, a critical production SDK used by thousands of applications. Follow these rules strictly.
9+
10+
## Code Quality Requirements (MANDATORY)
11+
12+
**CRITICAL**: All changes must pass these checks before committing:
13+
14+
1. **Always run `yarn lint`** - Fix all linting issues
15+
2. **Always run `yarn test`** - Ensure all tests pass
16+
3. **Always run `yarn build:dev`** - Verify TypeScript compilation
17+
18+
## Development Commands
19+
20+
### Build Commands
21+
- `yarn build` - Full production build with package verification
22+
- `yarn build:dev` - Development build (transpile + types)
23+
- `yarn build:dev:watch` - Development build in watch mode (recommended)
24+
- `yarn build:dev:filter <package>` - Build specific package and dependencies
25+
- `yarn build:types:watch` - Watch mode for TypeScript types only
26+
- `yarn build:bundle` - Build browser bundles only
27+
28+
### Testing
29+
- `yarn test` - Run all tests (excludes integration tests)
30+
- `yarn test:unit` - Run unit tests only
31+
- `yarn test:pr` - Run tests affected by changes (CI mode)
32+
- `yarn test:pr:browser` - Run affected browser-specific tests
33+
- `yarn test:pr:node` - Run affected Node.js-specific tests
34+
35+
### Linting and Formatting
36+
- `yarn lint` - Run ESLint and Prettier checks
37+
- `yarn fix` - Auto-fix linting and formatting issues
38+
- `yarn lint:es-compatibility` - Check ES compatibility
39+
40+
## Git Flow Branching Strategy
41+
42+
This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for details.
43+
44+
### Key Rules
45+
- **All PRs target `develop` branch** (NOT `master`)
46+
- `master` represents the last released state
47+
- Never merge directly into `master` (except emergency fixes)
48+
- Avoid changing `package.json` files on `develop` during pending releases
49+
50+
### Branch Naming
51+
- Features: `feat/descriptive-name`
52+
- Releases: `release/X.Y.Z`
53+
54+
## Repository Architecture
55+
56+
This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
57+
58+
### Core Packages
59+
- `packages/core/` - Base SDK with interfaces, type definitions, core functionality
60+
- `packages/types/` - Shared TypeScript type definitions (active)
61+
- `packages/browser-utils/` - Browser-specific utilities and instrumentation
62+
63+
### Platform SDKs
64+
- `packages/browser/` - Browser SDK with bundled variants
65+
- `packages/node/` - Node.js SDK with server-side integrations
66+
- `packages/bun/`, `packages/deno/`, `packages/cloudflare/` - Runtime-specific SDKs
67+
68+
### Framework Integrations
69+
- Framework packages: `packages/{framework}/` (react, vue, angular, etc.)
70+
- Client/server entry points where applicable (nextjs, nuxt, sveltekit)
71+
- Integration tests use Playwright (Remix, browser-integration-tests)
72+
73+
### User Experience Packages
74+
- `packages/replay-internal/` - Session replay functionality
75+
- `packages/replay-canvas/` - Canvas recording for replay
76+
- `packages/replay-worker/` - Web worker support for replay
77+
- `packages/feedback/` - User feedback integration
78+
79+
### Development Packages (`dev-packages/`)
80+
- `browser-integration-tests/` - Playwright browser tests
81+
- `e2e-tests/` - End-to-end tests for 70+ framework combinations
82+
- `node-integration-tests/` - Node.js integration tests
83+
- `test-utils/` - Shared testing utilities
84+
- `bundle-analyzer-scenarios/` - Bundle analysis
85+
- `rollup-utils/` - Build utilities
86+
- GitHub Actions packages for CI/CD automation
87+
88+
## Development Guidelines
89+
90+
### Build System
91+
- Uses Rollup for bundling (`rollup.*.config.mjs`)
92+
- TypeScript with multiple tsconfig files per package
93+
- Lerna manages package dependencies and publishing
94+
- Vite for testing with `vitest`
95+
96+
### Package Structure Pattern
97+
Each package typically contains:
98+
- `src/index.ts` - Main entry point
99+
- `src/sdk.ts` - SDK initialization logic
100+
- `rollup.npm.config.mjs` - Build configuration
101+
- `tsconfig.json`, `tsconfig.test.json`, `tsconfig.types.json`
102+
- `test/` directory with corresponding test files
103+
104+
### Key Development Notes
105+
- Uses Volta for Node.js/Yarn version management
106+
- Requires initial `yarn build` after `yarn install` for TypeScript linking
107+
- Integration tests use Playwright extensively
108+
- Native profiling requires Python <3.12 for binary builds
109+
110+
## Testing Single Packages
111+
- Test specific package: `cd packages/{package-name} && yarn test`
112+
- Build specific package: `yarn build:dev:filter @sentry/{package-name}`
113+
114+
## Code Style Rules
115+
- Follow existing code conventions in each package
116+
- Check imports and dependencies - only use libraries already in the codebase
117+
- Look at neighboring files for patterns and style
118+
- Never introduce code that exposes secrets or keys
119+
- Follow security best practices
120+
121+
## Before Every Commit Checklist
122+
1. ✅ `yarn lint` (fix all issues)
123+
2. ✅ `yarn test` (all tests pass)
124+
3. ✅ `yarn build:dev` (builds successfully)
125+
4. ✅ Target `develop` branch for PRs (not `master`)
126+
127+
## Documentation Sync
128+
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- '@sentry/node - koa'
3838
- '@sentry/node - hapi'
3939
- '@sentry/node - connect'
40+
- '@sentry/node-native'
4041
- '@sentry/angular'
4142
- '@sentry/astro'
4243
- '@sentry/aws-serverless'
@@ -50,6 +51,7 @@ body:
5051
- '@sentry/nestjs'
5152
- '@sentry/nextjs'
5253
- '@sentry/nuxt'
54+
- '@sentry/pino-transport'
5355
- '@sentry/react'
5456
- '@sentry/react-router'
5557
- '@sentry/remix'

0 commit comments

Comments
 (0)