BuilderIO / framework-benchmarks

Test each framework for it's performance cost
476 stars 22 forks source link

Issue with Deno React SSR bench #13

Closed bartlomieju closed 2 years ago

bartlomieju commented 2 years ago

Hi, in the React SSR bench there's:

React SSR times:
Test Node vs Bun vs Deno at React SSR of a non trivial (the dashboard) app

Note: currently having an issue with Deno, looking into

What's the issue? How can we help to fix it?

steve8708 commented 2 years ago

Ah yes! Would love help / second eyes here. When I run frameworks/react-ssr-deno I get this:

TypeError: Cannot read properties of null (reading 'useState')
    at t.useState (https://cdn.jsdelivr.net/npm/react/+esm:7:6230)
    at Dashboard (file:///Users/stephensewell/Projects/steve/framework-weight/frameworks/react-ssr-deno/generated-components/components/dashboard.js:8:33)
    at Aa (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:24355)
    at Ha (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:25114)
    at Ua (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:27501)
    at Za (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:28474)
    at Wa (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:28338)
    at Ua (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:27631)
    at Za (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:28474)
    at Ha (https://cdn.jsdelivr.net/npm/react-dom/server/+esm:25:25517)

For some reason, useState is not recognized as an export from https://esm.run/react, even tho when I inspect the code there nothing looks off

You should be able to reproduce by following the below:


Setup

After cloning this repo, install dependencies:

npm install

Now you can start running the below scripts:

Generate

First, we must generate the component code for each framework via Mitosis.

cd apps/components
npm install
npm run build

Run the deno example to reproduce the error

cd frameworks/react-ssr-deno
deno task preview

and then open http://localhost:6015