From a9e4ff2029a769737982fcf7e0b7d76d35cf35e4 Mon Sep 17 00:00:00 2001 From: evan Date: Tue, 12 Jul 2022 04:40:12 -0400 Subject: cleanup benchmarks folder (#587) * cleanup benchmarks * run prettier --- bench/react-hello-world.node.jsx | 45 ---------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 bench/react-hello-world.node.jsx (limited to 'bench/react-hello-world.node.jsx') diff --git a/bench/react-hello-world.node.jsx b/bench/react-hello-world.node.jsx deleted file mode 100644 index b267bbd4d..000000000 --- a/bench/react-hello-world.node.jsx +++ /dev/null @@ -1,45 +0,0 @@ -// react-ssr.tsx -import { renderToPipeableStream } from "react-dom/server.node"; -import React from "react"; -const http = require("http"); -const App = () => ( - - -

Hello World

- - -); -var didError = false; -http - .createServer(function (req, res) { - const stream = renderToPipeableStream(, { - onShellReady() { - // The content above all Suspense boundaries is ready. - // If something errored before we started streaming, we set the error code appropriately. - res.statusCode = didError ? 500 : 200; - res.setHeader("Content-type", "text/html"); - res.setHeader("Cache-Control", "no-transform"); // set to match the Deno benchmark, which requires this for an apples to apples comparison - stream.pipe(res); - }, - onShellError(error) { - // Something errored before we could complete the shell so we emit an alternative shell. - res.statusCode = 500; - res.send( - '

Loading...

' - ); - }, - onAllReady() { - // If you don't want streaming, use this instead of onShellReady. - // This will fire after the entire page content is ready. - // You can use this for crawlers or static generation. - // res.statusCode = didError ? 500 : 200; - // res.setHeader('Content-type', 'text/html'); - // stream.pipe(res); - }, - onError(err) { - didError = true; - console.error(err); - }, - }); - }) - .listen(9080); -- cgit v1.2.3