diff options
Diffstat (limited to 'bench/react-hello-world/react-hello-world.jsx')
-rw-r--r-- | bench/react-hello-world/react-hello-world.jsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bench/react-hello-world/react-hello-world.jsx b/bench/react-hello-world/react-hello-world.jsx new file mode 100644 index 000000000..4c3fc5967 --- /dev/null +++ b/bench/react-hello-world/react-hello-world.jsx @@ -0,0 +1,25 @@ +// import { renderToReadableStream } from "react-dom/server.browser"; +var { renderToReadableStream } = import.meta.require( + "../../test/bun.js/reactdom-bun.js" +); + +const headers = { + headers: { + "Content-Type": "text/html", + "Cache-Control": "no-transform", // set to match the Deno benchmark, which requires this for an apples to apples comparison + }, +}; + +const App = () => ( + <html> + <body> + <h1>Hello World</h1> + </body> + </html> +); + +export default { + async fetch(req) { + return new Response(await renderToReadableStream(<App />), headers); + }, +}; |