Giter Club home page Giter Club logo

Comments (7)

ionspin avatar ionspin commented on May 25, 2024 1

#24 is merged, CI/CD is done and the fix is available in 0.8.6-SNAPSHOT version. Thanks for the contribution that fixed the issue!

from kotlin-multiplatform-libsodium.

ionspin avatar ionspin commented on May 25, 2024

Hi @luca992 , libsodium sumo is the js release of the libsodium library (sumo being the one with more primitives available), and without seeing exactly how you are packaging the final artifacts I don't think I can help, although I'm not an JavaScript expert so even with seeing the way you build the final artifacts I might not be able to help.

You might be right it has to do with webpack 5, I have the following line in my projects gradle.properties to set the webpack to 4:
kotlin.js.webpack.major.version=4

See if that helps.

If that solves the issue I'll add to documentation that webpack 4 is required, and I'll see if I can test with webpack 5 when I have some free time.

from kotlin-multiplatform-libsodium.

luca992 avatar luca992 commented on May 25, 2024

Didn't work.

But, I think the problem is how you get an instance of JsSodiumInterface?
I think JsSodiumInterface should be an external class annotated with @JsModule: https://kotlinlang.org/docs/js-modules.html#jsmodule-annotation

is there any reason you get an instance with js("\$module\$libsodium_wrappers_sumo"), I don't think that is standard practice?

from kotlin-multiplatform-libsodium.

ionspin avatar ionspin commented on May 25, 2024

is there any reason you get an instance with js("$module$libsodium_wrappers_sumo"), I don't think that is standard practice?

When I was writing this code intially @JsModule didn't work and would actually fail with the undefined error.

I had to jump through a lot of hoops to get the js to work at all, the kotlin js compiler was unstable (at the time) and would fail in interesting and creative ways that it required a bunch of workarounds. I currently don't have time to experiment against latest kotlin js compiler, and in multiplatform projects that I am using the library in it works fine (for JS in my case that is browser flavor, I don't have node projects)

With that said, I'd be very happy to accept a pull request that improves this in any way!

from kotlin-multiplatform-libsodium.

luca992 avatar luca992 commented on May 25, 2024

Well, fixed it. 👍 #24

from kotlin-multiplatform-libsodium.

luca992 avatar luca992 commented on May 25, 2024

Not really sure how it works at all in it's current state in your project haha. Calling ready just didn't work at all for me before the module fix I made

from kotlin-multiplatform-libsodium.

ionspin avatar ionspin commented on May 25, 2024

Awesome, thank you very much for the contribution, I'll give it a look, run the tests and get back to you.

from kotlin-multiplatform-libsodium.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.