Skip to content

fix(core): record renderMode as a string for custom renderer classes - #4929

Draft
lukecotter wants to merge 1 commit into
tabulator-tables:masterfrom
lukecotter:fix/render-mode-attribute
Draft

fix(core): record renderMode as a string for custom renderer classes#4929
lukecotter wants to merge 1 commit into
tabulator-tables:masterfrom
lukecotter:fix/render-mode-attribute

Conversation

@lukecotter

Copy link
Copy Markdown
Contributor

Problem

A custom renderer supplied as a class makes renderMode a constructor rather than a
string. ResizeTable.js:43 gates on the literal renderMode === "virtual", so that
comparison silently fails and table resizing stops working for custom renderers.

Fix

Record renderMode as a string when a renderer class is supplied.

Performance

Neutral, as intended. 500k rows, headless Chromium, K=5, medians:

Metric Before After
initial render (ms) 97.6 101.5
initial render, variable heights (ms) 105.6 115.6 (sdPct 17.1)
fling churn, uniform 14205 14205
fling churn, variable 3935 3935

Mutation churn is byte-identical, so the renderer does exactly the same work. The
render-ms spread is harness noise at this sample size.

RowManager stored options.renderVertical verbatim in renderMode. When a
custom renderer class was passed (renderVertical: SomeRenderer), the class
was stringified into the tabulator-render-mode DOM attribute (via
_showPlaceholder) and returned by getRenderMode() as a function rather than
a mode string.

Resolve renderMode to the string option key, else the renderer's own
declared string renderMode, else "virtual".
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