Skip to content

Integrate the Web client library from linera-web #3908

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

Closed
wants to merge 8 commits into from

Conversation

Twey
Copy link
Contributor

@Twey Twey commented May 7, 2025

Motivation

We'd like to be able to test changes to this repo using a Web client.

Proposal

Merge the Rust code from https://github.com/linera-io/linera-web/ into this repository under linera-web/, making the JavaScript @linera/client library available for the Web.

Update it to make it compile:

  • use the linera_core::Environment trait
  • use the linera_base::crypto::Signer trait, just in-memory for now

Test Plan

CI.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@Twey Twey force-pushed the integrate-web branch 2 times, most recently from 730a96b to cbed4ce Compare May 15, 2025 15:30
@Twey Twey marked this pull request as ready for review May 15, 2025 15:48
@Twey Twey force-pushed the integrate-web branch 2 times, most recently from 3220fc6 to 2a4d4a4 Compare May 15, 2025 16:06
Comment on lines +17 to +27
console_error_panic_hook = "0.1.6"
futures = "0.3.30"
js-sys = "0.3"
log = "0.4.21"
nonzero_lit = "0.1.2"
serde = "=1.0.205"
serde-wasm-bindgen = "0.6.5"
tokio-util.workspace = true
tracing = "0.1.40"
wasm-bindgen = "0.2.95"
wasm-bindgen-futures = "0.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we're not grabbing these from the workspace? Or adding it there if it isn't 🤔
That might be what's generating the huge Cargo.lock file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing in a follow-up PR since there might be changes needed to be compatible with the right versions.

Twey and others added 8 commits May 16, 2025 02:28
…-web#16)

* Restructure repository

The client library we expect users to load in Web frontends is built
alongside the browser extension, so the communication protocol between
that library and the extension is now encapsulated: the only public
API we need to keep stable is the TypeScript API of the library, and
developers can pull in the library using their JavaScript package
manager of choice.

The client worker is now its own package independent of the extension:
this should make it easier to build demos like the where the client is
embedded directly into the frontend and the user gets a throwaway
wallet to play with.

* Subscriptions and mutations

* Use release build of Linera

* Add counter example

* CI with Clippy

---------

Co-authored-by: Janito Vaqueiro Ferreira Filho <[email protected]>
* Bump `linera-protocol`

* Update counter example to remove `mutate_application`.
* Create `hosted-counter` example

* Use `linera-protocol` with faucet client crate

* Request application

* Bump `linera-protocol`

* `examples/hosted-counter`: tweak styling

* Cleanup

* Bump `linera-protocol`

This allows us to remove the logic around requesting applications,
since linera-io#3382 makes
this transparent.

* `examples/hosted-counter`: externalize `@linera/client`

* `hosted-counter`: port to mininet

* `hosted-counter`: make more mobile-friendly

* `examples/hosted-counter`: mobile improvements

* `linera-protocol`: avoid deadlocking when reaping tasks

* `examples`: abstract out stylesheet

* `client`: improve error reporting

* Clippy clean the client library

* Fix extension build

* Address review comments
* Hosted fungible example

* `examples/hosted-counter`: fix up style for shared stylesheet

* `hosted-fungible`: improve error handling

* `examples/hosted-fungible`: add copy button

* `client`: update manifest for publishing

* `linera-protocol`: bring to trunk
* Bump `linera-protocol` to `testnet_babbage`

* `client`: port to `testnet_babbage`

* `examples/hosted-fungible`: port to `testnet_babbage`

* `examples/hosted-counter`: port to `testnet_babbage`

* `client`: bump to version `0.14` to match `linera-protocol`
git-subtree-dir: linera-web
git-subtree-mainline: fdb85ae
git-subtree-split: 08892ec
* port to use `linera_base::crypto::Signer` API

* port to use `linera_core::Environment` API

* remove unused dependencies

* exclude from `default-members`
@Twey Twey force-pushed the integrate-web branch from 2a4d4a4 to 42badcb Compare May 16, 2025 01:37
Twey added a commit that referenced this pull request May 16, 2025
* port to use `linera_base::crypto::Signer` API

* port to use `linera_core::Environment` API

* remove unused dependencies

* exclude from `default-members`
@Twey
Copy link
Contributor Author

Twey commented May 16, 2025

Manually merged as 43e6309 (and previous commits: the link between them, and the original linera-web commits, was destroyed because we don't allow merge commits on main)

@Twey Twey closed this May 16, 2025
@@ -0,0 +1 @@
../linera-protocol/toolchains/nightly/rust-toolchain.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these symlinks merged? The path seems wrong, no? Or am I missing something? 🤔
Seeing docker builds fail from main saying these files don't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry! I thought the Docker build here was sufficient to ensure the Docker build off main succeeds. Should be fixed in #3955.

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.

3 participants