-
Notifications
You must be signed in to change notification settings - Fork 64
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
Rename light-client
to web-client
and improve logging for wasm
#1277
Conversation
bfe9ce5
to
c15fd5a
Compare
@@ -1,9 +1,9 @@ | |||
[package] | |||
name = "nimiq-light-client" | |||
name = "nimiq-web-client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should specify this crate only builds for wasm32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[build]
target = "wasm32-unknown-unknown"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, AFAIK this is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking issue: rust-lang/cargo#6179
c15fd5a
to
ef57863
Compare
Codecov ReportBase: 67.56% // Head: 67.57% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## albatross #1277 +/- ##
=============================================
+ Coverage 67.56% 67.57% +0.01%
=============================================
Files 396 397 +1
Lines 50557 50565 +8
=============================================
+ Hits 34157 34170 +13
+ Misses 16400 16395 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Is the reason to rename, as @viquezclaudio indicates, that with the recent changes, this crate only builds for WASM, not for regular targets? Or any other reasoning? |
It will build for other targets but won't run |
Yup... it will panic during runtime if somebody tries to run the binary in not wasm targets, that's why I wanted (if possible) some way or forcing to compile it only for wasm |
As an alternative to restricting valid targets for cargo, we should at least add a README file to the crate that specifies this incompatibility with non-wasm targets as a major warning. |
ef57863
to
e5b2412
Compare
Done. |
Add a web logging feature to the `nimiq-lib` crate that makes use of the `tracing-web` crate.
e5b2412
to
ec6978b
Compare
@@ -0,0 +1,24 @@ | |||
# Nimiq web client | |||
|
|||
This client is a very light client that only includes the necessary dependencies and constructs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will re phrase this:
This is a web-client intended to be used in web browsers only (no WASI support).
Although it can be built for other targets, it will panic if it is executed outside a web browser.
Rename the `light-client` crate to `web-client` and re-write the client code to be `wasm` friendly.
ec6978b
to
a5acd75
Compare
light-client
crate toweb-client
and re-write theclient code to be
wasm
friendly.nimiq-lib
crate that makes use ofthe
tracing-web
crate.Pull request checklist
clippy
andrustfmt
warnings.