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'm not entirely sure how to solve this, but I know it will involve adding a prepublishOnly step to the package.json that's going to use bundler to dump all of the necessary files into the package somehow.
The other difficulty is that loading WASM requires an async call, so we still are blocked on that. Fortunately that's changing in v3 of prettier prettier/prettier#13142.
I think the answer for now is going to be waiting for prettier v3 and waiting on/working on support for non-bundled native extensions for WASI.
Yes please! If you could help me get https://github.com/ruby-syntax-tree/node-syntax-tree to compile the RBS plugin as well - which is the only blocker, then I could ship this using the WASM code and it would be totally good to go.
Not really - I'm just giving up on that possibility to be honest. The issue is RBS compilation into WASM. If someone figures that out, we can make it happen. But at the same time I'm working on replacing the backend of syntax tree to use prism, so we'll be using a different form of compilation for that.
Activity
JounQin commentedon Jul 23, 2022
Is that possible to compile Ruby as WASM?
kddnewton commentedon Jul 23, 2022
JounQin commentedon Jul 23, 2022
Why not try it out right now?
https://www.ruby-lang.org/en/news/2022/04/03/ruby-3-2-0-preview1-released/
Is there anything preventing us?
When it's already compiled into WASM, no ruby runtime is required.
kddnewton commentedon Jul 26, 2022
Right... I don't know what I was talking about. I will try this!
JounQin commentedon Jul 26, 2022
Besides, in case of handling asynchronous due to WASM, you can try https://github.com/un-ts/synckit to turn it synchronously again!
kddnewton commentedon Aug 5, 2022
So this now works in https://github.com/ruby-syntax-tree/node-syntax-tree. Except that it doesn't support RBS yet, because it's very difficult to compile non-bundled native extensions: https://twitter.com/kateinoigakukun/status/1555202638064799750?s=20&t=9wXaP7QoPngehSIujvUGFw.
The other difficulty is that loading WASM requires an async call, so we still are blocked on that. Fortunately that's changing in v3 of prettier prettier/prettier#13142.
I think the answer for now is going to be waiting for prettier v3 and waiting on/working on support for non-bundled native extensions for WASI.
JounQin commentedon Aug 5, 2022
@kddnewton Did you tried this one? Of course waiting for
prettier@v3is another solution. 😅kddnewton commentedon Aug 5, 2022
@JounQin I did! I couldn't get it to work. To be honest I'm not sure what I was doing wrong, but it would just hang no matter what I tried.
JounQin commentedon Aug 5, 2022
@kddnewton Can you provide a branch so I can offer some help?
At least you can try
SYNCKIT_TIMEOUTenv to see what's wrong.And the problem may be fixed by un-ts/synckit#94
kddnewton commentedon Aug 10, 2022
@JounQin sure! The branch is here: https://github.com/prettier/plugin-ruby/tree/synckit.
JounQin commentedon Aug 10, 2022
I haven't looked into details yet, but the root issue could be
23f2089#diff-598b75d6dc772eb13aa7141f35bb93046ae26c58a97e8647ecf7f74aec8ae93fR2
It does not need/should be called immediately
I'll clone and check quickly.
kddnewton commentedon Aug 10, 2022
Nice, now I'm just getting some cloning errors.
kddnewton commentedon Aug 10, 2022
Okay @JounQin we're back to hanging now
JounQin commentedon Aug 10, 2022
See
Besides, you'd better upgrade to
synckit@0.8.2which propagates sync errors from worker, it'll handle some unexpected sync errors.JounQin commentedon Aug 10, 2022
@kddnewton
f1d1937#diff-a19812fe5175f5ae8fccdf2c9400b66ea4408f519c4208fded5ae4c3365cac4dR1
3 remaining items
kddnewton commentedon Sep 19, 2022
Yes please! If you could help me get https://github.com/ruby-syntax-tree/node-syntax-tree to compile the RBS plugin as well - which is the only blocker, then I could ship this using the WASM code and it would be totally good to go.
kddnewton commentedon Oct 18, 2022
Moving this issue over to
node-syntax-treehere: ruby-syntax-tree/node-syntax-tree#43.JounQin commentedon Nov 20, 2023
I saw ruby-syntax-tree/node-syntax-tree#43 is marked as completed, but https://github.com/ruby-syntax-tree/node-syntax-tree itself is archived, is this supported already? @kddnewton
kddnewton commentedon Nov 20, 2023
Not really - I'm just giving up on that possibility to be honest. The issue is RBS compilation into WASM. If someone figures that out, we can make it happen. But at the same time I'm working on replacing the backend of syntax tree to use prism, so we'll be using a different form of compilation for that.
JounQin commentedon Nov 20, 2023
I'd like to give it a try when I'm free. Can you assign this issue to me and reopen it?
Reference https://ruby.github.io/ruby.wasm
kddnewton commentedon Nov 21, 2023
Done
kddnewton commentedon Jan 29, 2024
@alan-pie I'm not sure what you mean. This is an enhancement, the plugin itself functions just fine.
JounQin commentedon Jan 30, 2024
There're 3 options, dropping is the worst, I'm going to add this feature while I'm focusing on other projects these days.
Plaese be patient, or even better, join to help.