Comments (9)
I probably don't know enough about how to use SSR to answer all of this :) but this sounds reasonable :)
Why did you then try to import twind/server
?
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
Thanks. Good to know.
also if it's experimental with node.js it seems that
twind/server
is going to have 3 environments it might run: old node.js with no async_hooks support, new node.js, and Deno :) and only 1 of those 3 is going to work :)
twind/server
is only required for async rendering in node.js environment where we test it and it works in v12 and v14 which is good enough for the moment. Additionally we have a notice on top of that doc section. Deno/Node sync rendering of shimmed html should now work by using twind/shim/server
.
I'll adjust the docs to make clear that for sync rendering twind/sheets
and for the shim twind/shim/server
is enough.
from twind.
Why did you then try to import
twind/server
?that's the only thing that is mentioned in https://github.com/tw-in-js/twind/blob/main/docs/ssr.md :)
For sync rendering twind/sheets is used. But the header is misleading. Maybe you could provide an PR to fix that 😉
Deno/Node sync rendering of shimmed html should now work by using twind/shim/server
It is not released. We have two other PR we want to include in the next release.
from twind.
Release v0.12.0 is published. twin/sheets/server should now work in deno
from twind.
@aadamsx I have a small example at https://github.com/bebraw/gustwind . It seems to work without shim and sheet.reset
though this definitely needs more experimentation.
from twind.
twind/server
is meant to be run only on node js as one of it export is the asyncVirtualSheet
which uses async_hooks. The other export is the server side shim
method. Sadly this way one can not use shim
outside of nodejs.
What about we create twind/shim/server
module that exports the shim
method? This way you would only need to use twind/server
if you want to use the asyncVirtualSheet
. All other exports are only re-exports from twind/sheets
and could be imported from there. twind/server
would still re-export shim
from twind/shim/server
.
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 async_hooks
equivalent?
from twind.
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 twind/server
is going to have 3 environments it might run: old node.js with no async_hooks support, new node.js, and Deno :) and only 1 of those 3 is going to work :)
from twind.
Why did you then try to import
twind/server
?
that's the only thing that is mentioned in https://github.com/tw-in-js/twind/blob/main/docs/ssr.md :)
Deno/Node sync rendering of shimmed html should now work by using twind/shim/server
https://esm.sh/twind/shim/server crashes :)
https://jspm.dev/twind/shim/server is 404
https://cdn.skypack.dev/twind/shim/server is 404
from twind.
Is there an example repo where somewhere I can see how tailwind is properly integrated with Deno?
from twind.
It should "just" work – except for twind/server
that is using a node specific package (async_hooks
). Do you have any issues?
from twind.
Related Issues (20)
- [Docs]: Help wanted! HOT 15
- How to make cssom() inject at the end of the document? HOT 5
- [Bug]: It is not possible to specify the stop position of the gradient color HOT 1
- [Bug]: Twind Intellisense is not working when I create project using fresh HOT 2
- [Feature]:@twind/with-web-components support function components and/or existing element instances using withTwind HOT 1
- [Bug]: no w-fit HOT 1
- [Feature]: flex-shrink-* is deprecated HOT 1
- missing data HOT 1
- How to use tailwindcss plugins? HOT 3
- Is there a way to make tailwind-scrollbar plugin to work with twind? HOT 3
- [Bug]: keyframes added with injectGlobal only contain the last keyframe HOT 2
- [Bug]: Classes added with injectGlobal can't reference each other with @apply HOT 2
- [Bug]: Classes added with injectGlobal can't be used with variants HOT 2
- [Feature]: allow peer dep of typescript v5 HOT 2
- [Bug]: max-w-{number} does not work
- defineConfig / setup mixed up[Docs]:
- Template literals like className={tw`bg-green-${c}`}
- How to style host and slot elements with Lit HOT 2
- [Docs]: twind.dev is out of date and still seems active HOT 1
- [Feature]: support vars in square brackts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twind.