Skip to content

Commit 6b66a28

Browse files
authored
feat(solidstart)!: No longer export sentrySolidStartVite (#15143)
Since the default way of setting up the SDK and passing the Sentry options is by wrapping the SolidStart config with `withSentry`, the previous method of using the `sentrySolidStartVite` plugin is no longer supported.
1 parent ad5418d commit 6b66a28

File tree

6 files changed

+17
-48
lines changed

6 files changed

+17
-48
lines changed

CHANGELOG.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,6 @@
1212

1313
Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
1414

15-
- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
16-
17-
To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
18-
added by `withSentry` and you can pass the Sentry build-time options like this:
19-
20-
```js
21-
import { defineConfig } from '@solidjs/start/config';
22-
import { withSentry } from '@sentry/solidstart';
23-
24-
export default defineConfig(
25-
withSentry(
26-
{
27-
/* Your SolidStart config options... */
28-
},
29-
{
30-
// Options for setting up source maps
31-
org: process.env.SENTRY_ORG,
32-
project: process.env.SENTRY_PROJECT,
33-
authToken: process.env.SENTRY_AUTH_TOKEN,
34-
},
35-
),
36-
);
37-
```
38-
39-
With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
40-
Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`.
41-
42-
Now, there are two options to set up the SDK:
43-
44-
1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
45-
`node --import ./.output/server/instrument.server.mjs .output/server/index.mjs`
46-
2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
47-
```js
48-
withSentry(
49-
{
50-
/* Your SolidStart config options... */
51-
},
52-
{
53-
// Optional: Install Sentry with a top-level import
54-
autoInjectServerSentry: 'top-level-import',
55-
},
56-
);
57-
```
58-
5915
## 9.0.0-alpha.0
6016

6117
This is an alpha release of the upcoming major release of version 9.

docs/migration/v8-to-v9.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,22 @@ Sentry.init({
234234
- The `addNormalizedRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
235235
- A `sampleRand` field on `PropagationContext` is now required. This is relevant if you used `scope.setPropagationContext(...)`
236236
237+
### `@sentry/solidstart`
238+
239+
- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and
240+
provide Sentry options as the second parameter.
241+
242+
```
243+
// app.config.ts
244+
import { defineConfig } from '@solidjs/start/config';
245+
import { withSentry } from '@sentry/solidstart';
246+
247+
export default defineConfig(withSentry(
248+
{ /* SolidStart config */ },
249+
{ /* Sentry build-time config (like project and org) */ })
250+
);
251+
```
252+
237253
#### Other/Internal Changes
238254
239255
The following changes are unlikely to affect users of the SDK. They are listed here only for completion sake, and to alert users that may be relying on internal behavior.

packages/solidstart/src/config/withSentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { logger } from '@sentry/core';
22
import type { Nitro } from 'nitropack';
3-
import { addSentryPluginToVite } from '../vite';
3+
import { addSentryPluginToVite } from '../vite/sentrySolidStartVite';
44
import type { SentrySolidStartPluginOptions } from '../vite/types';
55
import {
66
addDynamicImportEntryFileWrapper,
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './server';
2-
export * from './vite';
32
export * from './config';

packages/solidstart/src/index.types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// exports in this file - which we do below.
44
export * from './client';
55
export * from './server';
6-
export * from './vite';
76
export * from './config';
87

98
import type { Client, Integration, Options, StackParser } from '@sentry/core';

packages/solidstart/src/vite/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)