Skip to content

Commit 5ceb123

Browse files
committed
Housekeeping
1 parent 8fa76db commit 5ceb123

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

packages/solidstart/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# types for the solidrouter integration
1+
# types for the solidrouter integration that get output in root
22
/client
33
/server
44
/*.d.ts

packages/solidstart/rollup.npm.config.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ export default makeNPMConfigVariants(
44
makeBaseNPMConfig({
55
entrypoints: [
66
'src/index.client.ts',
7-
'src/solidrouter.client.ts',
87
'src/index.server.ts',
9-
'src/solidrouter.server.ts',
108
'src/client/index.ts',
11-
'src/client/solidrouter.ts',
129
'src/server/index.ts',
13-
'src/server/solidrouter.ts',
1410
'src/solidrouter.ts',
11+
'src/solidrouter.client.ts',
12+
'src/solidrouter.server.ts',
13+
'src/client/solidrouter.ts',
14+
'src/server/solidrouter.ts',
1515
],
16-
// prevent this internal nextjs code from ending up in our built package (this doesn't happen automatially because
16+
// prevent this internal code from ending up in our built package (this doesn't happen automatially because
1717
// the name doesn't match an SDK dependency)
1818
packageSpecificConfig: {
1919
external: ['solid-js', '@sentry/solid', '@sentry/solid/solidrouter'],

packages/solidstart/src/client/sdk.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { init as initSolidSDK } from '@sentry/solid';
44
import type { Client } from '@sentry/types';
55

66
/**
7-
* Initialize the client side of the Sentry SvelteKit SDK.
8-
*
9-
* @param options Configuration options for the SDK.
7+
* Initializes the client side of the Solid Start SDK.
108
*/
119
export function init(options: BrowserOptions): Client | undefined {
1210
const opts = {

packages/solidstart/src/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export {
121121
// We can still leave this for the carrier init and type exports
122122
export * from '@sentry/node';
123123

124-
export { withSentryErrorBoundary } from '@sentry/solid'
124+
export { withSentryErrorBoundary } from '@sentry/solid';
125125

126126
// -------------------------
127127
// Solid Start SDK exports:

packages/solidstart/src/server/sdk.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import type { NodeClient, NodeOptions } from '@sentry/node';
33
import { init as initNodeSdk } from '@sentry/node';
44

55
/**
6-
*
7-
* @param options
6+
* Initializes the server side of the Solid Start SDK
87
*/
98
export function init(options: NodeOptions): NodeClient | undefined {
109
const opts = {

packages/solidstart/src/server/solidrouter.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import { mergeProps, splitProps } from 'solid-js';
33
import type { Component, JSX, ParentProps } from 'solid-js';
44
import { createComponent } from 'solid-js/web';
55

6+
// We use @sentry/solid/solidrouter on the client.
7+
// On the server, we have to create matching components
8+
// in structure to avoid hydration errors.
9+
610
/** Pass-through component in case user didn't specify a root **/
711
function SentryDefaultRoot(props: ParentProps): JSX.Element {
812
return props.children;
913
}
1014

1115
/**
12-
* Unfortunately, we cannot use router hooks directly in the Router, so we
13-
* need to wrap the `root` prop to instrument navigation.
16+
* On the client, router hooks are used in the router's root render prop.
17+
* This creates a matching structure that's purely pass-through to avoid hydration errors.
1418
*/
1519
function withSentryRouterRoot(Root: Component<RouteSectionProps>): Component<RouteSectionProps> {
1620
const SentryRouterRoot = (props: RouteSectionProps): JSX.Element => {
@@ -23,7 +27,8 @@ function withSentryRouterRoot(Root: Component<RouteSectionProps>): Component<Rou
2327
export type RouterType = typeof BaseRouter | typeof HashRouter | typeof MemoryRouter | typeof StaticRouter;
2428

2529
/**
26-
* A higher-order component to instrument Solid Router to create navigation spans.
30+
* On the client, router hooks are used to start navigation spans.
31+
* This creates a matching structure that's purely pass-through to avoid hydration errors.
2732
*/
2833
export function withSentryRouterRouting(Router: RouterType): RouterType {
2934
const SentryRouter = (props: Parameters<RouterType>[0]): JSX.Element => {

0 commit comments

Comments
 (0)