From 465f134ee8e9968268f3151e1aef352baafd1d5a Mon Sep 17 00:00:00 2001 From: Nikhil Saraf Date: Sat, 30 Dec 2023 13:05:54 +0530 Subject: [PATCH 1/2] fix: await plugins in server functions/comoponents overrides --- packages/vinxi-server-components/index.js | 2 +- packages/vinxi-server-components/plugin.js | 2 +- packages/vinxi-server-functions/plugin.js | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/vinxi-server-components/index.js b/packages/vinxi-server-components/index.js index 4fe996c5..67bc402a 100644 --- a/packages/vinxi-server-components/index.js +++ b/packages/vinxi-server-components/index.js @@ -15,6 +15,6 @@ export const serverComponents = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server(), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [server(), ...((await overrides?.plugins?.()) ?? [])], }), }; diff --git a/packages/vinxi-server-components/plugin.js b/packages/vinxi-server-components/plugin.js index 4fe996c5..67bc402a 100644 --- a/packages/vinxi-server-components/plugin.js +++ b/packages/vinxi-server-components/plugin.js @@ -15,6 +15,6 @@ export const serverComponents = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server(), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [server(), ...((await overrides?.plugins?.()) ?? [])], }), }; diff --git a/packages/vinxi-server-functions/plugin.js b/packages/vinxi-server-functions/plugin.js index 6e6fa94d..7be1edbe 100644 --- a/packages/vinxi-server-functions/plugin.js +++ b/packages/vinxi-server-functions/plugin.js @@ -25,6 +25,9 @@ export const serverFunctions = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server({ runtime }), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [ + server({ runtime }), + ...((await overrides?.plugins?.()) ?? []), + ], }), }; From 86982a4a2106a3596d28a4ac3439567500975902 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf Date: Sat, 30 Dec 2023 16:09:22 +0530 Subject: [PATCH 2/2] Create cyan-timers-cover.md --- .changeset/cyan-timers-cover.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/cyan-timers-cover.md diff --git a/.changeset/cyan-timers-cover.md b/.changeset/cyan-timers-cover.md new file mode 100644 index 00000000..42af5426 --- /dev/null +++ b/.changeset/cyan-timers-cover.md @@ -0,0 +1,7 @@ +--- +"@vinxi/server-components": patch +"@vinxi/server-functions": patch +"vinxi": patch +--- + +fix: await plugins in server functions/comoponents overrides