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

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

Merged
merged 9 commits into from
Oct 6, 2023
Merged

Conversation

AcrylicShrimp
Copy link
Contributor

@AcrylicShrimp AcrylicShrimp commented Sep 8, 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

Task

@sunrabbit123
Copy link
Collaborator

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

@sunrabbit123 sunrabbit123 added the good first issue Good for newcomers label Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Thank you for the PR!
Commit: 6c89827

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.

crates/binding_wasm/src/lib.rs Outdated Show resolved Hide resolved
crates/binding_wasm/src/lib.rs Outdated Show resolved Hide resolved
@sunrabbit123
Copy link
Collaborator

sunrabbit123 commented Oct 6, 2023

@AcrylicShrimp
Can you resolve clippy error and rebase?

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2023

⚠️ No Changeset found

Latest commit: 6c89827

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
Copy link
Contributor Author

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

@sunrabbit123
Copy link
Collaborator

Resolved with commit(7dc35c8a8a0d64703ab152e). Thank you.

May I ask for a review? @kdy1

@sunrabbit123
Copy link
Collaborator

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

@kdy1
Copy link
Member

kdy1 commented Oct 6, 2023

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

@AcrylicShrimp AcrylicShrimp marked this pull request as ready for review October 6, 2023 05:57
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kdy1 kdy1 merged commit bec48ce into dudykr:main Oct 6, 2023
7 checks passed
sunrabbit123 pushed a commit to sunrabbit123/stc that referenced this pull request 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

Successfully merging this pull request may close these issues.

3 participants