Skip to content

Conversation

@fireairforce
Copy link

@fireairforce fireairforce commented Aug 17, 2025

  • 让 webworker 版本下的 postcss transform 能过编译了
    • 主要是因为 turbo_tasks 不接受没实现 send 类型(web_sys 里面的一些类型),参考之前 tokio_fs_ext 里面的处理引入了一个 send_wrapper crate
    • 目前在 wasm 场景下的实现方法按照理想情况来说,是通过 web_sys 起一个 worker 在 worker 进程里面去把 postcss transform 的处理完(因为 utoopack 没有wasm,还没办法验证,我在 JS 场景下简单验证了一下, postcss 可以简单运行起来,但复杂的场景例如启用更多的 postcss plugin 之类的,需要我们提前把这些 plugin 依赖 bundle 到 web worker 产物里面去,目测未来兼容性会比较差)

@xusd320
Copy link

xusd320 commented Aug 18, 2025

用 SendWrapper 可能有点问题…,tokio-fs-ext 也要改

@xusd320
Copy link

xusd320 commented Aug 18, 2025

turbo-tasks 单线程在浏览器上跑不起了,得上多线程了

@xusd320
Copy link

xusd320 commented Aug 18, 2025

先合了,我再试试单线程

@xusd320 xusd320 merged commit 54f8be4 into utoo-wasm Aug 18, 2025
16 of 29 checks passed
@xusd320 xusd320 deleted the inject-utoo-web-worker branch November 26, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants