Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into sig/server-config-nuxt
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Sep 6, 2024
2 parents ea95e37 + bdec033 commit 7671bd9
Show file tree
Hide file tree
Showing 27 changed files with 741 additions and 298 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ jobs:
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
timeout-minutes: 5
run: pnpm test:assert

- name: Upload Playwright Traces
uses: actions/upload-artifact@v4
if: failure()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { sentrySolidStartVite } from '@sentry/solidstart';
import { defineConfig } from '@solidjs/start/config';

export default defineConfig({});
export default defineConfig({
vite: {
plugins: [sentrySolidStartVite()],
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
"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"
"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": "HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi dev",
"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",
"test:prod": "TEST_ENV=production playwright test",
"test:build": "pnpm install && npx playwright install && pnpm build",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,75 +1,15 @@
import * as Sentry from '@sentry/solidstart';
import type { ParentProps } from 'solid-js';
import { ErrorBoundary, createSignal, onMount } from 'solid-js';

const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary);

const [count, setCount] = createSignal(1);
const [caughtError, setCaughtError] = createSignal(false);

export default function ClientErrorPage() {
return (
<SampleErrorBoundary>
{caughtError() && (
<Throw error={`Error ${count()} thrown from Sentry ErrorBoundary in Solid Start E2E test app`} />
)}
<section class="bg-gray-100 text-gray-700 p-8">
<div class="flex flex-col items-start space-x-2">
<button
class="border rounded-lg px-2 mb-2 border-red-500 text-red-500 cursor-pointer"
id="caughtErrorBtn"
onClick={() => setCaughtError(true)}
>
Throw caught error
</button>
</div>
<div class="flex flex-col items-start space-x-2">
<button
class="border rounded-lg px-2 mb-2 border-red-500 text-red-500 cursor-pointer"
id="errorBtn"
onClick={() => {
throw new Error('Error thrown from Solid Start E2E test app');
}}
>
Throw uncaught error
</button>
</div>
</section>
</SampleErrorBoundary>
);
}

function Throw(props: { error: string }) {
onMount(() => {
throw new Error(props.error);
});
return null;
}

function SampleErrorBoundary(props: ParentProps) {
return (
<SentryErrorBoundary
fallback={(error, reset) => (
<section class="bg-gray-100 text-gray-700 p-8">
<h1 class="text-2xl font-bold">Error Boundary Fallback</h1>
<div class="flex items-center space-x-2 mb-4">
<code>{error.message}</code>
</div>
<button
id="errorBoundaryResetBtn"
class="border rounded-lg px-2 border-gray-900"
onClick={() => {
setCount(count() + 1);
setCaughtError(false);
reset();
}}
>
Reset
</button>
</section>
)}
>
{props.children}
</SentryErrorBoundary>
<div class="flex flex-col items-start space-x-2">
<button
class="border rounded-lg px-2 mb-2 border-red-500 text-red-500 cursor-pointer"
id="errorBtn"
onClick={() => {
throw new Error('Uncaught error thrown from Solid Start E2E test app');
}}
>
Throw uncaught error
</button>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import * as Sentry from '@sentry/solidstart';
import type { ParentProps } from 'solid-js';
import { ErrorBoundary, createSignal, onMount } from 'solid-js';

const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary);

const [count, setCount] = createSignal(1);
const [caughtError, setCaughtError] = createSignal(false);

export default function ErrorBoundaryTestPage() {
return (
<SampleErrorBoundary>
{caughtError() && (
<Throw error={`Error ${count()} thrown from Sentry ErrorBoundary in Solid Start E2E test app`} />
)}
<section class="bg-gray-100 text-gray-700 p-8">
<div class="flex flex-col items-start space-x-2">
<button
class="border rounded-lg px-2 mb-2 border-red-500 text-red-500 cursor-pointer"
id="caughtErrorBtn"
onClick={() => setCaughtError(true)}
>
Throw caught error
</button>
</div>
</section>
</SampleErrorBoundary>
);
}

function Throw(props: { error: string }) {
onMount(() => {
throw new Error(props.error);
});
return null;
}

function SampleErrorBoundary(props: ParentProps) {
return (
<SentryErrorBoundary
fallback={(error, reset) => (
<section class="bg-gray-100 text-gray-700 p-8">
<h1 class="text-2xl font-bold">Error Boundary Fallback</h1>
<div class="flex items-center space-x-2 mb-4">
<code>{error.message}</code>
</div>
<button
id="errorBoundaryResetBtn"
class="border rounded-lg px-2 border-gray-900"
onClick={() => {
setCount(count() + 1);
setCaughtError(false);
reset();
}}
>
Reset
</button>
</section>
)}
>
{props.children}
</SentryErrorBoundary>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export default function Home() {
<li>
<A href="/server-error">Server error</A>
</li>
<li>
<A href="/error-boundary">Error Boundary</A>
</li>
<li>
<A id="navLink" href="/users/5">
User 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('captures an exception', async ({ page }) => {
);
});

await page.goto('/client-error');
await page.goto('/error-boundary');
await page.locator('#caughtErrorBtn').click();
const errorEvent = await errorEventPromise;

Expand All @@ -27,7 +27,7 @@ test('captures an exception', async ({ page }) => {
},
],
},
transaction: '/client-error',
transaction: '/error-boundary',
});
});

