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

Exclude target_os=wasi from browser #220

Merged
merged 1 commit into from
Jun 26, 2022
Merged

Conversation

bkolobara
Copy link
Contributor

Closes #219

There are many new WebAssembly runtimes intended to be run outside of the browsers. This pull request makes plotters compatible with them.

The main issue is that wasm-bindgen doesn't make sense when the target os is specified as wasi and there is no JavaScript environment. Wasi already exposes low level APIs that can be used instead.

A nice side-effect of this pull request is that you can now choose to compile with target=wasm32-wasi and still run your .wasm file in the browser, but provide a WASI polyfill instead of wasm-bindgen.

@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #220 (77f5823) into master (96d5184) will decrease coverage by 0.20%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
- Coverage   68.83%   68.63%   -0.21%     
==========================================
  Files          56       56              
  Lines        4313     4301      -12     
==========================================
- Hits         2969     2952      -17     
- Misses       1344     1349       +5     
Impacted Files Coverage Δ
src/element/image.rs 0.00% <ø> (ø)
src/style/font/mod.rs 0.00% <ø> (ø)
src/style/size.rs 75.00% <ø> (ø)
src/chart/axes3d.rs 55.78% <0.00%> (-3.16%) ⬇️
src/coord/ranged3d/projection.rs 73.86% <0.00%> (-1.14%) ⬇️
src/chart/series.rs 61.70% <0.00%> (-1.07%) ⬇️
src/chart/mesh.rs 34.78% <0.00%> (-0.97%) ⬇️
src/chart/context.rs 82.83% <0.00%> (-0.47%) ⬇️
src/coord/ranged1d/types/numeric.rs 86.08% <0.00%> (-0.12%) ⬇️
src/data/float.rs 93.75% <0.00%> (-0.10%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96d5184...77f5823. Read the comment docs.

@gilescope
Copy link

Cool as. The more stuff that compiles to wasm the better.

@38 38 merged commit 88ed50e into plotters-rs:master Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for wasm32-wasi target
3 participants