Skip to content
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

WIP: Add TypeScript bindings for public base1.js APIs #13214

Closed
wants to merge 1 commit into from

Conversation

shaded-enmity
Copy link

A placeholder PR for TypeScript typings for base1.js APIs

This covers a portion of the base1.js APIs that I used in the Leapp plugin for cockpit.

The typings can be used for type-checking in TypeScript as well as contextual code-completion when using the base1.js APIs, this PR is mostly meant to start a conversation rather than represent the final state.

@KKoukiou
Copy link
Contributor

KKoukiou commented Jan 3, 2020

@shaded-enmity Sorry for not getting attention here for a while. I am not sure though why we need the typescript bindings?
Please elaborate on the use case before spending more time on the code, thanks.

@KKoukiou
Copy link
Contributor

@shaded-enmity do you plan to work on this still/explain why we would like this change?

@shaded-enmity
Copy link
Author

@KKoukiou It's mostly aimed at people who develop plugins for Cockpit, for example Patternfly4+React has been mostly rewritten in TypeScript. With this definition plugin developers get strong type checking and code completion.

@shaded-enmity
Copy link
Author

Once polished, the definitions should actually live in https://github.com/DefinitelyTyped/DefinitelyTyped/ so that they can be consumed in ecosystem-native way.

@KKoukiou
Copy link
Contributor

KKoukiou commented Mar 3, 2021

@shaded-enmity, hi, it's been a year that this has not been updated. Do you want to keep this open and continue working on it?

@shaded-enmity
Copy link
Author

hey @KKoukiou, my time is extremely limited these days, here's what I can do:

  • Add docstrings
  • Setup automation to run TypeDoc on the type definitions
  • Create Patternfly4 + TypeScript example project

However, that leaves a couple of outstanding items that I'd like to discuss & when agreed, get some help from the Cockpit community:

  • Document the rest of the base1.js APIs (DBUS, Channels, time series, etc.)
  • Use the generated TypeDocs as canonical documention for base1.js API
  • Publish the types in the DefinitelyTyped repository so that the type bindings can be consumed in TS native way

There's probably more things, this is just a quick list off the top of my head. Happy to discuss this in a call,

@KKoukiou
Copy link
Contributor

@shaded-enmity hey sorry for the late reply. I am actually happy to help with some of these, but like you I can't commit to something time wise.
How do you consume the cockpit API now in your TS cockpit plugin? Do you have custom typings?
None of the plugins maintained by the cockpit team are written in TS, so we don't have a lot of experience on that, but should not be a problem.
So feel free to send patches to the seperate items if you ever have time, and maybe someone picks one of these as well.

The last question is, this PR is half ready, and not ready to be merged, so we can close it and keep tracking the items in a TODO list in an issue.

@KKoukiou
Copy link
Contributor

Closing as of last comment not getting any reply. Thanks for taking the time!

@gbraad
Copy link

gbraad commented Jun 17, 2023

Such a shame this is not worked on. :-/

@allisonkarlitskaya
Copy link
Member

A new attempt... #19842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants