Skip to content

Commit b8be147

Browse files
committed
chore(playground): migrate dev-playground server to onPluginsReady
`server({ autoStart: false }).then(appkit => appkit.server.extend(...).start())` is gone — `createApp` now orchestrates server start itself, with the post-setup hook surfaced as the `onPluginsReady` config callback. Drop `autoStart: false`, hoist the `extend` block from the trailing `.then` chain into `onPluginsReady`, and replace the dangling promise with `.catch(console.error)` so unhandled rejections still surface. Tracks #280 / #291 (autoStart removal + on-plugins-ready codemod).
1 parent fb49ee5 commit b8be147

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

apps/dev-playground/server/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ const dashboard_pilot = createAgent({
330330

331331
createApp({
332332
plugins: [
333-
server({ autoStart: false }),
333+
server(),
334334
reconnect(),
335335
telemetryExamples(),
336336
analytics({}),
@@ -385,9 +385,8 @@ createApp({
385385
// }),
386386
],
387387
...(process.env.APPKIT_E2E_TEST && { client: createMockClient() }),
388-
}).then((appkit) => {
389-
appkit.server
390-
.extend((app) => {
388+
async onPluginsReady(appkit) {
389+
appkit.server.extend((app) => {
391390
app.get("/sp", (_req, res) => {
392391
appkit.analytics
393392
.query("SELECT * FROM samples.nyctaxi.trips;")
@@ -681,9 +680,9 @@ createApp({
681680
res.status(404).json({ error: msg });
682681
}
683682
});
684-
})
685-
.start();
686-
});
683+
});
684+
},
685+
}).catch(console.error);
687686

688687
/**
689688
* Heuristic match for Databricks Files API's "directory not found" error.

0 commit comments

Comments
 (0)