From c4580ee2ca8fb883c5357546edad94bc93026248 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 21 Aug 2022 01:00:27 -0700 Subject: [PATCH] Rename reactdom-bun -> react-dom-server.bun --- bench/react-hello-world/react-hello-world.jsx | 19 ++++++++++++++----- ...eactdom-bun.js => react-dom-server.bun.js} | 4 +--- test/bun.js/react-dom.test.tsx | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) rename test/bun.js/{reactdom-bun.js => react-dom-server.bun.js} (99%) diff --git a/bench/react-hello-world/react-hello-world.jsx b/bench/react-hello-world/react-hello-world.jsx index 15f2b000b4..a61ad75673 100644 --- a/bench/react-hello-world/react-hello-world.jsx +++ b/bench/react-hello-world/react-hello-world.jsx @@ -1,9 +1,13 @@ -import { renderToReadableStream } from "../../test/bun.js/reactdom-bun.js"; +// to run this: +// bun react-hello-world.jsx --jsx-production +// This will become the official react-dom/server.bun build a little later +// It will be the default when you import from "react-dom/server" +// That will work via the "bun" package.json export condition (which bun already supports) +import { renderToReadableStream } from "../../test/bun.js/react-dom-server.bun"; 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 }, }; @@ -11,12 +15,17 @@ const App = () => (
This is an example.
); -export default { +const port = Number(process.env.PORT || 3001); +Bun.serve({ + port, async fetch(req) { - return new Response(await renderToReadableStream(