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

Added Wasmer Js API #2460

Merged
merged 112 commits into from
Jul 24, 2021
Merged
Show file tree
Hide file tree
Changes from 108 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
430113d
Added basic example of Wasmer-js
syrusakbary Jun 22, 2021
caacec6
Updated README
syrusakbary Jun 22, 2021
ea4682f
Simplified README
syrusakbary Jun 22, 2021
45053d6
Improved READMEs
syrusakbary Jun 22, 2021
90f8f4b
Improved instrucitons on how to compile to wasm
syrusakbary Jun 22, 2021
82e2cf8
Improved instance test
syrusakbary Jun 22, 2021
f52a44d
Added support for calling functions
syrusakbary Jun 22, 2021
91b2427
Added partial support for function imports
syrusakbary Jun 23, 2021
b326903
Imported native functions now work!
syrusakbary Jun 23, 2021
6a40185
Added proof of concept of function bindings
syrusakbary Jun 23, 2021
25907c4
Enable ptr
syrusakbary Jun 23, 2021
6696877
Improved wasmer types
syrusakbary Jun 23, 2021
3d841a6
Improved function usage
syrusakbary Jun 23, 2021
0db591a
Skip wasm-opt for now
syrusakbary Jun 23, 2021
756a2a2
Added ptr api
syrusakbary Jun 24, 2021
1fae2ed
Make all tests pass
syrusakbary Jun 24, 2021
5cc350f
Simplified API
syrusakbary Jun 24, 2021
6d72966
Use wasmer_js for now in the derive
syrusakbary Jun 24, 2021
d300a1b
Merge branch 'features-cell' into js-api
syrusakbary Jun 24, 2021
5451d71
Fix syntax again
syrusakbary Jun 25, 2021
0d84e33
Updated js-api to latest
syrusakbary Jul 12, 2021
d25b2cb
Improved compilation
syrusakbary Jul 12, 2021
2c75468
Improved type reflection
syrusakbary Jul 13, 2021
ee006c3
Improved memory type
syrusakbary Jul 13, 2021
447a60b
Fix typo
syrusakbary Jul 13, 2021
38ed46b
Added reflection API
syrusakbary Jul 13, 2021
92755a0
Removed unused code
syrusakbary Jul 13, 2021
1154601
Fixed linting
syrusakbary Jul 13, 2021
9b76bae
Added Wasmer-JS workflow
syrusakbary Jul 13, 2021
87ae2ff
Improved memory & function comparison
syrusakbary Jul 13, 2021
226f985
Improved tests readability
syrusakbary Jul 13, 2021
f46b01c
Improved tests clarity
syrusakbary Jul 13, 2021
a55f157
Added partial support for tables
syrusakbary Jul 13, 2021
83d061d
Fixed lints
syrusakbary Jul 13, 2021
c6d25ff
Improved API further
syrusakbary Jul 13, 2021
a4d4b3f
Commented main file
syrusakbary Jul 13, 2021
0735a5e
Added support for Globals
syrusakbary Jul 13, 2021
e674afe
Added extra test
syrusakbary Jul 13, 2021
75b7554
Fixed memory grow
syrusakbary Jul 13, 2021
07e7ed5
Improved README
syrusakbary Jul 13, 2021
4a21652
Improved size guides
syrusakbary Jul 13, 2021
70eaf70
Added support for dynamic functions
syrusakbary Jul 14, 2021
4a3be47
Merge branch 'js-api' of github.com:wasmerio/wasmer into js-api
syrusakbary Jul 14, 2021
e7670b5
Added full support for dynamic functions
syrusakbary Jul 14, 2021
917667a
Native function now works fully
syrusakbary Jul 14, 2021
cb77e65
Fixed linting
syrusakbary Jul 14, 2021
47ffb54
Fixed lint and errors
syrusakbary Jul 14, 2021
1729ab9
Trying to fix lint issues
syrusakbary Jul 14, 2021
bd2cc94
Cleaned unused code
syrusakbary Jul 14, 2021
d5789aa
Fixed tests added extra native function test
syrusakbary Jul 14, 2021
f01c9af
Fixed lint
syrusakbary Jul 14, 2021
841509c
Fixed lint again
syrusakbary Jul 14, 2021
b9b678c
Merge branch 'master' into js-api
syrusakbary Jul 14, 2021
ecbd026
Added full support for custom RuntimeErrors. Fixed warnings
syrusakbary Jul 14, 2021
bfbd088
Added custom error test
syrusakbary Jul 14, 2021
66ff6b4
Apply suggestions from code review
syrusakbary Jul 14, 2021
8c7ba37
Uncomment code
syrusakbary Jul 14, 2021
aedadf6
Merge branch 'js-api' of github.com:wasmerio/wasmer into js-api
syrusakbary Jul 14, 2021
983190c
Fixed issues
syrusakbary Jul 14, 2021
93b8411
Improved code based on feedback
syrusakbary Jul 14, 2021
40df445
Improved traps, now fully working
syrusakbary Jul 14, 2021
27b2218
Fix wasmer-derive to optionally depend from wasmer_js
syrusakbary Jul 14, 2021
fb461c3
Fixed lint
syrusakbary Jul 14, 2021
8047e3e
Addressed feedback
syrusakbary Jul 14, 2021
ed9134a
Improved traps
syrusakbary Jul 15, 2021
a2bae12
Added extra instruction for wasmer-js
syrusakbary Jul 15, 2021
7195a9c
Fixed errors and warnings
syrusakbary Jul 15, 2021
88ff6b8
Improved wasmer-js debugging
syrusakbary Jul 15, 2021
fe04ea8
Added WebAssembly Module converter
syrusakbary Jul 16, 2021
98481f5
Move ModuleInfo to wasmer-types
syrusakbary Jul 16, 2021
be54645
Use types Module
syrusakbary Jul 16, 2021
7d63e09
Removed duplicated iterator
syrusakbary Jul 16, 2021
76ea96a
[compiler] simplified codebase (we can factor this out)
syrusakbary Jul 16, 2021
c8bd30d
Simplified polyfill
syrusakbary Jul 16, 2021
5746be8
Revert "[compiler] simplified codebase (we can factor this out)"
syrusakbary Jul 16, 2021
dcd9105
Uncommented test
syrusakbary Jul 16, 2021
e9a4da2
Fixed import
syrusakbary Jul 17, 2021
32d15be
Update README.md
syrusakbary Jul 17, 2021
3e89b7d
Fixed syntax
syrusakbary Jul 17, 2021
a589020
Update lib/js-api/README.md
syrusakbary Jul 17, 2021
2912d20
Update lib/js-api/src/cell.rs
syrusakbary Jul 17, 2021
1e67623
Last round of fixes
syrusakbary Jul 17, 2021
c6b5fe0
Fixed linting
syrusakbary Jul 19, 2021
0537b63
Merge branch 'master' into js-api
syrusakbary Jul 19, 2021
6de3272
Comment problematic tests
syrusakbary Jul 19, 2021
0edd115
Merge branch 'js-api' of github.com:wasmerio/wasmer into js-api
syrusakbary Jul 19, 2021
48d32f2
Commented failing test
syrusakbary Jul 22, 2021
4ae1b77
Apply suggestions from code review
syrusakbary Jul 22, 2021
c398cae
Fix breaking change
syrusakbary Jul 22, 2021
14bd3cb
Update lib/js-api/src/externals/function.rs
syrusakbary Jul 22, 2021
17cf814
Update lib/js-api/tests/externals.rs
syrusakbary Jul 22, 2021
290358d
Update lib/js-api/src/externals/function.rs
syrusakbary Jul 22, 2021
14c75e7
Fixed RuntimeError start when instantiating wasmer-js
syrusakbary Jul 22, 2021
3117db4
Improved comments
syrusakbary Jul 22, 2021
e429b57
Fix linting
syrusakbary Jul 23, 2021
00a23f0
Merge branch 'js-api' of github.com:wasmerio/wasmer into js-api
syrusakbary Jul 23, 2021
6b2ec72
Added support for no-std
syrusakbary Jul 23, 2021
b302848
feat(api) Merge `js-api` into `api`.
Hywan Jul 23, 2021
9bc0910
feat(api) Remove all references to `wasmer-js`.
Hywan Jul 23, 2021
0ea1993
fix(api) Fix `cargo fmt`.
Hywan Jul 23, 2021
8a5caa3
feat(api) Use the same version of `hashbrown` than what we have in deps.
Hywan Jul 23, 2021
36c4f92
fix(api) Use the `sys` feature when no default features is enabled.
Hywan Jul 23, 2021
5bfd45e
doc(api) Update documentation.
Hywan Jul 23, 2021
fcc9e74
feat(api) Set crate-type only if `js` feature is turned on.
Hywan Jul 23, 2021
bc4ffb4
doc(api) Update the `README.md`.
Hywan Jul 23, 2021
3239fe4
doc(api) Improve the crate documentation.
Hywan Jul 23, 2021
9a5a10f
doc(api) Polish.
Hywan Jul 23, 2021
d3930be
Merge pull request #2489 from wasmerio/js-api-into-api
syrusakbary Jul 23, 2021
3e04015
Fixed serde dependency
syrusakbary Jul 23, 2021
1fa19a2
Improved styling for readability
syrusakbary Jul 23, 2021
58350e3
Improved wasmer api in js
syrusakbary Jul 23, 2021
124672e
Added std to js-default
syrusakbary Jul 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
push:
branches:
- 'master'
- 'staging'
- 'trying'
tags:
# this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '[0-9]+.[0-9]+.[0-9]+*'

name: wasmer-js tests

env:
RUST_BACKTRACE: 1

jobs:
wasmer-js:
name: wasmer-js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Test wasmer-js
run: make test-js
syrusakbary marked this conversation as resolved.
Show resolved Hide resolved
57 changes: 57 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ test-packages:
cargo test --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std
cargo test --manifest-path lib/cli/Cargo.toml $(compiler_features) --release

test-js:
syrusakbary marked this conversation as resolved.
Show resolved Hide resolved
cd lib/api && wasm-pack test --node -- --no-default-features --features js-default,wat


#####
#
# Testing compilers.
Expand Down
2 changes: 2 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ composed of a set of crates. We can group them as follows:
programatically through the `wasmer` crate,
* `c-api` — The public C API exposes everything a C user needs to use
Wasmer programatically,
* `js-api` — The public JavaScript API exposes everything a user needs to run Wasmer
in a client like a browser or on a server like NodeJS or Deno,
* `cache` — The traits and types to cache compiled WebAssembly
modules,
* `cli` — The Wasmer CLI itself,
Expand Down
Loading