Closed deckchairlabs closed 2 years ago
Hi James, yea — we are making a lot of progress with Vike frameworks being built on top of vite-plugin-ssr 0.4 :-). A Remix clone should be fairly easy to achieve now ;-).
As for Deno, yes, I'm open for this although I don't know how much change is required? Deno now has this Node.js compat layer, right?
It does yeah, and works quite well. I think all would be needed are "import" conditions in package.json for esm.
https://esm.sh/react-streaming is how I'd be importing, which doesn't seem to support the browser field you have currently.
Done & released in 0.2.7
.
Well the import resolves correctly now! Thanks for that. although, since reanderToPipeableStream
is only available on Node environments, the import fails.
Reproduction https://github.dev/deckchairlabs/react-streaming-deno
error: Uncaught SyntaxError: The requested module '/v78/react-dom@18.1.0/deno/server.development.js' does not provide an export named 'renderToPipeableStream'
at https://cdn.esm.sh/v78/react-streaming@0.2.7/deno/server.development.js:13:10
I'm wondering if the simplest solution is to have a separate "export" for web platform environments?
Currently react-streaming
statically imports from React: import { renderToPipeableStream, renderToReadableStream } from 'react-dom/server'
. But we can dynamically import()
these only if needed instead. That should fix it. Up for PR?
That should work! I'll get to it!
Fixed in https://github.com/brillout/react-streaming/pull/4.
Released in 0.2.8
.
It works! Nice
👍.
Btw do you know if there are efforts to make Vite work with Deno? Although I'm thinking Deno already has built-in support for bundling, right? Does it support browser transpilation and HMR? E.g. React or Vue files? Custom transfomers (e.g. for Telefunc)?
Deno is quite exciting :-).
Hey! Long time! Hope all is well.
I'm trying to use this in a Deno framework, do you have plans to publish a Deno specific module, or have recommendations on how to import and use?