Repository navigation
Fix ChartJS onClick on dart2wasm; run Chrome tests on dart2wasm in CI (3.0.2) - #16
Merged
Merged
Conversation
… dart2wasm; bump to 3.0.2 The onClick closure flowed into JS as a plain Dart function via jsify, which dart2wasm rejects. Also fix renderScatterChart passing onClick into the JS 'timed' slot, wire onClick for bar charts, test the handler for every ChartJS chart type, and run the Chrome tests on dart2wasm in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cords 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.
Problem
dart test -p chrome -c dart2wasmfailed on master inChartEngine[ChartJS] renderLineChart with options:ChartEngineChartJS._onClickreturned a plain Dart closure, whichtoJSDeep(js_interop_utils) converts withjsify(). dart2js wraps it implicitly; dart2wasm rejects it.Changes
ChartEngineChartJS._onClicknow returns aJSFunctionbuilt withFunction.toJS(dart:js_interop), withJSAny?parameters converted viadartify()— the same style as the existing_DateAdapter__*exports. This is the only Dart closure passed into chart options: the_DateAdapter__*functions were already exported with.toJS, and the ApexCharts engine passes no Dart callbacks (itsformatteris pure JS).renderScatterChart(ChartJS): the Dart side omitted thetimedargument, soonClicklanded in the JStimedslot, turning the X axis into a time scale and throwingCan't handle unit: millisecond. Now passesfalse.renderBar(ChartJS wrapper JS): accepted noonClickCallback, soonClickwas silently ignored for bar charts. Now wired throughconfigure.ChartOptions.onClickdoc notes it's only called by the ChartJS engine.ChartEngineChartJS onClickgroup invokes the chart'soptions.onClickhandler for every ChartJS chart type (line, time-series, bar, horizontal bar, gauge, scatter, timed scatter, financial) and checks the Dart callback receives the dartified items.dart test --platform chrome --compiler dart2wasm.pubspec.yaml,ChartEngine.VERSION, CHANGELOG).Verification (local)
dart format/dart analyze --fatal-infos --fatal-warnings: cleandart test --platform vm,chrome: 102 passeddart test --platform chrome --compiler dart2wasm: 93 passeddart pub publish --dry-run: 0 warnings🤖 Generated with Claude Code