Giter VIP home page Giter VIP logo

Comments (8)

l7ssha avatar l7ssha commented on June 12, 2024

We are not supporting browser as a target since it requires a lot of additional workarounds and maintenance for it to work. You can use it on flutter with android target and on cli just fine.

from nyxx.

abitofevrything avatar abitofevrything commented on June 12, 2024

@RandomModderJDK this looks more like a compiler bug than something on our end. Either way we do not support js as a target, as l7ssha said.

from nyxx.

RandomModderJDK avatar RandomModderJDK commented on June 12, 2024

Why does nyxx even use components that are not functional in the web. The discord api doesnt benefit from platform specific features in particular except from audio features.

What would be needed to make it completely platform independent?

from nyxx.

abitofevrything avatar abitofevrything commented on June 12, 2024

Nyxx uses isolates to implement sharding, as recommended by discord, and dart:io in several places to implement helpers. We also use dart:io in the isolates to speed up decoding.

If you really want to run nyxx in the web, I can patch these out and push them to my fork that you can use from a git dependency. We will not be merging these changes, or any changes aimed only at adding web support to this repository as it complicated several aspects of the code, would probably be breaking, adds dependencies on other packages and isn't something we recommend doing anyway.

from nyxx.

RandomModderJDK avatar RandomModderJDK commented on June 12, 2024

That would be really kind of you

from nyxx.

abitofevrything avatar abitofevrything commented on June 12, 2024

Alright, I've made the necessary changes.

I really don't recommend using it because it disables several features (including the IgnoreExceptions and CliIntegration plugins) and restricts other parts of the API (e.g transport compression can't be used, so you'll have to choose something else when connecting to the API). Additionally I had to route all requests through a CORS proxy because Discord, sensibly, doesn't manage CORS on their API which makes browsers unable to use it.

The proxy is hosted on a cloudflare worker, and I'm making no guarantees as to its stability or longevity. If it goes down, nyxx won't be able to contact the Discord API and your application will stop working. I really recommend you change this and use your own proxy that you host - and if you can do that, why not just run nyxx on that server?

Anyway, with all that said, the code can be found here and depended on using a git dependency targeting https://github.com/abitofevrything/nyxx and ref: hack/web-support.

from nyxx.

Related Issues (20)

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.