-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1297 from polywrap/issue-900-wasm-rs-print-macros
feat: wasm/rs support println! & print! macros
- Loading branch information
Showing
8 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/test-cases/cases/wrappers/wasm-rs/println-logging/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "query" | ||
version = "0.1.0" | ||
description = "Query module of bigint-type e2e test" | ||
authors = [ | ||
"Kobby Pentangeli <kobbypentangeli@gmail.com>", | ||
"Jordan Ellis <jelli@dorg.tech>" | ||
] | ||
repository = "https://github.com/polywrap/monorepo" | ||
license = "MIT" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
polywrap-wasm-rs = { path = "../../../../../wasm/rs" } | ||
serde = { version = "1.0", features = ["derive"] } | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[profile.release] | ||
opt-level = 's' | ||
lto = true | ||
panic = 'abort' |
6 changes: 6 additions & 0 deletions
6
packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.build.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
format: 0.1.0 | ||
docker: | ||
name: println-logging-wasm-rs | ||
linked_packages: | ||
- name: polywrap-wasm-rs | ||
path: ../../../../../wasm/rs |
9 changes: 9 additions & 0 deletions
9
packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
format: 0.2.0 | ||
project: | ||
name: println-logging | ||
type: wasm/rust | ||
source: | ||
schema: ./schema.graphql | ||
module: ./Cargo.toml | ||
extensions: | ||
build: ./polywrap.build.yaml |
5 changes: 5 additions & 0 deletions
5
packages/test-cases/cases/wrappers/wasm-rs/println-logging/schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type Module { | ||
logMessage( | ||
message: String! | ||
): Boolean! | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/test-cases/cases/wrappers/wasm-rs/println-logging/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub mod wrap; | ||
pub use wrap::*; | ||
|
||
pub fn log_message(args: ArgsLogMessage) -> bool { | ||
let message = args.message.as_str(); | ||
|
||
println!("{}", message); | ||
print!("{}", message); | ||
|
||
true | ||
} |