Skip to content

Commit

Permalink
Merge pull request #72 from nksaraf/async-plugins
Browse files Browse the repository at this point in the history
fix: await plugins in server functions/comoponents overrides
  • Loading branch information
nksaraf authored Dec 30, 2023
2 parents ef00017 + 86982a4 commit 4630198
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/cyan-timers-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@vinxi/server-components": patch
"@vinxi/server-functions": patch
"vinxi": patch
---

fix: await plugins in server functions/comoponents overrides
2 changes: 1 addition & 1 deletion packages/vinxi-server-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?.()) ?? [])],
}),
};
2 changes: 1 addition & 1 deletion packages/vinxi-server-components/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?.()) ?? [])],
}),
};
5 changes: 4 additions & 1 deletion packages/vinxi-server-functions/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?.()) ?? []),
],
}),
};

0 comments on commit 4630198

Please sign in to comment.