Skip to content

Conversation

@feloy
Copy link
Contributor

@feloy feloy commented Oct 29, 2025

API package exposing contexts data.

Here is a first try, to discuss the structure of the API exposed to the user.

TODO:

@feloy feloy force-pushed the feat/api-1b branch 2 times, most recently from 3c6fd51 to 8b75eed Compare October 29, 2025 13:27
@feloy feloy requested a review from benoitf October 29, 2025 14:29
Comment on lines 19 to 21
export interface IDisposable {
dispose(): void;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why redefining a custom interface vs using the one from podman-desktop API ?

Copy link
Contributor Author

@feloy feloy Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface IDisposable is not defined in the extension-api.d.ts, only the class Disposable.

IDisposable is only defined in the internal packages/api module in Podman Desktop.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but shouldn't it use that class as all the methods of the main core API ?

Creation of Disposable object here then should use static create(func: () => void): Disposable; ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I'll change this way.

There is also another change I was considering. The kubernetes extension redefines a copy of the Disposable class (in the channel module for the moment). I'm considering to remove this definition, and use the implementation of the core instead (the only drawback is that it is not accessible in the webview). WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it could be added into https://github.com/podman-desktop/podman-desktop/tree/main/packages/webview-api

or as part of new TC39, for webview use this "official" Disposable interface rather than bringing a custom one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased after merging #421, should now use Disposable from extension-api

@feloy feloy force-pushed the feat/api-1b branch 2 times, most recently from e3141a5 to c60d560 Compare November 3, 2025 07:41
@feloy feloy requested a review from benoitf November 3, 2025 08:00
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.

2 participants