Deno compatibility
See original GitHub issueMotivation
I am trying to make Otion compatible with Deno. As a poc I created this little transform script: https://github.com/lufrai/deno-otion/blob/master/update.ts
Details
It already looks like Otion is mostly working in Deno with the changes. Is this something you would be interested in to integrate into your Otion builds?
One thing thats still a mystery is Otions server side rendering: in my Deno tries it only works for the first request, even though I run setup with a new VirtualInjector like here on each request. The style tag is just empty on all requests after the first one 😅🙈. Since i only tried it out with Deno yet, I am unsure if this might be in node as well.
Edit: From looking at the Otion code I think the problem mentioned at the top with the style tag being empty after the first render actually also exists in node:
The injector only gets new css here: https://github.com/kripod/otion/blob/master/packages/otion/src/createInstance.ts#L183. But the setup
call never deletes the insertedIdentNames from previous ssr.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:20 (13 by maintainers)
Top GitHub Comments
😂
@kripod Sure, I understand. Let me know if I can be of any help. 👍
I realized that
window?.Deno
check isn’t enough. It should betypeof window !== "undefined" && window.Deno;
to protect against Node.