oxc-project / playground

Oxc Playground
https://playground.oxc.rs
MIT License
20 stars 7 forks source link

playground: click on AST to view the corresponding code #30

Open heygsc opened 2 months ago

heygsc commented 2 months ago

In the previous playground, clicking on 'ast' could find the corresponding code, which was very comfortable to use, but it seems that the current new playground does not have it.

image
Boshen commented 2 months ago

I find monaco editor hard to work with, do you think we should restore the previous codemirror @DonIsaac @sxzz ? Monaco is also too large and slow to load.

sxzz commented 2 months ago

For better UX, I would say it's worth it. Additionally, most of the loading time is for the wasm file.

It can be implemented. You can refer to https://ast.sxzz.moe/

heygsc commented 2 months ago

Yes, wasm loading often takes time.

DonIsaac commented 2 months ago

Could be worth it. I have more experience with Monaco than I do with codemirror, but if it's super problematic then we should.

What are the downsides of a switch to codemirror?

IWANABETHATGUY commented 2 months ago

Maybe we could upload .wasm to cdn, just like swc playground image

sxzz commented 2 months ago

That's also why I suggest boshen to publish wasm to npm. We can even change the oxc version for testing regression issue.

sxzz commented 2 months ago

Given the complexity of the feature and its completion on ast.sxzz.moe, I might extract the AST Tree Viewer as a Vue component for easy reuse in oxc.

pumano commented 1 month ago

very useful feature but not by click, but by hover as https://ast.sxzz.moe/ or https://astexplorer.net/