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

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

Open
h0lybyte opened this issue Jan 16, 2024 · 7 comments
Open

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

h0lybyte opened this issue Jan 16, 2024 · 7 comments
Labels
1 Level 1 backlog This issue is postpone. bug Something isn't working

Comments

@h0lybyte
Copy link
Member

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:

  • [A] - Pulling the NX Report MDX and rendering it.
  • [B] - Rendering the KBVE Logo as an image.
  • [C] - Login into KBVE API.

Current Problems:

  • [1] - erust - Migrating the states out of applicationstate.rs and into a nested state structure, with concurrency.
  • [2] - Reference [C] Test Case - Setting up the ehttp or egui_extras to test case the form.
  • [3] - Pipeline rust-wasm-embed - Build the application and pull request the files into kbve.com/public/embed/rust-wasm-embed for distribution / test casing.

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 h0lybyte added 0 Neutral Level enhancement New feature or request labels Jan 16, 2024
@h0lybyte h0lybyte added this to KBVE Jan 16, 2024
@h0lybyte h0lybyte moved this to Theory in KBVE Jan 16, 2024
@h0lybyte h0lybyte added 2 Level 2 staging This item is in progress. and removed 0 Neutral Level enhancement New feature or request labels Jan 16, 2024
@h0lybyte h0lybyte moved this from Theory to Staging in KBVE Jan 16, 2024
@h0lybyte
Copy link
Member Author

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
Copy link
Member Author

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 h0lybyte added 4 Level 4 and removed 2 Level 2 labels Feb 21, 2024
@h0lybyte
Copy link
Member Author

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 h0lybyte added 1 Level 1 bug Something isn't working and removed staging This item is in progress. labels Mar 21, 2024
@h0lybyte h0lybyte moved this from Staging to Error in KBVE Mar 21, 2024
@h0lybyte
Copy link
Member Author

h0lybyte commented Mar 21, 2024

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 h0lybyte removed the 4 Level 4 label Mar 21, 2024
@h0lybyte
Copy link
Member Author

Current progress on the theme can be found here on this issue ticket -> emilk/egui#3284

@h0lybyte h0lybyte added the backlog This issue is postpone. label Jul 22, 2024
@h0lybyte h0lybyte moved this from Error to Backlog in KBVE Jul 22, 2024
@h0lybyte
Copy link
Member Author

h0lybyte commented Aug 5, 2024

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
Copy link
Member Author

h0lybyte commented Aug 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 Level 1 backlog This issue is postpone. bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant