Skip to content

refactor(dashboards-ng): use typed factory keys in widgetFactoryRegistry#1807

Open
chintankavathia wants to merge 1 commit intomainfrom
refactor/dashboards/factory-type
Open

refactor(dashboards-ng): use typed factory keys in widgetFactoryRegistry#1807
chintankavathia wants to merge 1 commit intomainfrom
refactor/dashboards/factory-type

Conversation

@chintankavathia
Copy link
Copy Markdown
Member

@chintankavathia chintankavathia commented Apr 2, 2026

This ensures that factory functions are mapped to valid factoryTypes.
Not a breaking change as it is intended to be used internally.


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refines the widgetFactoryRegistry by replacing generic string keys with a specific WidgetFactoryType and marking the registry as @internal. Feedback suggests improving the maintainability of the WidgetFactoryType definition by deriving it directly from the WidgetComponentFactory union using TypeScript's Exclude utility. Additionally, there is a concern that marking the registry as @internal constitutes a breaking change for external consumers, which contradicts the pull request description.

@chintankavathia chintankavathia force-pushed the refactor/dashboards/factory-type branch from 6ca877f to b15c00f Compare April 2, 2026 11:33
@chintankavathia chintankavathia marked this pull request as ready for review April 2, 2026 11:51
@chintankavathia chintankavathia requested review from a team as code owners April 2, 2026 11:51
Copy link
Copy Markdown
Member

@spike-rabbit spike-rabbit left a comment

Choose a reason for hiding this comment

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

widgetFactoryRegistry sure, this won't break any app, but is it safe to remove it from the public API? So it was never intended to be used by consumer?

@chintankavathia
Copy link
Copy Markdown
Member Author

widgetFactoryRegistry sure, this won't break any app, but is it safe to remove it from the public API? So it was never intended to be used by consumer?

we are not removing it from public api. It is still exported. we are just adding @internal so that no one misuse it.

Copy link
Copy Markdown
Member

@spike-rabbit spike-rabbit left a comment

Choose a reason for hiding this comment

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

👍

@spike-rabbit spike-rabbit enabled auto-merge April 2, 2026 12:44
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