Expand All @@ -40,7 +40,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
);
});

await page.goto('/client-error');
await page.goto('/error-boundary');
await page.locator('#caughtErrorBtn').click();
const firstErrorEvent = await firstErrorEventPromise;

Expand All @@ -57,7 +57,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
},
],
},
transaction: '/client-error',
transaction: '/error-boundary',
});

const secondErrorEventPromise = waitForError('solidstart', errorEvent => {
Expand Down Expand Up @@ -85,6 +85,6 @@ test('captures a second exception after resetting the boundary', async ({ page }
},
],
},
transaction: '/client-error',
transaction: '/error-boundary',
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { waitForError } from '@sentry-internal/test-utils';
test.describe('client-side errors', () => {
test('captures error thrown on click', async ({ page }) => {
const errorPromise = waitForError('solidstart', async errorEvent => {
return errorEvent?.exception?.values?.[0]?.value === 'Error thrown from Solid Start E2E test app';
return errorEvent?.exception?.values?.[0]?.value === 'Uncaught error thrown from Solid Start E2E test app';
});

await page.goto(`/client-error`);
Expand All @@ -16,9 +16,8 @@ test.describe('client-side errors', () => {
values: [
{
type: 'Error',
value: 'Error thrown from Solid Start E2E test app',
value: 'Uncaught error thrown from Solid Start E2E test app',
mechanism: {
type: 'instrument',
handled: false,
},
},
Expand Down
1 change: 1 addition & 0 deletions dev-packages/size-limit-gh-action/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ async function run() {
}

async function runSizeLimitOnComparisonBranch() {
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const resultsFilePath = getResultsFilePath();

const limit = new SizeLimitFormatter();
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/instrumentation-aws-lambda": "0.43.0",
"@opentelemetry/instrumentation-aws-sdk": "0.43.1",
"@opentelemetry/instrumentation-aws-lambda": "0.44.0",
"@opentelemetry/instrumentation-aws-sdk": "0.44.0",
"@sentry/core": "8.28.0",
"@sentry/node": "8.28.0",
"@sentry/types": "8.28.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.onCreateWebpackConfig = ({ getConfig, actions }, options) => {
sentryWebpackPlugin({
sourcemaps: {
// Only include files from the build output directory
assets: ['public'],
assets: ['./public/**'],
// Ignore files that aren't users' source code related
ignore: [
'polyfill-*', // related to polyfills
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/instrumentation-http": "0.53.0",
"@opentelemetry/semantic-conventions": "^1.25.1",
"@rollup/plugin-commonjs": "26.0.1",
"@sentry/core": "8.28.0",
Expand Down
38 changes: 19 additions & 19 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/context-async-hooks": "^1.25.1",
"@opentelemetry/core": "^1.25.1",
"@opentelemetry/instrumentation": "^0.52.1",
"@opentelemetry/instrumentation-connect": "0.38.0",
"@opentelemetry/instrumentation-express": "0.41.1",
"@opentelemetry/instrumentation-fastify": "0.38.0",
"@opentelemetry/instrumentation-fs": "0.14.0",
"@opentelemetry/instrumentation-generic-pool": "0.38.0",
"@opentelemetry/instrumentation-graphql": "0.42.0",
"@opentelemetry/instrumentation-hapi": "0.40.0",
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/instrumentation-ioredis": "0.42.0",
"@opentelemetry/instrumentation-koa": "0.42.0",
"@opentelemetry/instrumentation-mongodb": "0.46.0",
"@opentelemetry/instrumentation-mongoose": "0.40.0",
"@opentelemetry/instrumentation-mysql": "0.40.0",
"@opentelemetry/instrumentation-mysql2": "0.40.0",
"@opentelemetry/instrumentation-nestjs-core": "0.39.0",
"@opentelemetry/instrumentation-pg": "0.43.0",
"@opentelemetry/instrumentation-redis-4": "0.41.0",
"@opentelemetry/instrumentation": "^0.53.0",
"@opentelemetry/instrumentation-connect": "0.39.0",
"@opentelemetry/instrumentation-express": "0.42.0",
"@opentelemetry/instrumentation-fastify": "0.39.0",
"@opentelemetry/instrumentation-fs": "0.15.0",
"@opentelemetry/instrumentation-generic-pool": "0.39.0",
"@opentelemetry/instrumentation-graphql": "0.43.0",
"@opentelemetry/instrumentation-hapi": "0.41.0",
"@opentelemetry/instrumentation-http": "0.53.0",
"@opentelemetry/instrumentation-ioredis": "0.43.0",
"@opentelemetry/instrumentation-koa": "0.43.0",
"@opentelemetry/instrumentation-mongodb": "0.47.0",
"@opentelemetry/instrumentation-mongoose": "0.42.0",
"@opentelemetry/instrumentation-mysql": "0.41.0",
"@opentelemetry/instrumentation-mysql2": "0.41.0",
"@opentelemetry/instrumentation-nestjs-core": "0.40.0",
"@opentelemetry/instrumentation-pg": "0.44.0",
"@opentelemetry/instrumentation-redis-4": "0.42.0",
"@opentelemetry/resources": "^1.25.1",
"@opentelemetry/sdk-trace-base": "^1.25.1",
"@opentelemetry/semantic-conventions": "^1.25.1",
"@prisma/instrumentation": "5.18.0",
"@prisma/instrumentation": "5.19.1",
"@sentry/core": "8.28.0",
"@sentry/opentelemetry": "8.28.0",
"@sentry/types": "8.28.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/instrumentation-http": "0.53.0",
"@remix-run/router": "1.x",
"@sentry/cli": "^2.33.0",
"@sentry/core": "8.28.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/solid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
</a>
</p>

# Official Sentry SDK for Solid (EXPERIMENTAL)
# Official Sentry SDK for Solid

[![npm version](https://img.shields.io/npm/v/@sentry/solid.svg)](https://www.npmjs.com/package/@sentry/solid)
[![npm dm](https://img.shields.io/npm/dm/@sentry/solid.svg)](https://www.npmjs.com/package/@sentry/solid)
[![npm dt](https://img.shields.io/npm/dt/@sentry/solid.svg)](https://www.npmjs.com/package/@sentry/solid)

This SDK is considered ⚠️ **experimental and in an alpha state**. It may experience breaking changes. Please reach out
on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. This
SDK currently only supports [Solid](https://www.solidjs.com/) and is not yet officially compatible with
[Solid Start](https://start.solidjs.com/).
This SDK is in **Beta**. The API is stable but updates may include minor changes in behavior. Please reach out on
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. This
SDK is for [Solid](https://www.solidjs.com/). If you're using [SolidStart](https://start.solidjs.com/) see our
[SolidStart SDK here](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solidstart).

# Solid Router

Expand Down
1 change: 1 addition & 0 deletions packages/solidstart/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
files: ['src/vite/**', 'src/server/**'],
rules: {
'@sentry-internal/sdk/no-optional-chaining': 'off',
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
},
},
],
Expand Down
Loading

0 comments on commit 7671bd9

Please sign in to comment.