-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript #129
Comments
Hi @dobicz - my original plan was to write the whole library with Typescript, but as things played out, this didn't end up happening. While it's not on my immediate radar to convert to Typescript, I would be very interested in a pull request if you or anyone else is inclined to do this. |
Hi @markabrahams , This is something that I want to to in the next months, but in the way, I think it'll be necessary to refactor some parts of the code in smaller files, to make it more manageable. I don't know if this is something that you want to comment in order to establish any kind of rules or guides for future development. |
Hi @cjimenezsaiz - thanks for looking into this! Suffice to say this project is a classic example of something growing incrementally to the point where the single-file approach is obviously not ideal for its current size! I would be inclined to refactor into Typescript classes, one class per file. Fortunately, all of the code I've written (and a good portion of the code I inherited!) is fairly well segmented into "class-like" functions, as I had one eye on doing a Typescript/class conversion at some point. Is that approach along the lines of what you're thinking? |
Hi @markabrahams , Sounds good. In about two weeks I think I will have time to start the change. Greetings. |
Hi @markabrahams, sorry for the delay. I'have started with this topic, The first module that have been translated to typescript has been the asn1-ber, I'have tested it han its working without problems. |
Hi @cjimenezsaiz - no need to apologise - it's voluntary effort after all, and all appreciated! Well done on asn1-ber! For the MIB module, it really could do with some documentation on the structure of the output, but unfortunately I don't have any :-( The easiest way to understand the structure created is to run the example/mib-parser.js code. If you look at the value of the "modules" variable at the end (the full set of parsed MIB modules), you'll find good examples of how each MIB module is parsed to JSON, which will give you a reasonable idea of the Typescript types required. |
Any update on where we are in providing a typescript interface to this module I am also interested in this |
Hi @mwoodpatrick, I'm still working on it. I'll update the status in some weeks. |
Many thanks, let me know if I can help in some way. My current primary interest is in the api's to query info from nodes |
Hey. Is there a plan for the library to support typescript? |
Hi @maks-plotnikoff - you've come to the right place! This issue literally opens with "Hello, Is there a plan for the library to support typescript?" and the discussion about this proceeds from there. |
I have started creating a TypeScript It's still quite incomplete. I will add types as I need them. I also started complete refactoring of the project as a compile time TypeScript git submodule last weekend, however that work was so incomplete and broken that I didn't want to publish it yet. I actually found few possible bugs and reported one already. |
Could it be considered to take those definitions as it is and merging them into this repo/package? ?% > 0% typescript definitions? Gradually define the types for now? If there are problems, if there are under-definitions, anybody using Typescript would probably be inclined to help raise that up with the increased visibility if it's pulled in. |
I'll be blunt, would a PR for @thejhh 's work as it is be accepted? I will have my own additions too, but that can be in another PR. This isn't a rewrite, it's having definitions alongside. |
I've taken advantage of @thejhh 's definitions and they have been really useful. I think the projects make sense being separate at the moment as there is still a big gap in coverage. Added to which, I think there is very much a maintenance focus for this project and anything that is going to be developing faster may want to live elsewhere until it is more mature. Just an observation as I'm not an owner / maintainer here. If there is enthusiasm to do more work on the type definitions I'd be interested in contributing. |
Hi @nelsonjchen - I do take - and usually favour! - the argument that x% > 0% - and so incremental features are worthwhile. One exception is typing though! I do feel that adding incomplete type definitions to the library could lead to more interim confusion as to what or why what thing is or isn't supported. However, the laudable goal remains to support TypeScript with complete type definitions. So I'm a bit more aligned with your view @PeterTrotter - if we work on closing the coverage gap and aim to get a "library complete" - if not perfect - type definition for the first cut, that would serve us all well! |
Is there any progress on this? @thejhh's fork seems to be inactive and is drifting behind (44 commits behind now). |
I haven't had reason to work on this lately. I actually did more work on the issue than I published, but that was too broken to share upstream. I believe my findings got added to upstream later. While porting I wound few bugs, which I believe made SNMP v3 support completely broken (but I think those got already fixed). While I do not have free time to work on this issue, I happen to be available to work on it commercially through my company. I happen to be available for new gigs there. |
Hello,
Is there a plan for the library to support typescript?
Tks,
Paulo
The text was updated successfully, but these errors were encountered: