KBVE / kbve

KBVE Monorepo
https://kbve.com/
11 stars 12 forks source link

[Concept] : [Erust] : Rust WASM Embed #510

Open h0lybyte opened 9 months ago

h0lybyte commented 9 months ago

Core Concept/Theory A clear and concise description of what the concept is. Ex. It would be cool if [...]

This issue ticket is to keep track of the erust crate and the application, rust-wasm-embed , which will be built upon the erust crate.

The core idea of this application would be to have a cross-platform WASM as a proof of concept and further learn more using egui / front-end frameworks within Rust.

Test Cases:

Current Problems:

Alternative Ideas Is there any other way this concept could be used?

As of right now, there is not major alternative ideas. I was floating around the concept of extending the WASM out into an expo component? But that might have to be something further down the line.


Alternative Examples/Sources Are there any other references that you can provide?

No examples as of right now, but I will use this issue ticket to keep track of it.


Additional information Add any other context or examples of this concept here.

The erust crate has been released onto crates.io.

h0lybyte commented 9 months ago

Test Casing the proc macros:


#[cfg(test)]
mod tests {
    use super::*;

    // Define TestStruct with both Getters and Setters macros from Holy.
    // This test does not yet support attributes, that is on my TODO list.
    #[derive(Getters, Setters)]
    struct TestStruct {
        field: i32,
    }

    #[test]
    fn test_arithmetic_and_setters_getters() {
        // Perform a mEth operation.
        let arithmetic_result = 2 + 2;
        assert_eq!(arithmetic_result, 4, "Basic arithmetic failed");

        // Create an instance of TestStruct
        let mut instance = TestStruct { field: 0 };

        // Use the setter method to set the value
        instance.set_field(arithmetic_result);

        // Use the getter method to check the value
        assert_eq!(instance.field(), arithmetic_result, "Setter or Getter method failed");
    }
}
h0lybyte commented 9 months ago

1st set of nx commands would be to setup the Nx Trunk WASM build process and any files that would be needed. 2nd set of nx commands would be for the beta branch to deploy the build back into the dev branch, to rotate it back into the pipeline.

This way we can split up the build process but still maintain some level of checks + balances. The SRI would be important to keep track of, so I believe a 3rd command would be to capture the hashes after the main release and update them.

h0lybyte commented 8 months ago

The WASM Embed now deploys to the HerbMail and KBVE!

I will be moving it off of HerbMail within the next couple weeks, as we transition the WASM code into a KBVE tool.

This would then free up the herbmail.com domain, so we can finally open the herb tea shop! Yay!

h0lybyte commented 7 months ago

The WASM seems to be bugged out on the website

Failed to find a valid digest in the 'integrity' attribute for resource 'https://kbve.com/embed/rust/rust_wasm_embed-a81ed02bf1de87da.js' with computed SHA-384 integrity 'XdPQpeVPWB9it9pQMuvNJ7CSFqV7ehOEfj6ttXsISTE+Yyuc3fqtmnYvyaXmKPfL'. The resource has been blocked.

We might have to look into the way the hash and how the integrity is working.

h0lybyte commented 5 months ago

Current progress on the theme can be found here on this issue ticket -> https://github.com/emilk/egui/issues/3284

h0lybyte commented 3 months ago

Note: After the update to the serialization inside the laser package, the next step would be to build out and test the Vec && Uint8Array using the ERust library and this wasm application. This would be our loop around to a problem that took nearly 8 months to resolve xD Migrating the core application data out of localStorage and into the indexedDb. We also have the wasm SQLite option too but that could be the chefs kiss for when it takes 12 months to solve this problem.

h0lybyte commented 3 months ago

Reference Docs: https://docs.rs/tauri/latest/tauri/struct.Builder.html#method.register_uri_scheme_protocol