aboutsummaryrefslogtreecommitdiff
path: root/bench/react-hello-world/react-hello-world.jsx
blob: 4c3fc596724cfd37f207f2b2689f944ea140fd01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
  },
};