Skip to content

Commit

Permalink
Merge branch 'develop' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Oct 21, 2024
2 parents 8647499 + 7e39d04 commit fe37c12
Show file tree
Hide file tree
Showing 63 changed files with 443 additions and 217 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
'examples/**',
'test/manual/**',
'types/**',
'scripts/*.js',
],
reportUnusedDisableDirectives: true,
overrides: [
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,15 @@ jobs:
overwrite: true
retention-days: 7

- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-event-dumps-job_e2e_playwright_tests-${{ matrix.test-application }}
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
overwrite: true
retention-days: 7

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
Expand Down
88 changes: 87 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,102 @@

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

## 8.35.0-beta.0
## 8.35.0

### Beta release of the official Nuxt Sentry SDK

This release marks the beta release of the `@sentry/nuxt` Sentry SDK. For details on how to use it, check out the
[Sentry Nuxt SDK README](https://github.com/getsentry/sentry-javascript/tree/develop/packages/nuxt). Please reach out on
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns.

- **feat(nuxt): Make dynamic import() wrapping default
([#13958](https://github.com/getsentry/sentry-javascript/pull/13958))** (BREAKING)
- **feat(nuxt): Add Rollup plugin to wrap server entry with `import()`
([#13945](https://github.com/getsentry/sentry-javascript/pull/13945))**

**It is no longer required to add a Node `--import` flag. Please update your start command to avoid initializing Sentry
twice (BREAKING CHANGE).** The SDK will now apply modifications during the build of your application to allow for
patching of libraries during runtime. If run into issues with this change, you can disable this behavior in your
`nuxt.config.ts` and use the `--import` flag instead:

```js
sentry: {
dynamicImportForServerEntry: false;
}
```

- **feat(nuxt): Respect user-provided source map generation settings
([#14020](https://github.com/getsentry/sentry-javascript/pull/14020))**

We now require you to explicitly enable sourcemaps for the clientside so that Sentry can un-minify your errors. We made
this change so source maps aren't accidentally leaked to the public. Enable source maps on the client as follows:

```js
export default defineNuxtConfig({
sourcemap: {
client: true,
},
});
```

- feat(nuxt): Log server instrumentation might not work in dev
([#14021](https://github.com/getsentry/sentry-javascript/pull/14021))
- feat(nuxt): Add Http `responseHook` with `waitUntil`
([#13986](https://github.com/getsentry/sentry-javascript/pull/13986))

### Important Changes

- **feat(vue): Add Pinia plugin ([#13841](https://github.com/getsentry/sentry-javascript/pull/13841))**

Support for [Pinia](https://pinia.vuejs.org/) is added in this release for `@sentry/vue`. To capture Pinia state data,
add `createSentryPiniaPlugin()` to your Pinia store:

```javascript
import { createPinia } from 'pinia';
import { createSentryPiniaPlugin } from '@sentry/vue';

const pinia = createPinia();

pinia.use(createSentryPiniaPlugin());
```

- **feat(node): Implement Sentry-specific http instrumentation
([#13763](https://github.com/getsentry/sentry-javascript/pull/13763))**

This change introduces a new `SentryHttpInstrumentation` to handle non-span related HTTP instrumentation, allowing it to
run side-by-side with OTel's `HttpInstrumentation`. This improves support for custom OTel setups and avoids conflicts
with Sentry's instrumentation. Additionally, the `spans: false` option is reintroduced for `httpIntegration` to disable
span emission while still allowing custom `HttpInstrumentation` instances (`httpIntegration({ spans: false })`).

- **feat(core): Make stream instrumentation opt-in
([#13951](https://github.com/getsentry/sentry-javascript/pull/13951))**

This change adds a new option `trackFetchStreamPerformance` to the browser tracing integration. Only when set to `true`,
Sentry will instrument streams via fetch.

### Other Changes

- feat(node): Expose `suppressTracing` API ([#13875](https://github.com/getsentry/sentry-javascript/pull/13875))
- feat(replay): Do not log "timeout while trying to read resp body" as exception
([#13965](https://github.com/getsentry/sentry-javascript/pull/13965))
- chore(node): Bump `@opentelemetry/instrumentation-express` to `0.43.0`
([#13948](https://github.com/getsentry/sentry-javascript/pull/13948))
- chore(node): Bump `@opentelemetry/instrumentation-fastify` to `0.40.0`
([#13983](https://github.com/getsentry/sentry-javascript/pull/13983))
- fix: Ensure type for `init` is correct in meta frameworks
([#13938](https://github.com/getsentry/sentry-javascript/pull/13938))
- fix(core): `.set` the `sentry-trace` header instead of `.append`ing in fetch instrumentation
([#13907](https://github.com/getsentry/sentry-javascript/pull/13907))
- fix(module): keep version for node ESM package ([#13922](https://github.com/getsentry/sentry-javascript/pull/13922))
- fix(node): Ensure `ignoreOutgoingRequests` of `httpIntegration` applies to breadcrumbs
([#13970](https://github.com/getsentry/sentry-javascript/pull/13970))
- fix(replay): Fix onError sampling when loading an expired buffered session
([#13962](https://github.com/getsentry/sentry-javascript/pull/13962))
- fix(replay): Ignore older performance entries when starting manually
([#13969](https://github.com/getsentry/sentry-javascript/pull/13969))
- perf(node): Truncate breadcrumb messages created by console integration
([#14006](https://github.com/getsentry/sentry-javascript/pull/14006))

Work in this release was contributed by @ZakrepaShe and @zhiyan114. Thank you for your contributions!

### Other Changes
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "^1.44.1",
"@sentry-internal/rrweb": "2.11.0",
"@sentry/browser": "8.35.0-beta.0",
"@sentry/browser": "8.35.0",
"axios": "1.6.7",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/bundle-analyzer-scenarios",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"description": "Scenarios to test bundle analysis with",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/clear-cache-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/clear-cache-gh-action",
"description": "An internal Github Action to clear GitHub caches.",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/e2e-tests",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions dev-packages/e2e-tests/test-applications/astro-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"test:assert": "TEST_ENV=production playwright test"
},
"dependencies": {
"@astrojs/check": "^0.9.2",
"@astrojs/node": "^8.3.2",
"@astrojs/check": "0.9.2",
"@astrojs/node": "8.3.2",
"@playwright/test": "^1.46.0",
"@sentry/astro": "* || latest",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@spotlightjs/astro": "^2.1.6",
"astro": "^4.13.3",
"@spotlightjs/astro": "2.1.6",
"astro": "4.13.3",
"typescript": "^5.5.4"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"@sentry/astro": "latest || *",
"astro": "4.16.1"
},
"devDependencies": {
"@astrojs/internal-helpers": "0.4.1"
},
"volta": {
"extends": "../../package.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ next-env.d.ts
.vscode

test-results
event-dumps
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import * as fs from 'fs';
import * as path from 'path';
import { startEventProxyServer } from '@sentry-internal/test-utils';

const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));

startEventProxyServer({
port: 3031,
proxyServerName: 'nextjs-15',
envelopeDumpPath: path.join(
process.cwd(),
`event-dumps/next-${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
),
});
18 changes: 5 additions & 13 deletions dev-packages/e2e-tests/test-applications/solidstart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
"version": "0.0.0",
"scripts": {
"clean": "pnpx rimraf node_modules pnpm-lock.yaml .vinxi .output",
"clean:build": "pnpx rimraf .vinxi .output",
"dev": "NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi dev",
"build": "vinxi build",
"//": [
"We are using `vinxi dev` to start the server because `vinxi start` is experimental and ",
"doesn't correctly resolve modules for @sentry/solidstart/solidrouter.",
"This is currently not an issue outside of our repo. See: https://github.com/nksaraf/vinxi/issues/177",
"We run the build command to ensure building succeeds. However, keeping",
"build output around slows down the vite dev server when using `@sentry/vite-plugin` so we clear it out",
"before actually running the tests.",
"Cleaning the build output should be removed once we can use `vinxi start`."
],
"preview": "pnpm clean:build && HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi dev",
"start": "HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi start",
"build": "vinxi build && sh ./post_build.sh",
"preview": "HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi start",
"test:prod": "TEST_ENV=production playwright test",
"test:build": "pnpm install && npx playwright install && pnpm build",
"test:assert": "pnpm test:prod"
Expand All @@ -41,5 +30,8 @@
"vite": "^5.2.8",
"vite-plugin-solid": "^2.10.2",
"vitest": "^1.5.0"
},
"overrides": {
"@vercel/nft": "0.27.4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TODO: Investigate the need for this script periodically and remove once these modules are correctly resolved.

# This script copies `import-in-the-middle` and `@sentry/solidstart` from the E2E test project root `node_modules`
# to the nitro server build output `node_modules` as these are not properly resolved in our yarn workspace/pnpm
# e2e structure. Some files like `hook.mjs` and `@sentry/solidstart/solidrouter.server.js` are missing. This is
# not reproducible in an external project (when pinning `@vercel/nft` to `v0.27.0` and higher).
cp -r node_modules/.pnpm/import-in-the-middle@1.*/node_modules/import-in-the-middle .output/server/node_modules
cp -rL node_modules/@sentry/solidstart .output/server/node_modules/@sentry
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test('captures an exception', async ({ page }) => {
);
});

await page.goto('/error-boundary');
await page.goto('/error-boundary');
await page.locator('#caughtErrorBtn').click();
const errorEvent = await errorEventPromise;
Expand Down Expand Up @@ -41,7 +40,6 @@ test('captures a second exception after resetting the boundary', async ({ page }
);
});

await page.goto('/error-boundary');
await page.goto('/error-boundary');
await page.locator('#caughtErrorBtn').click();
const firstErrorEvent = await firstErrorEventPromise;
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/external-contributor-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/external-contributor-gh-action",
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
10 changes: 5 additions & 5 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/node-integration-tests",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"license": "MIT",
"engines": {
"node": ">=14.18"
Expand Down Expand Up @@ -31,10 +31,10 @@
"@nestjs/core": "^10.3.3",
"@nestjs/platform-express": "^10.3.3",
"@prisma/client": "5.9.1",
"@sentry/aws-serverless": "8.35.0-beta.0",
"@sentry/node": "8.35.0-beta.0",
"@sentry/types": "8.35.0-beta.0",
"@sentry/utils": "8.35.0-beta.0",
"@sentry/aws-serverless": "8.35.0",
"@sentry/node": "8.35.0",
"@sentry/types": "8.35.0",
"@sentry/utils": "8.35.0",
"@types/mongodb": "^3.6.20",
"@types/mysql": "^2.15.21",
"@types/pg": "^8.6.5",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/overhead-metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "8.35.0-beta.0",
"version": "8.35.0",
"name": "@sentry-internal/overhead-metrics",
"main": "index.js",
"author": "Sentry",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/rollup-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/rollup-utils",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"description": "Rollup utilities used at Sentry for the Sentry JavaScript SDK",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/rollup-utils",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/size-limit-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/size-limit-gh-action",
"description": "An internal Github Action to compare the current size of a PR against the one on develop.",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
6 changes: 3 additions & 3 deletions dev-packages/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "8.35.0-beta.0",
"version": "8.35.0",
"name": "@sentry-internal/test-utils",
"author": "Sentry",
"license": "MIT",
Expand Down Expand Up @@ -45,8 +45,8 @@
},
"devDependencies": {
"@playwright/test": "^1.44.1",
"@sentry/types": "8.35.0-beta.0",
"@sentry/utils": "8.35.0-beta.0"
"@sentry/types": "8.35.0",
"@sentry/utils": "8.35.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
10 changes: 10 additions & 0 deletions dev-packages/test-utils/src/event-proxy-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ interface EventProxyServerOptions {
port: number;
/** The name for the proxy server used for referencing it with listener functions */
proxyServerName: string;
/** A path to optionally output all Envelopes to. Can be used to compare event payloads before and after changes. */
envelopeDumpPath?: string;
}

interface SentryRequestCallbackData {
Expand Down Expand Up @@ -167,6 +169,10 @@ export async function startProxyServer(
* option to this server (like this `tunnel: http://localhost:${port option}/`).
*/
export async function startEventProxyServer(options: EventProxyServerOptions): Promise<void> {
if (options.envelopeDumpPath) {
await fs.promises.mkdir(path.dirname(path.resolve(options.envelopeDumpPath)), { recursive: true });
}

await startProxyServer(options, async (eventCallbackListeners, proxyRequest, proxyRequestBody, eventBuffer) => {
const data: SentryRequestCallbackData = {
envelope: parseEnvelope(proxyRequestBody),
Expand All @@ -183,6 +189,10 @@ export async function startEventProxyServer(options: EventProxyServerOptions): P
listener(dataString);
});

if (options.envelopeDumpPath) {
fs.appendFileSync(path.resolve(options.envelopeDumpPath), `${JSON.stringify(data.envelope)}\n`, 'utf-8');
}

return [
200,
'{}',
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "8.35.0-beta.0",
"version": "8.35.0",
"npmClient": "yarn"
}
Loading

0 comments on commit fe37c12

Please sign in to comment.