Undocumented (and maybe unwanted) breaking changes in 3.0.0-beta.11
See original GitHub issueExpected Behavior
These lines of Typescript code, which compiled fine in 3.0.0-beta.10, should also compile in beta.11 (I haven’t found any documented breaking change documenting those):
const chartOptions: ChartConfiguration<'bar'> = {
type: 'bar',
// irrelevant properties omitted
options: {
plugins: {
tooltip: {
callbacks: {
// error here because dataPoint doesn't exist anymore
label: context => context.dataset.label + ': ' + formatNumber(context.dataPoint.y)
}
}
},
scales: {
y: {
ticks: {
// error here because the tick value is now typed as unknown
callback: (value: number) => formatNumber(value)
}
}
}
}
};
Current Behavior
They don’t compile anymore.
Possible Solution
I’ve had to change them to
const chartOptions: ChartConfiguration<'bar'> = {
type: 'bar',
// irrelevant properties omitted
options: {
plugins: {
tooltip: {
callbacks: {
label: context =>
context.dataset.label +
': ' +
formatNumber(context.dataset.data[context.dataIndex] as number)
// dataPoint was easier to use than the above, and its `y` value was typed as number, whereas context.dataset.data[context.dataIndex] as number is typed as unknown
}
}
},
scales: {
y: {
ticks: {
callback: (value) => formatNumber(value as number)
}
}
}
}
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Changelog | Meteor API Docs
11, 2020-08-18. Breaking changes. email package dependencies have been update and package version has been bumped to 2.0.0 ...
Read more >Changelog - Cypress Documentation
This change aligns Cypress' cookie rules with the browser cookie rules. ... Read our Migration Guide which explains the breaking changes in more...
Read more >node_modules/rxjs/CHANGELOG.md ... - GitLab
BREAKING CHANGES. Our very new creation function, connectable , now takes a configuration object instead of just the Subject instance.
Read more >Changelog — Python 3.11.1 documentation
This solves a caching issue when a process changes its current working directory. FileFinder no longer inserts a dot in the path, e.g....
Read more >Key facts about U.S. immigration policies and Biden's ...
Since Joe Biden took office in 2021, his administration has acted on a number of fronts to reverse Trump-era restrictions on immigration.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also note that float bars have a
_custom
of:The reason we called it
parsed
was because it’s an internally generated value that is created after we’ve parsed thedata
object. So internally it was calledparsed
. and then for simplicity the scriptable contexts were updated to include it as well and so we figured it was good to have a single name.If we get lots of feedback on the discoverability of it, I’m happy to alias back to the old name as well. It’s a pretty lightweight change.