Skip to content

feat(solidstart)!: No longer export sentrySolidStartVite #15143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 0 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,6 @@

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

- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**

To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
added by `withSentry` and you can pass the Sentry build-time options like this:

```js
import { defineConfig } from '@solidjs/start/config';
import { withSentry } from '@sentry/solidstart';

export default defineConfig(
withSentry(
{
/* Your SolidStart config options... */
},
{
// Options for setting up source maps
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
},
),
);
```

With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
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`.

Now, there are two options to set up the SDK:

1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
`node --import ./.output/server/instrument.server.mjs .output/server/index.mjs`
2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
```js
withSentry(
{
/* Your SolidStart config options... */
},
{
// Optional: Install Sentry with a top-level import
autoInjectServerSentry: 'top-level-import',
},
);
```

## 9.0.0-alpha.0

This is an alpha release of the upcoming major release of version 9.
Expand Down
16 changes: 16 additions & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,22 @@ Sentry.init({
- The `addNormalizedRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
- A `sampleRand` field on `PropagationContext` is now required. This is relevant if you used `scope.setPropagationContext(...)`

### `@sentry/solidstart`

- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and
provide Sentry options as the second parameter.

```
// app.config.ts
import { defineConfig } from '@solidjs/start/config';
import { withSentry } from '@sentry/solidstart';

export default defineConfig(withSentry(
{ /* SolidStart config */ },
{ /* Sentry build-time config (like project and org) */ })
);
```

#### Other/Internal Changes

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.
Expand Down
2 changes: 1 addition & 1 deletion packages/solidstart/src/config/withSentry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { logger } from '@sentry/core';
import type { Nitro } from 'nitropack';
import { addSentryPluginToVite } from '../vite';
import { addSentryPluginToVite } from '../vite/sentrySolidStartVite';
import type { SentrySolidStartPluginOptions } from '../vite/types';
import {
addDynamicImportEntryFileWrapper,
Expand Down
1 change: 0 additions & 1 deletion packages/solidstart/src/index.server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './server';
export * from './vite';
export * from './config';
1 change: 0 additions & 1 deletion packages/solidstart/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// exports in this file - which we do below.
export * from './client';
export * from './server';
export * from './vite';
export * from './config';

import type { Client, Integration, Options, StackParser } from '@sentry/core';
Expand Down
1 change: 0 additions & 1 deletion packages/solidstart/src/vite/index.ts

This file was deleted.

Loading