You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to speed up my build by creating a Worker for each postcss->tailwind->css file being processed. I'm stuck on how to pass the tailwind config object over to the Worker. Since tailwind configs include plugins & are not serializable. I have not yet found a way to convert the config object graph into an ArrayBuffer. I don't know what size to give it. Since the plugins are functions. I could send all of the serializable state & reimport the plugins. But would like to avoid doing that.
The Worker does not mutate the config object. If the config object were immutable, it would be ideal to have some form of direct memory access to the config object. This does not seem possible given Javascript's runtime memory safety. Is there a way to do this in BunJS other than using FFI? If I were to use FFI, I would have the same problem of serializing the config object.
Would passing a readonly reference to a worker be something that may happen with Javascript in the future? Are there other possibilities that I'm missing?
Otherwise, Tailwind v4 has it's compiler programmed in Rust.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to speed up my build by creating a Worker for each postcss->tailwind->css file being processed. I'm stuck on how to pass the tailwind config object over to the Worker. Since tailwind configs include plugins & are not serializable. I have not yet found a way to convert the config object graph into an ArrayBuffer. I don't know what size to give it. Since the plugins are functions. I could send all of the serializable state & reimport the plugins. But would like to avoid doing that.
The Worker does not mutate the config object. If the config object were immutable, it would be ideal to have some form of direct memory access to the config object. This does not seem possible given Javascript's runtime memory safety. Is there a way to do this in BunJS other than using FFI? If I were to use FFI, I would have the same problem of serializing the config object.
Would passing a readonly reference to a worker be something that may happen with Javascript in the future? Are there other possibilities that I'm missing?
Otherwise, Tailwind v4 has it's compiler programmed in Rust.
Beta Was this translation helpful? Give feedback.
All reactions