Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1ef7807
feat(deps): Bump @prisma/instrumentation from 6.8.2 to 6.9.0 (#16608)
dependabot[bot] Jun 16, 2025
d302703
test(deps): Bump next from 14.1.3 to 14.2.30 in /dev-packages/e2e-tes…
dependabot[bot] Jun 17, 2025
cb5265c
ref(node): Improve span flushing (#16577)
mydea Jun 17, 2025
772655e
Merge branch 'develop' into manual-develop-sync
chargome Jun 17, 2025
f2dd0dc
Merge pull request #16616 from getsentry/manual-develop-sync
chargome Jun 17, 2025
23127b6
chore(browser): Update comment for fetch transport (#16617)
mydea Jun 17, 2025
98ee4cc
feat(flags): capture feature flag evaluations on spans (#16485)
aliu39 Jun 17, 2025
468fc8c
feat(flags): add node support for generic featureFlagsIntegration and…
aliu39 Jun 17, 2025
049d0d9
feat(core): Allow to pass `scope` & `client` to `getTraceData` (#16633)
mydea Jun 18, 2025
784869d
fix(nextjs): Fix lookup of `instrumentation-client.js` file (#16637)
mydea Jun 18, 2025
8f9b9df
test(node): Unflake feature flag test (#16636)
mydea Jun 18, 2025
474a64c
test(browser): Add test showing behavior of capturing built-in class …
mydea Jun 18, 2025
a34ad66
ref(node): Add `renameAttributeKey` helper to Vercel AI integration (…
AbhiPrasad Jun 18, 2025
ceb003c
ref(core): Remove `utils-hoist` folder (#16639)
mydea Jun 18, 2025
57256ad
feat(nextjs): Add option for auto-generated random tunnel route (#16626)
chargome Jun 18, 2025
b94f652
ci: Ensure CI uses correct node version & bump pnpm to latest v9 (#16…
mydea Jun 18, 2025
664461a
feat: Add CLAUDE.md for Claude Code development guidance (#16660)
HazAT Jun 19, 2025
819d00e
fix(google-cloud-serverless): Make `CloudEvent` type compatible (#16661)
AbhiPrasad Jun 20, 2025
4396196
fix(browser): Remove usage of Array.at() method (#16647)
AbhiPrasad Jun 20, 2025
c5613eb
fix(core): Improve `safeJoin` usage in console logging integration (#…
AbhiPrasad Jun 20, 2025
0439058
chore: Add cursor rule for publishing a release (#16662)
AbhiPrasad Jun 20, 2025
4bbe610
feat(pino): Add initial package for `@sentry/pino-transport` (#16652)
AbhiPrasad Jun 20, 2025
797ebd1
fix: Wait for the correct clientWidth/clientHeight when showing Feedb…
ryan953 Jun 20, 2025
71e4037
deps: Update all bundler plugin instances to latest & allow caret ran…
mydea Jun 23, 2025
f0cad82
deps: Remove unused `@sentry/opentelemetry` dependency (#16677)
mydea Jun 23, 2025
d8f12c2
fix(node): Ensure graphql errors result in errored spans (#16678)
mydea Jun 23, 2025
58337ea
meta(changelog): Update changelog for 9.31.0
andreiborza Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"permissions": {
"allow": [
"Bash(find:*)",
"Bash(ls:*)",
"Bash(git:*)",
"Bash(yarn:*)",
"WebFetch(domain:github.com)",
"Bash(grep:*)",
"Bash(mv:*)"
],
"deny": []
}
}
32 changes: 32 additions & 0 deletions .cursor/rules/publishing_release.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
description: Use this rule if you are looking to publish a release for the Sentry JavaScript SDKs
globs:
alwaysApply: false
---
# Publishing a Release

Use these guidelines when publishing a new Sentry JavaScript SDK release.

## Standard Release Process (from develop to master)

The release process is outlined in [publishing-a-release.md](mdc:docs/publishing-a-release.md).

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.
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.
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.
4. Create a branch `prepare-release/VERSION`, eg. `prepare-release/8.1.0`, off `develop`.
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.
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`
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.

## Key Commands

- `yarn changelog` - Generate changelog entries
- `yarn lint` - Ensure code quality
- `yarn test` - Run test suite
- `yarn build:dev` - Verify build

## Important Notes

- This repository uses **Git Flow** - target `develop` for feature PRs, not `master`. See [gitflow.md](mdc:docs/gitflow.md) for more details.
- 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.
128 changes: 128 additions & 0 deletions .cursor/rules/sdk_development.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
description: Guidelines for working on the Sentry JavaScript SDK monorepo
alwaysApply: true
---

# SDK Development Rules

You are working on the Sentry JavaScript SDK, a critical production SDK used by thousands of applications. Follow these rules strictly.

## Code Quality Requirements (MANDATORY)

**CRITICAL**: All changes must pass these checks before committing:

1. **Always run `yarn lint`** - Fix all linting issues
2. **Always run `yarn test`** - Ensure all tests pass
3. **Always run `yarn build:dev`** - Verify TypeScript compilation

## Development Commands

### Build Commands
- `yarn build` - Full production build with package verification
- `yarn build:dev` - Development build (transpile + types)
- `yarn build:dev:watch` - Development build in watch mode (recommended)
- `yarn build:dev:filter <package>` - Build specific package and dependencies
- `yarn build:types:watch` - Watch mode for TypeScript types only
- `yarn build:bundle` - Build browser bundles only

### Testing
- `yarn test` - Run all tests (excludes integration tests)
- `yarn test:unit` - Run unit tests only
- `yarn test:pr` - Run tests affected by changes (CI mode)
- `yarn test:pr:browser` - Run affected browser-specific tests
- `yarn test:pr:node` - Run affected Node.js-specific tests

### Linting and Formatting
- `yarn lint` - Run ESLint and Prettier checks
- `yarn fix` - Auto-fix linting and formatting issues
- `yarn lint:es-compatibility` - Check ES compatibility

## Git Flow Branching Strategy

This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for details.

### Key Rules
- **All PRs target `develop` branch** (NOT `master`)
- `master` represents the last released state
- Never merge directly into `master` (except emergency fixes)
- Avoid changing `package.json` files on `develop` during pending releases

### Branch Naming
- Features: `feat/descriptive-name`
- Releases: `release/X.Y.Z`

## Repository Architecture

This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.

### Core Packages
- `packages/core/` - Base SDK with interfaces, type definitions, core functionality
- `packages/types/` - Shared TypeScript type definitions (active)
- `packages/browser-utils/` - Browser-specific utilities and instrumentation

### Platform SDKs
- `packages/browser/` - Browser SDK with bundled variants
- `packages/node/` - Node.js SDK with server-side integrations
- `packages/bun/`, `packages/deno/`, `packages/cloudflare/` - Runtime-specific SDKs

### Framework Integrations
- Framework packages: `packages/{framework}/` (react, vue, angular, etc.)
- Client/server entry points where applicable (nextjs, nuxt, sveltekit)
- Integration tests use Playwright (Remix, browser-integration-tests)

### User Experience Packages
- `packages/replay-internal/` - Session replay functionality
- `packages/replay-canvas/` - Canvas recording for replay
- `packages/replay-worker/` - Web worker support for replay
- `packages/feedback/` - User feedback integration

### Development Packages (`dev-packages/`)
- `browser-integration-tests/` - Playwright browser tests
- `e2e-tests/` - End-to-end tests for 70+ framework combinations
- `node-integration-tests/` - Node.js integration tests
- `test-utils/` - Shared testing utilities
- `bundle-analyzer-scenarios/` - Bundle analysis
- `rollup-utils/` - Build utilities
- GitHub Actions packages for CI/CD automation

## Development Guidelines

### Build System
- Uses Rollup for bundling (`rollup.*.config.mjs`)
- TypeScript with multiple tsconfig files per package
- Lerna manages package dependencies and publishing
- Vite for testing with `vitest`

### Package Structure Pattern
Each package typically contains:
- `src/index.ts` - Main entry point
- `src/sdk.ts` - SDK initialization logic
- `rollup.npm.config.mjs` - Build configuration
- `tsconfig.json`, `tsconfig.test.json`, `tsconfig.types.json`
- `test/` directory with corresponding test files

### Key Development Notes
- Uses Volta for Node.js/Yarn version management
- Requires initial `yarn build` after `yarn install` for TypeScript linking
- Integration tests use Playwright extensively
- Native profiling requires Python <3.12 for binary builds

## Testing Single Packages
- Test specific package: `cd packages/{package-name} && yarn test`
- Build specific package: `yarn build:dev:filter @sentry/{package-name}`

## Code Style Rules
- Follow existing code conventions in each package
- Check imports and dependencies - only use libraries already in the codebase
- Look at neighboring files for patterns and style
- Never introduce code that exposes secrets or keys
- Follow security best practices

## Before Every Commit Checklist
1. ✅ `yarn lint` (fix all issues)
2. ✅ `yarn test` (all tests pass)
3. ✅ `yarn build:dev` (builds successfully)
4. ✅ Target `develop` branch for PRs (not `master`)

## Documentation Sync
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ body:
- '@sentry/nestjs'
- '@sentry/nextjs'
- '@sentry/nuxt'
- '@sentry/pino-transport'
- '@sentry/react'
- '@sentry/react-router'
- '@sentry/remix'
Expand Down
21 changes: 5 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,6 @@ jobs:
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand All @@ -442,8 +440,6 @@ jobs:
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -475,7 +471,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 22, '^24.0.1']
node: [18, 20, 22, 24]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -885,18 +881,11 @@ jobs:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@v4
with:
version: 9.4.0
# TODO: Remove this once the repo is bumped to 20.19.2 or higher
- name: Set up Node for Angular 20
if: matrix.test-application == 'angular-20'
uses: actions/setup-node@v4
with:
node-version: '20.19.2'
version: 9.15.9
- name: Set up Node
if: matrix.test-application != 'angular-20'
uses: actions/setup-node@v4
with:
node-version-file: 'dev-packages/e2e-tests/package.json'
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if: matrix.test-application == 'node-exports-test-app'
uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -1012,11 +1001,11 @@ jobs:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@v4
with:
version: 9.4.0
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'dev-packages/e2e-tests/package.json'
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,12 @@ jobs:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@v4
with:
version: 9.4.0
# TODO: Remove this once the repo is bumped to 20.19.2 or higher
- name: Set up Node for Angular 20
if: matrix.test-application == 'angular-20'
uses: actions/setup-node@v4
with:
node-version: '20.19.2'
version: 9.15.9
- name: Set up Node
if: matrix.test-application != 'angular-20'
uses: actions/setup-node@v4
with:
node-version-file: 'dev-packages/e2e-tests/package.json'
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'

- name: Restore canary cache
uses: actions/cache/restore@v4
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 9.31.0

### Important Changes

- feat(nextjs): Add option for auto-generated random tunnel route ([#16626](https://github.com/getsentry/sentry-javascript/pull/16626))

Adds an option to automatically generate a random tunnel route for the Next.js SDK. This helps prevent ad blockers and other tools from blocking Sentry requests by using a randomized path instead of the predictable `/monitoring` endpoint.

- feat(core): Allow to pass `scope` & `client` to `getTraceData` ([#16633](https://github.com/getsentry/sentry-javascript/pull/16633))

Adds the ability to pass custom `scope` and `client` parameters to the `getTraceData` function, providing more flexibility when generating trace data for distributed tracing.

### Other Changes

- deps: Remove unused `@sentry/opentelemetry` dependency ([#16677](https://github.com/getsentry/sentry-javascript/pull/16677))
- deps: Update all bundler plugin instances to latest & allow caret ranges ([#16641](https://github.com/getsentry/sentry-javascript/pull/16641))
- feat(deps): Bump @prisma/instrumentation from 6.8.2 to 6.9.0 ([#16608](https://github.com/getsentry/sentry-javascript/pull/16608))
- feat(flags): add node support for generic featureFlagsIntegration and move utils to core ([#16585](https://github.com/getsentry/sentry-javascript/pull/16585))
- feat(flags): capture feature flag evaluations on spans ([#16485](https://github.com/getsentry/sentry-javascript/pull/16485))
- feat(pino): Add initial package for `@sentry/pino-transport` ([#16652](https://github.com/getsentry/sentry-javascript/pull/16652))
- fix: Wait for the correct clientWidth/clientHeight when showing Feedback Screenshot previews ([#16648](https://github.com/getsentry/sentry-javascript/pull/16648))
- fix(browser): Remove usage of Array.at() method ([#16647](https://github.com/getsentry/sentry-javascript/pull/16647))
- fix(core): Improve `safeJoin` usage in console logging integration ([#16658](https://github.com/getsentry/sentry-javascript/pull/16658))
- fix(google-cloud-serverless): Make `CloudEvent` type compatible ([#16661](https://github.com/getsentry/sentry-javascript/pull/16661))
- fix(nextjs): Fix lookup of `instrumentation-client.js` file ([#16637](https://github.com/getsentry/sentry-javascript/pull/16637))
- fix(node): Ensure graphql errors result in errored spans ([#16678](https://github.com/getsentry/sentry-javascript/pull/16678))

## 9.30.0

- feat(nextjs): Add URL to tags of server components and generation functions issues ([#16500](https://github.com/getsentry/sentry-javascript/pull/16500))
Expand Down
Loading
Loading