first update report on module 1, adding more reference links

This commit is contained in:
itzelot01 2024-01-30 22:47:18 +00:00
parent ed4ed8c95e
commit 74e14dabd6
1 changed files with 29 additions and 0 deletions

View File

@ -21,6 +21,31 @@ systems. This module is important to ensure frontend decentralization.
## Report
* Upon doing reaserch on helia, we found that some of the methods on implementing JavaScript on Rust with callback and using yew have problems with the
imports of Helia.
The following are issues found with the different methods:
1. With web-pack: While trying to import Helia's libraries on a previosly working app using callback to implement JavaScript on a yew template, we
stumbled upon an error in which we couldn't install the Helia library due to there being too many packages.
Possible solutions implemented:
- Importing Helia from the import link instead of installing the library, though one of the problems with this solution is that you can't do imports
and at the same time export a function with the JS callback on Rust. It was necessary to first import the Helia library and then use it for the export function.
- Adding the import links to the index.html like script modules.
2. After not finding a concrete solution that would help us with the import, I decided to follow the yew tutorial drive through libraries that was very well
documented but a little outdated since it was using yew version 12. Now the problem was the it had two errors that wouldn't let me run the app.
Specific errors found:
* error [E0433]: failed to resolve: unresolved import (a function from the wasm-bindgen.rs that comes from the version of wasm-bindgen that you installed)
* error [E0425]: cannot find the function 'wasm_bindgen_initialized' in this scope (also coming from wasm-bindgen.rs)
Possible solutions implemented:
- Updating to the newest version of wasm_bindgen.
- Trying to change the imports of wasm_bindgen.
- Adding the dependency to de Cargo.toml file.
> None of these solutions worked
3. Currently using the yew-interop to asynchronously Load CSS or Javascript libraries which allows you to import libraries from links and also implements
JavaScript scripts to Rust.
Using the example provided in the examples GitHub repository to know how to have the correct structure and succesfully import everything necessary for the app.
### HELIA Specification
* [Helia library](https://github.com/ipfs/helia)[^1]
* [Helia Examples](https://github.com/ipfs-examples/helia-examples/tree/main/examples/helia-webpack)[^2]
@ -54,3 +79,7 @@ security issues.
[^1]: https://github.com/ipfs/helia
[^2]: https://github.com/ipfs-examples/helia-examples/tree/main/examples/helia-webpack
[^3]: https://dev.to/davidedelpapa/yew-tutorial-05-drive-through-libraries-2gj5
[^4]: https://github.com/Madoshakalaka/yew-interop
[^5]: https://github.com/Madoshakalaka/yew-interop/tree/master/example
[^6]: https://rustwasm.github.io/wasm-bindgen/examples/import-js.html