Repository navigation
Declare typed Stimulus values for chart parameters - #3168
Merged
Merged
Conversation
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.
The chart controller hid its entire contract in a single
config: Objectvalue. Stimulus could not decode individual options, expose their presence, or apply the Platform defaults independently.Replace it with explicit typed Stimulus Values for every supported chart parameter. Declare the existing line/250 defaults and require labels/datasets attributes. Preserve optional library defaults through
has…Valuechecks. Choose the chart builder with an explicit switch and call its known methods directly.Render separate escaped HTML attributes from PHP. Transport gradients as a Boolean and optional numeric opacity endpoints. Validate PHP option types and gradient endpoints before Stimulus can coerce them. Keep dataset, marker and region records as Array values, with nested data validated by the charts library.
Validation: 17 real-Stimulus integration tests; 718 PHP tests with 2637 assertions; Pint and Prettier; production JS build with matching manifest integrity. Chromium with the actual charts package verified typed data updates, target removal/restoration and reconnect without errors. Independent review returned PASS+NOTES. No unrelated local working files were modified.