question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deno compatibility

See original GitHub issue

Motivation

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
katywingscommented, May 19, 2020

2020-05-19 13 17 33

😂

1reaction
bebrawcommented, Sep 12, 2020

@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 be typeof window !== "undefined" && window.Deno; to protect against Node.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js compatibility mode | Manual - Deno
Starting with v1.15 Deno provides Node compatiblity mode that makes it possible to run a subset of programs authored for Node.js directly in...
Read more >
Deno stabilizes NPM compatibility - InfoWorld
Deno's builders said using NPM is safer with Deno, due to Deno's secure-by-default, opt-in permissions model. Importing NPM modules is done ...
Read more >
Node.js compatibility in Deno | The JS runtimes - Medium
The purpose of compatibility is to provide an ability to run Node.js programs in Deno. The primary advantage is running a Node.js app...
Read more >
Deno 1.28: Featuring 1.3 Million New Modules
We're excited to announce that Deno 1.28 stabilizes npm compatibility, which means you can now import over 1.3 million npm modules in Deno....
Read more >
Node.js rival Deno adds stable npm compatibility in effort to ...
The Deno team has released version 1.28 which “stabilizes npm compatibility,” according to a post today. This is a key feature since the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found