@@ -65,50 +65,43 @@ flowchart LR
65651 . ** Add ` @spotlightjs/spotlight ` dependency** to [ ` dev-packages/test-utils/package.json ` ] ( dev-packages/test-utils/package.json )
6666
67672 . ** Create new Spotlight-based helpers** in [ ` dev-packages/test-utils/src/spotlight.ts ` ] ( dev-packages/test-utils/src/spotlight.ts ) :
68-
6968 - ` startSpotlight(options) ` - Spawns ` spotlight run ` with dynamic port, parses port from stderr
7069 - ` waitForSpotlightEvent(filter) ` - Reads from Spotlight's JSON output stream
7170 - ` waitForTransaction() ` , ` waitForError() ` , etc. - High-level wrappers matching current API
7271
73723 . ** Update [ ` dev-packages/test-utils/src/playwright-config.ts ` ] ( dev-packages/test-utils/src/playwright-config.ts ) ** :
74-
7573 - Add option to use Spotlight instead of event proxy
7674 - Configure webServer to run Spotlight with dynamic port
7775 - Pass port via environment variable to test app
7876
7977### Phase 2: Create Migration Path
8078
81794 . ** Design backward-compatible API** :
82-
8380 - Keep existing ` waitForTransaction() ` signature
8481 - New implementation reads from Spotlight instead of HTTP streaming
8582 - Port is passed via ` SPOTLIGHT_PORT ` env var
8683
87845 . ** Update DSN handling in test apps** :
88-
8985 - Replace ` tunnel: 'http://localhost:3031' ` with DSN workaround
9086 - DSN format: ` http://spotlight@localhost:${SPOTLIGHT_PORT}/0 `
9187 - This makes SDK operate in "normal" mode (no tunnel)
9288
9389### Phase 3: Migrate Test Apps (Incremental)
9490
95916 . ** Migration per test app involves** :
96-
9792 - Remove ` start-event-proxy.mjs `
9893 - Update ` playwright.config.mjs ` to use new Spotlight config
9994 - Update Sentry init to use DSN workaround instead of tunnel
10095 - No changes needed to test files (API stays the same)
10196
102977 . ** Start with problematic apps** :
103-
10498 - ` react-router-7-lazy-routes ` (the failing one)
10599 - ` react-router-7-framework `
106100 - Then expand to remaining ~ 106 apps
107101
108102### Phase 4: Cleanup
109103
1101048 . ** After all apps migrated** :
111-
112105 - Remove old event proxy code from ` event-proxy-server.ts `
113106 - Update documentation
114107 - Remove unused dependencies
@@ -129,7 +122,7 @@ Per [Spotlight docs](https://spotlightjs.com/docs/cli/run/#unsupported-sdks-dsn-
129122
130123``` javascript
131124Sentry .init ({
132- dsn: ` http://spotlight@localhost:${ process .env .SPOTLIGHT_PORT } /0`
125+ dsn: ` http://spotlight@localhost:${ process .env .SPOTLIGHT_PORT } /0` ,
133126});
134127```
135128
@@ -139,18 +132,16 @@ Sentry.init({
139132// Before
140133webServer: [
141134 { command: ' node start-event-proxy.mjs' , port: 3031 },
142- { command: ' yarn start' , port: 3030 }
143- ]
135+ { command: ' yarn start' , port: 3030 },
136+ ];
144137
145138// After - spotlight run auto-detects and runs the app
146- webServer: [
147- { command: ' yarn spotlight run -p 0 -f json' , port: 3030 }
148- ]
139+ webServer: [{ command: ' yarn spotlight run -p 0 -f json' , port: 3030 }];
149140```
150141
151142Note: ` spotlight run ` automatically:
152143
153144- Detects the start script from package.json (` dev ` , ` develop ` , ` serve ` , ` start ` )
154145- Starts the Spotlight sidecar on the specified port (or dynamic with ` -p 0 ` )
155146- Streams events to stdout in JSON format (with ` -f json ` )
156- - Sets ` SENTRY_SPOTLIGHT ` env var for the child process
147+ - Sets ` SENTRY_SPOTLIGHT ` env var for the child process
0 commit comments