Announcement

Collapse
No announcement yet.

Bring.net with custom library

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Bring.net with custom library

    Hello guys,

    i am really impressed of the power of Bridg.net, but i am not 100 percent sure if it does everything I need.
    So I just want to ask here..
    I have a javascript library from a developer that I want to use, see here: https://github.com/Loxone/lxcommunicator
    The problem is, I am not so good at javascript and the more important thing is, I have a lot of C# code that works for me, and I would only need this library to finish my task.
    But I am not sure if this works with Bridge.net and if yes how I can do this with such a library.

    Thanks in advance for your help :)

    #2
    Hello smartlife, and welcome to Bridge.NET forums!

    Glad Bridge sparked your interest for a development platform to rely on, we hope it does!

    I was hoping to find this library in one of the lots we have from the Retyped project, but unfortunately there is not. I'm not sure what this library is for but, maybe you can find another that fits your requirements by searching the list of supported Retyped libraries (in the link right up).

    As far as you get comfortable with this lxcommunicator API at least, you should be able to wrap up prototypes for Bridge and build your own wrapper for the library, but this might require some javascript knowledge to know what you want to call in javascript (client-side) when you write some code in C#.

    I believe the simplest project that would help give you an overview of how the calls can be prototyped in C# to make proper calls on JavaScript are in our WebGL library. It basically consists on C# bindings to make the JavaScript's WebGL calls when the code is run in web browsers. You can also check the other framework implementations next to it in our github repository.

    Where your C# libraries are concerned, as far as you are also building them, you should be fine. That is, in order for library calls to work from Bridge, it is important that the libraries either support Bridge (have the built javascript embedded) or that you actually build them, loading the sources in a Bridge-specific project. That's because the library references must be "callable" from javascript if you want their code (or code that depends on them) to run on client-side. In other words, for a library to work with Bridge, it should also be built with Bridge, so that javascript code for it is actually output from its C# sources.

    For instance, we have the Bridge.Newtonsoft.Json port of the corresponding NuGet package so most (if not all) features are available to Bridge projects just by linking it.

    But in general for developing Bridge libraries (not really using them), would require some level of knowledge of JavaScript so you can ensure the Bridge C# prototypes result into valid javascript code.

    Well, I hope this helps!

    Comment

    Working...
    X