Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would you be willing to provide an STC playground? #1021

Open
2 of 6 tasks
sunrabbit123 opened this issue May 12, 2023 · 4 comments
Open
2 of 6 tasks

Would you be willing to provide an STC playground? #1021

sunrabbit123 opened this issue May 12, 2023 · 4 comments

Comments

@sunrabbit123
Copy link
Collaborator

sunrabbit123 commented May 12, 2023

When creating a contribution or issue, it would be nice to have a place to look up the most recent STC and write test cases more easily.
You can more easily check if an existing case is a working case or not.

Like how we use Typescript Playground to check types.

This would make it easier to submit issues without having to build and test the STC yourself.

Tasks

  1. good first issue
@kdy1 kdy1 added this to the v0.0.1: Correctness milestone May 18, 2023
@kdy1
Copy link
Member

kdy1 commented May 18, 2023

I want to, but this is a very complex task..

@phoenix-ru
Copy link

What needs to be done to make it possible? Afaik, there is an LSP setup with VSCode. Maybe this can be done the same way as SWC playground with the nightly build of STC as a plugin?

@kdy1
Copy link
Member

kdy1 commented Jun 3, 2023

Code would be almost similar, but we should publish Wasm files

@sunrabbit123
Copy link
Collaborator Author

Do you need to do something like #300 ?
If so, do you use wasm-bindgen instead of napi-rs?

kdy1 pushed a commit that referenced this issue Oct 6, 2023
**Description:**

This PR implements checker behaviors for `wasm` binding. By supporting wasm, implementing playground will become very easy. I also implemented PoC of playground and it works well. I'll contribute on that when this PR is ready and merged.

Due to the constraints of wasm, there is a few APIs that should not be used. Below is the list.

- `std::time::Instant`
- `mimalloc_rust` from `swc_node_base`
- All file-system related APIs.

We dropped some code to avoid use of the APIs, and this PR contains those changes. I marked this PR as draft; we have to manage them somehow before merge it.

**Related issue:**

 - #300
 - #1021
sunrabbit123 pushed a commit to sunrabbit123/stc that referenced this issue Oct 10, 2023
**Description:**

This PR implements checker behaviors for `wasm` binding. By supporting wasm, implementing playground will become very easy. I also implemented PoC of playground and it works well. I'll contribute on that when this PR is ready and merged.

Due to the constraints of wasm, there is a few APIs that should not be used. Below is the list.

- `std::time::Instant`
- `mimalloc_rust` from `swc_node_base`
- All file-system related APIs.

We dropped some code to avoid use of the APIs, and this PR contains those changes. I marked this PR as draft; we have to manage them somehow before merge it.

**Related issue:**

 - dudykr#300
 - dudykr#1021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants