Giter Site home page Giter Site logo

Comments (24)

sachaw avatar sachaw commented on August 26, 2024 1

There's an open PR, I might fork the project and sort this out tonight
timostamm/protobuf-ts#233

from js.

sachaw avatar sachaw commented on August 26, 2024 1

I'm contemplating switching to https://pbkit.dev/ a much more maintainable project, Although I prefer the code generated by protobuf-ts, the project is in shambles and not moving to ESM

from js.

sachaw avatar sachaw commented on August 26, 2024 1

Yeah that's correct, so it's not a massive issue, it's just nice to have it work out of the box for devs

from js.

sachaw avatar sachaw commented on August 26, 2024 1

Update on api:

Current:

Protobuf.AdminMessage.toBinary({
  payloadVariant: {
    confirmSetRadio: true,
      oneofKind: "confirmSetRadio"
    }
});

New:

AdminMessage.encodeBinary({
  payloadVariant: {
    field: 'confirmSetRadio',
    value: true
  }
});

from js.

sachaw avatar sachaw commented on August 26, 2024 1

Not yet, I'll push some wip changes tonight

from js.

sachaw avatar sachaw commented on August 26, 2024 1

@ajmcquilkin @gtnoble please check latest release 0.6.113 it should contain a fix for node,

from js.

sachaw avatar sachaw commented on August 26, 2024 1

Yeah, need to dig a little deeper into the reasons behind requiring Talib, not sure right now

from js.

sachaw avatar sachaw commented on August 26, 2024 1

Update to this, I've done away with protobuf-ts, now using bufbuild/protobuf-es which supports multiple runtimes.
Just sorting out a few last minute bits

from js.

gtnoble avatar gtnoble commented on August 26, 2024

I'm not an expert on this, but it looks like the generated files are not adding the .js extension to the relative imports.

from js.

gtnoble avatar gtnoble commented on August 26, 2024

running node with the option --experimental-specifier-resolution=node seems to be a quick fix for this issue. I suppose in the long run it would be best for the protobuf-ts code generator be modified to generate the proper extensions.

from js.

sachaw avatar sachaw commented on August 26, 2024

Yeah, as you've observed, this is the undesirable behavior exhibited by protobuf-ts, I've opened an issue about it before but the developer did not want to invest time into the feature, he was open to PR's though.

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

How does the web client get around this issue when consuming this package? I'm trying to import the JS library in Electron and I'm getting the same error. To my knowledge I'm not able to perform the --experimental-specifier-resolution=node fix.

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Sounds good! Happy to help with this if at all possible, this issue is a current blocker for me

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Interesting, I'll take a look at that. What kind of refactoring would this require?

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Also looks like this uses Deno. Would there be the possibility for issues running this on Node-based projects?

Edit: the maintainers claim it runs in Node.js or browser here

from js.

sachaw avatar sachaw commented on August 26, 2024

Yeah, so the pbkit project is made for deno but:
They distribute it for node: https://www.npmjs.com/package/pbkit
I would like to make this package Deno native in the future with support for node.

from js.

sachaw avatar sachaw commented on August 26, 2024

Issue that I'm talking with the devs about right now is distributing the pb binary, as we currently use protoc that is handled by https://www.npmjs.com/package/node-protoc
however I'm not sure of the best way forwards, without making each user manually install this on there system.

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Interesting, is there no package for the pb binary? Alternatively, is there a situation in which the pb binary is only used in development and doesn't need to be distributed through the package?

from js.

sachaw avatar sachaw commented on August 26, 2024

There will be a few things that are different, string union's instead of enums, imports will be seperated by message not file anymore and a few more

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Gotcha, so there will have to be some internal rewrites in that case. Would this require API changes and/or a breaking version change?

from js.

sachaw avatar sachaw commented on August 26, 2024

The meshtastic.js version will likely be breaking for apps, but the api will be very similar. as for interacting with devices, no change there.

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Sounds good! Happy to help out with the refactor if this ends up being the best way to move forward

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Is there a public branch for the potential changes?

from js.

ajmcquilkin avatar ajmcquilkin commented on August 26, 2024

Seems to be working for me! Just ran tests in a CRA and a Node.js app and both seem to be working. On a side note, is tslib a required package of this library? If so, is there a reason it isn't included as a dependency? I've had multiple repos error when it isn't installed

from js.

Related Issues (19)

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.