Repository navigation
Conversation
onConfigChange now reports the type, its main field, and only the settings that differ from the type's defaults. A test proves the short form redraws the identical chart for every chart type. An error boundary around each Chart and ChartSettings shows why a config cannot draw, such as a mistyped type, instead of unmounting the host page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A host now gets short configs back from
onConfigChange: the type, its main field, and only the settings that differ from the defaults. Before this, it got every setting. One chart's failure also stays in that chart: a config that cannot draw shows why in its place, and the rest of the page keeps working.What you'll see
onConfigChangegives{ type: "scatter", xField: "Price", yField: "Rating", display: "hexbin" }instead of the full settings object with axes, margins, and defaults.<Chart config={{ type: "nonsense" }} />shows "This chart can't draw: Chart type nonsense not registered" in its place. Before, it threw, and React unmounted the whole host page.Proof
shortConfig.test.tsxruns every one of the 27 chart types: the short config redraws a chart identical to the full one (same settings, compared as sorted JSON), and it is shorter.{type:"nonsense"}threwChart type nonsense not registeredout ofrender. Five other bad configs (unknown fields, a heatmap with the same field twice) already showed the chart's own empty message.No screenshot: the visible change is one line of text in place of a chart.
Stack: standalone charts, layer 7 of 9
This slice: short configs and the per-chart error boundary.
Why it is its own layer: both change library behavior that hosts rely on, apart from the builder above that uses them.
Full story: #673
🤖 Generated with Claude Code