Skip to content

refactor(ui5-table): resolve row selector/action components lazily via features - #14013

Open
aborjinik wants to merge 1 commit into
mainfrom
refactor/table-row-lazy-deps
Open

refactor(ui5-table): resolve row selector/action components lazily via features#14013
aborjinik wants to merge 1 commit into
mainfrom
refactor/table-row-lazy-deps

Conversation

@aborjinik

Copy link
Copy Markdown
Contributor

Move ownership of the concrete controls rendered inside table rows from the row templates to the slotted selection feature and the row action, so a row only pulls in the components it actually needs.

Previously the row templates imported CheckBox, RadioButton, Button and Icon directly. Because template modules are eagerly evaluated, every table dragged in all of these dependencies even when no selection or row actions were used.

Instead of hard-coding the components, the templates now ask the owning feature for the component class to render:

  • TableSelection(Base/Single/Multi) expose getSelectionComponent(), getClearAllComponent() and getClearAllIcon(). Single returns RadioButton, Multi returns CheckBox plus the ClearAll Icon; the base returns undefined.
  • TableRowActionBase exposes overflowButtonComponent / overflowButtonIcon and owns the Button + overflow icon imports.
  • TableRowBase/TableRow/TableHeaderRow surface these via _selectionComponent, _clearAllComponent, _overflowButtonComponent getters that delegate to the active feature/action.

The templates render , and resolved at render time, guarded so nothing renders when the feature/action is absent. Enum values are passed as string literals ("Default", "Transparent", "Decorative") now that the concrete component owns its types.

Net effect: CheckBox, RadioButton, Button and the icons are imported by the selection features and row actions rather than the row, so a plain read-only table no longer bundles selection/action controls.

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@aborjinik
aborjinik force-pushed the refactor/table-row-lazy-deps branch from 0c4abf7 to 03cd11a Compare September 2, 2026 05:58
…ly via features

Move ownership of the concrete controls rendered inside table rows and header
cells from the templates to the owning slotted feature, child element, or the
header cell itself, so a plain table only pulls in the components it uses.

Previously the row templates and the header-cell template statically imported
concrete components (CheckBox, RadioButton, Button, Icon) plus their enum/icon
modules. Because a component's `.ts` value-imports its template `.tsx`, and the
template value-imported those components, importing TableRow / TableHeaderCell
always dragged all of them into the bundle even for a read-only, unsorted table
with no selection or row actions.

Instead of hard-coding the components, the templates now ask the owning
feature/element for the component class to render at render time:

- TableSelection(Base/Single/Multi) expose getSelectionComponent(),
  getClearAllComponent() and getClearAllIcon(). Single returns RadioButton,
  Multi returns CheckBox plus the ClearAll Icon; the base returns undefined.
- TableRowActionBase exposes overflowButtonComponent / overflowButtonIcon and
  owns the Button + overflow icon imports.
- TableHeaderCell exposes _sortIconComponent / _sortIcon, returning the Icon
  class and sort-ascending/descending icon only while the column is sorted, so
  an unsorted table no longer bundles Icon or the sort icon modules.
- TableRowBase/TableRow/TableHeaderRow surface these via _selectionComponent,
  _clearAllComponent, _overflowButtonComponent getters that delegate to the
  active feature/action.

The templates render the resolved components (<SelectionComponent>,
<ClearAllComponent>, <OverflowButton>, <SortIconComponent>), guarded so nothing
renders when the feature/action/sort state is absent. Enum values are passed as
string literals now that the concrete component owns its types.

Net effect: CheckBox, RadioButton, Button, Icon and their icons are imported by
the selection features, row actions and header cell rather than by the row, so
a plain read-only table no longer bundles selection/action/sort controls.
@aborjinik
aborjinik force-pushed the refactor/table-row-lazy-deps branch from 03cd11a to dbc6ab0 Compare September 2, 2026 07:48
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.

1 participant