dudykr / stc

Speedy TypeScript type checker
https://stc.dudy.dev
Apache License 2.0
5.77k stars 166 forks source link

feat: (PoC) impl wasm support for playground. #1082

Closed AcrylicShrimp closed 1 year ago

AcrylicShrimp commented 1 year ago

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.

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

Task

sunrabbit123 commented 1 year ago

@kdy1 If this issue passes, I think we should create an stc-playground repository.

github-actions[bot] commented 1 year ago

Thank you for the PR! Commit: 6c89827b115226be3766db6e771dc1b6d8ee225d

Files to check

These are files which is affected by the current PR, but not reflected. If there's no file below this message, please ignore this message.

You can run ./scripts/auto-unignore.sh from crates/stc_ts_file_analyzer for typescript files, and ./scripts/check.sh from crates/stc_ts_type_checker for *.stats.rust-debug files.

sunrabbit123 commented 1 year ago

@AcrylicShrimp Can you resolve clippy error and rebase?

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 6c89827b115226be3766db6e771dc1b6d8ee225d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

AcrylicShrimp commented 1 year ago

I resolved all problems. Should I do rebase? @sunrabbit123

sunrabbit123 commented 1 year ago

Resolved with commit(7dc35c8a8a0d64703ab152e). Thank you.

May I ask for a review? @kdy1

sunrabbit123 commented 1 year ago

I checked the related issue I think a name similar to stc_playground_wasm would be better than binding-wasm.

kdy1 commented 1 year ago

I think a name similar to stc_playground_wasm would be better than binding-wasm.

I agree with this. In my experience, we will want many APIs for the playground not exposed to normal wasm bindings