-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(changeset): make server functions worker work
- Loading branch information
Showing
24 changed files
with
212 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@vinxi/server-functions": patch | ||
"@vinxi/react-server": patch | ||
"@vinxi/plugin-directives": patch | ||
"@vinxi/doc": patch | ||
"vinxi": patch | ||
--- | ||
|
||
make server functions worker work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
examples/react/rsc/fw/app/client.tsx → packages/vinxi-react-server/app/client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="vinxi/types/client" /> | ||
import { ServerComponent } from "@vinxi/react-server/client"; | ||
import { createRoot } from "react-dom/client"; | ||
|
||
import { ServerComponent } from "../client"; | ||
|
||
createRoot(document).render(<ServerComponent url={window.location.pathname} />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createServerReference as cServerReference } from "@vinxi/react-server-dom/runtime"; | ||
|
||
import { fetchServerAction } from "./fetch-server-action"; | ||
|
||
export function createServerReference(fn, moduleId, name) { | ||
return cServerReference( | ||
async (...args) => { | ||
return await fetchServerAction("/_server/", moduleId + "#" + name, args); | ||
}, | ||
moduleId, | ||
name, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { fileURLToPath } from "url"; | ||
import { eventHandler } from "vinxi/server"; | ||
|
||
const path = fileURLToPath(new URL("./app/client.tsx", import.meta.url)); | ||
|
||
export default eventHandler((event) => { | ||
return `<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script src="/@fs${path}" type="module"> | ||
</script> | ||
</body> | ||
</html> | ||
`; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.