Repository navigation
feat(s2): declared update classifications and Update behavior docs - #1099
Open
madelineluke wants to merge 1 commit into
Open
madelineluke wants to merge 1 commit into
madelineluke wants to merge 1 commit into
Conversation
Every exported S2 component and ChartOptions declares how a change to each prop is applied (noop, signal, data, size or rebuild, plus replay). Generated tests assert the router takes the declared class and that the update matches a fresh mount. The view host reports the channels it applied, and the tables generate a new Update behavior docs page. Closes #1081 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Contributor
|
🎨 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-1099/ 🎨 S2 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-1099-s2/ 🎨 S2 Dev Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-1099-s2-dev/ 📚 Docs -> https://opensource.adobe.com/react-spectrum-charts/PR-1099-docs/ |
This branch has not been deployed
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.



Closes #1081. Part of the S2 chart stability RFC.
Summary
Every exported S2 component (stable and lab) and
ChartOptionsnow declares how the chart applies a change to each prop. The update classes arenoop,signal,data,sizeandrebuild, and each entry also has areplayflag. Tests check each declaration against the router, and the declarations generate a docs page.vega-spec-builder-s2/src/updateClasses/has one table per*Optionstype, for exampleLINE_UPDATE_CLASSES.react-spectrum-charts-s2/src/updateClasses/has one table per component's props, for exampleLINE_PROP_UPDATE_CLASSES. Every table usessatisfies UpdateClassTable<T>, so an unclassified prop is a type error.viewHost.update()returns{ route, channels }. Its incremental route reports which ofsignal,dataandsizeit applied.*.updateClasses.test.tsxthat changes every prop. Each case asserts that the router took the declared class and that the updated scene equals a fresh mount (RFC validation tests 2 and 3). The case map is exhaustive by type. Known disagreements useknownIssue, which runs them astest.failing.docs-s2/docs/update-behavior.mdxis generated from the props tables and listed in the sidebar. Runyarn docs:update-behaviorto regenerate it. A test fails when the committed page is stale.architecture/rendering-and-signals.mdand the adding-props skill now explain how to classify new props.Notes
updateClasses/folders rather than next to each*Spec.types.tsas the issue suggested. That puts the values, tables and props tables in one place.onUpdatehook. Tests observe the applied class by spying on the view adapter, and nothing in production needs the hook.replayistrueonly forcolor,dimensionandmetricon marks, plusmarkType, ChartmarksandUNSAFE_vegaSpec. Nothing reads the flag yet; it's for the upcoming draw-in replay policy.settle()compares scenes instead of counting renders, because Vega re-renders axis titles on every run.updateCaseData,noopCallbackandwithDrawIn.Bugs found, marked
knownIssueThese bugs don't have issues yet.
Legendwith anamefails to render ("Undefined data set namelegend0Aggregate").dimensionValue: 'end', the label's bounds flip between two positions on every dataflow run. It jitters and never settles.colorScaleTypefrom ordinal to linear, rows keep a stalerscSeriesIdafter the rebuild.dualMetricAxison a non-interactive Line or Bar fails to render. This is already known, and the cases work around it with aChartInspectchild.Review
Each component owner, please review your component's table, especially the
noopentries. Those are props read at render or event time through refs, for example popover sizing,tooltipAnchor, and BaronMouseOver.Testing
yarn test:quiet --testPathPattern="updateClasses|updateBehaviorDocs|stability|viewHost"yarn build:s2,yarn tsc,yarn lint,yarn lint:sonar,yarn check:packagesandyarn changeset:status