+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Conversation

leops
Copy link
Contributor

@leops leops commented Aug 5, 2022

Summary

Fixes #3012

This PR refactors the Playground to use the WASM bindings to the Workspace API. These bindings currently live in the playground crate itself along with a few utilities, but I plan on eventually moving this code out into its own crate in a later refactor (as part of the Node API umbrella).

The core of the change is relatively simple, and only requires adding a few methods to the workspace in order to access the internal debug representations rendered by the playground (like the formatter IR or the control flow graph). The WASM binding glue is implemented over the existing serde implementations for all the Workspace-related types, using the serde-serialize feature of wasm-bindgen. Unfortunately since these types go through serialization they are represented as untyped any values in the generated TypeScript definitions for the bindings (#3031 will add auto-generated definitions for these)

Test Plan

Many of the changes are statically checked or execute at compile time, but unfortunately the playground doesn't really any testing infrastructure in place so that will have to be manually tested in the PR deployment

@leops leops force-pushed the feature/playground-cfg branch from 5065d24 to 3290451 Compare August 8, 2022 07:25
Base automatically changed from feature/playground-cfg to main August 8, 2022 11:15
@ematipico
Copy link
Contributor

ematipico commented Aug 8, 2022

Is there any chance that we could move the schema generation changes in a separate PR?

@leops leops force-pushed the refactor/playground-workspace branch from 9b48486 to b153dbc Compare August 8, 2022 16:03
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 8, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85d3a22
Status: ✅  Deploy successful!
Preview URL: https://ba4988e7.tools-8rn.pages.dev
Branch Preview URL: https://refactor-playground-workspac.tools-8rn.pages.dev

View logs

@leops leops temporarily deployed to aws August 8, 2022 16:03 Inactive
@leops
Copy link
Contributor Author

leops commented Aug 8, 2022

Is there any chance that we could move the schema generation changes in a separate PR?

Sure, the PR is already split into two different commit so that should be easy enough to do

@leops leops force-pushed the refactor/playground-workspace branch from b153dbc to 0e89c0a Compare August 8, 2022 16:05
@leops leops temporarily deployed to aws August 8, 2022 16:05 Inactive
@leops leops marked this pull request as ready for review August 8, 2022 16:11
@leops leops requested review from ematipico and xunilrj as code owners August 8, 2022 16:11
@leops leops requested a review from a team August 8, 2022 16:11
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 395 395 0
Failed 5551 5551 0
Panics 0 0 0
Coverage 6.64% 6.64% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12397 12397 0
Failed 3860 3860 0
Panics 0 0 0
Coverage 76.26% 76.26% 0.00%

@leops leops temporarily deployed to aws August 9, 2022 09:38 Inactive
@leops leops temporarily deployed to aws August 10, 2022 08:46 Inactive
@leops leops requested review from MichaReiser and ematipico August 10, 2022 08:57
@leops leops merged commit 8b80b13 into main Aug 10, 2022
@leops leops deleted the refactor/playground-workspace branch August 10, 2022 14:06
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 10, 2022
…s for the workspace (rome#3018)

* refactor(playground): refactor the playground to use the WASM bindings for the workspace

* address PR review

* unify the capabilities variable names
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
…s for the workspace (rome#3018)

* refactor(playground): refactor the playground to use the WASM bindings for the workspace

* address PR review

* unify the capabilities variable names
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
…s for the workspace (rome#3018)

* refactor(playground): refactor the playground to use the WASM bindings for the workspace

* address PR review

* unify the capabilities variable names
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
…s for the workspace (rome#3018)

* refactor(playground): refactor the playground to use the WASM bindings for the workspace

* address PR review

* unify the capabilities variable names
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wire the playground and the workspace

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载