-
Notifications
You must be signed in to change notification settings - Fork 7
Init commit create react app with react-app-rewired #12
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
Conversation
By spending to a wallet address. The node must be started with `-blindedaddresses=1`. I've configured it to be the default value since we are always working with confidential transactions. Doing the same for non-Bitcoin outputs is left as a TODO.
This is helpful because we sometimes need to peek at the next value to deserialize the right thing.
The previous model was to flexible in that it allowed to express states that were not actually possible (like explicit value but confidential asset).
Make better use of the type system
Instead of accepting free-form entropy, we pass an rng argument that makes it obvious that this function depends on randomness to produce sane outputs.
This is more concise than calling `ok_or_else` if we are always constructing an anyhow::Error anyway.
Format everything with dprint
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.
Thanks for getting this bootstrapped!
I think we should also add CI scripts right away to make sure we are not accidentally breaking stuff again.
Cargo.toml
Outdated
@@ -1,2 +1,2 @@ | |||
[workspace] | |||
members = [ "elements-harness", "swap", "elements-fun" ] | |||
members = [ "elements-harness", "swap", "elements-fun", "waves/src/native" ] |
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.
Is waves
really such a good name considering there is a whole blockchain ecosystem named like that?
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.
Happy to rename it :) Back to Greek god names?
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); |
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 would be interested in keeping this! Can we pass console.log
here so that we can see how the usage of wasm
affects performance? Might also be interesting in regards to the async/sync import story.
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.
This produces quite some noise in the logs though. I'll leave it for now to keep the console clean.
8e4dc08
to
9ed3f4e
Compare
9ed3f4e
to
1cf142e
Compare
2a71332
to
24e25d2
Compare
superseded by: #13 |
Why not just rebase onto latest master instead of closing? |
What is this?
This adds a new
waves
folder which is a react app using a rust wasm library combined with webpack.my-app
was creating using create-react-app.However, this would not let us configure webpack (which is the reason we went for create-react-app in the first place).
Hence we use
react-app-rewired
and created aconfig-override.js
The library
wasm_lib
was created usingwasm-pack new
.It showcases a single method to return hello world and a function to initialize a logger.
Issues
So far I like the setup, it has one caveat though: if we want to add
native
as a dependency inpackage.toml
then a rebuild is not automatically reloaded. File-based import work though.How to
Go into
my-app
and typefollowed by
to start in development mode. You can then make changes in the rust library under
native
and the code should automatically rebuild and reload.Enjoy :)