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

Applications #10

Merged
merged 11 commits into from
Nov 27, 2024
Merged

Applications #10

merged 11 commits into from
Nov 27, 2024

Conversation

Twey
Copy link
Collaborator

@Twey Twey commented Sep 12, 2024

Adds the ability to query application services from Web pages.

  • bumps linera-protocol to a version that supports threading on Wasm
  • moves the client worker into a Manifest v3 offscreen document, where it has access to Web workers
  • splits the client worker API more cleanly into Client (accessible from the extension itself) and Frontend (accessible from Web pages) APIs, removing the need for the dapp_ prefix hack
  • adds an API call Frontend::query_application(&self, application_id: &str, query: &str) for querying application services

@Twey Twey marked this pull request as draft September 12, 2024 15:25
@Twey Twey mentioned this pull request Nov 6, 2024
@Twey Twey force-pushed the 09-12-Applications branch 3 times, most recently from 679c3ac to 7c734b2 Compare November 6, 2024 17:15
@Twey Twey marked this pull request as ready for review November 25, 2024 23:10
typeof typedObj === "object" ||
typeof typedObj === "function") &&
typeof typedObj["target"] === "string" &&
typedObj["type"] === "get_wallet"

Choose a reason for hiding this comment

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

Could the type changed to get_wallet_request?

Copy link
Collaborator Author

@Twey Twey Nov 26, 2024

Choose a reason for hiding this comment

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

I think this field should be read as ‘request type’ rather than ‘object type’. So noting that it's a request is redundant. The fact that it's a request, not a response or some other type of event, should always be clear based on the source of the object — this field exists just to distinguish it from other types of request.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(I'm not super happy with this protocol in general — I'll probably try to move it to Zod in the future. Thankfully in #16 it becomes internal anyway.)

let committee = result?;
let node_provider = client_context.make_node_provider();

let mut validator_versions = HashMap::new();

Choose a reason for hiding this comment

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

Since the HashMap gets serialized into the output, the output could vary from one run to another. So, maybe it is better to use BTreeMap here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's being serialized into a JavaScript object, which anyway doesn't preserve property order — so I don't think it's useful to use a BTreeMap in this case.

client-worker/src/lib.rs Outdated Show resolved Hide resolved
client-worker/src/lib.rs Show resolved Hide resolved
@Twey Twey merged commit 0251cec into linera-io:main Nov 27, 2024
1 check passed
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