Skip to content

Follow Stimulus target lifecycle for charts - #3167

Merged
tabuna merged 3 commits into
masterfrom
fix/chart-stimulus-lifecycle
Oct 22, 2026
Merged

tabuna merged 3 commits into
masterfrom
fix/chart-stimulus-lifecycle

Conversation

@tabuna

@tabuna tabuna commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Removing a chart's canvas target left its chart instance alive. A config change then tried to access the missing target and prevented the replacement canvas from rendering.

Give the chart instance the same lifetime as its canvas target through Stimulus target callbacks. Declare window load and export prevention as actions in Blade. Keep chart creation behind stylesheet readiness and preserve native chart configuration.

Replace the empty controller test superclass with real Stimulus running in jsdom. Exercise attribute updates, target removal and replacement, reconnect, load and export through the DOM. Run the chart suite in CI. Rebuild the production JavaScript bundle.

Validation: nine Stimulus integration tests, 715 PHP tests with 2623 assertions, Pint, Prettier and Chromium with the actual charts package. The target-removal regression fails against the previous controller and passes with this change. Existing unrelated local Platform changes are excluded.

Independent final review returned PASS+NOTES for 2ef13d2. The source, test and config changes are identical to the first reviewed version after merging current master. Existing master CSS artifacts and their integrity metadata are preserved.

@tabuna
tabuna merged commit ae33c39 into master Oct 22, 2026
58 of 64 checks passed
@tabuna
tabuna deleted the fix/chart-stimulus-lifecycle branch October 22, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant