question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undocumented (and maybe unwanted) breaking changes in 3.0.0-beta.11

See original GitHub issue

Expected 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:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kurklecommented, Feb 21, 2021

Also note that float bars have a _custom of:

  item._custom = {
    barStart,
    barEnd,
    start: startValue,
    end: endValue,
    min,
    max
  };
1reaction
etimbergcommented, Feb 21, 2021

The reason we called it parsed was because it’s an internally generated value that is created after we’ve parsed the data object. So internally it was called parsed. 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found