-
-
Notifications
You must be signed in to change notification settings - Fork 105
Deno support #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What about we create Would this help: import { shim } from 'twind/shim/server'
import { virtualSheet, getStyleTag } from 'twind/sheets'
// ... For now that would mean no async rendering for deno. Do you know if there is an |
I probably don't know enough about how to use SSR to answer all of this :) but this sounds reasonable :) as for async_hooks, I have no idea what that is, but from a quick look at docs it seems like it's experimental and there are no plans to support it in Deno any time soon denoland/deno#945 also if it's experimental with node.js it seems that |
Why did you then try to import
Thanks. Good to know.
I'll adjust the docs to make clear that for sync rendering |
that's the only thing that is mentioned in https://github.com/tw-in-js/twind/blob/main/docs/ssr.md :)
https://esm.sh/twind/shim/server crashes :) |
For sync rendering twind/sheets is used. But the header is misleading. Maybe you could provide an PR to fix that 😉
It is not released. We have two other PR we want to include in the next release. |
Release v0.12.0 is published. twin/sheets/server should now work in deno |
Is there an example repo where somewhere I can see how tailwind is properly integrated with Deno? |
It should "just" work – except for |
@aadamsx I have a small example at https://github.com/bebraw/gustwind . It seems to work without shim and |
So far it seems like twind works with client side Deno. Either shim or regular (I also tested
https://cdn.esm.sh/twind
,https://jspm.dev/twind
). This is not that surprising given that twind already works as es module in the browser :)As for server-side support, the first issue is that it just crashes :)
https://cdn.esm.sh/twind/server
https://jspm.dev/twind/server
https://cdn.skypack.dev/twind/server
I guess it happens because of dependency on async rendering for node.
So I tried to create a simple server on Deno that could run on codesanbox https://codesandbox.io/s/deno-twinddev-ssr-p4l2h?file=/src/index.ts
This one is actually not that bad :) it crashes if I try to update to the latest version, but otherwise does most of what I expected
twind/server
to do :)p.s. I personally was trying it out in aleph.js but it comes with its own complications that probably would require a separate issue :)
The text was updated successfully, but these errors were encountered: