pyatyispyatil / flame-chart-js

Extensible component for incredibly fast viewing of flame charts
https://pyatyispyatil.github.io/flame-chart-js/
MIT License
100 stars 23 forks source link

feat(typescript): introduce more strict types #24

Closed Smrtnyk closed 2 years ago

Smrtnyk commented 2 years ago

This patch adds data types and adds some more basic types to the repo. It is a progress towards fully strict types.

pyatyispyatil commented 2 years ago

Wow, man, this is amazing. Can I publish new version with these types? I think we can do this if you have already tested the installation and use in another project.

Smrtnyk commented 2 years ago

I have only tested it with local build and running it in example project. I think it makes sense to do it when we are at fully strict types, so the consumers get the most correct types, which I think I might accomplish in next days. There are still some complex types stuff to figure out with settings and clusters. I would also like to add some more eslint rules which can reduce complexity on some places, which I already have PR locally which I will push tomorrow.

Smrtnyk commented 2 years ago

Btw, which browsers and target are we supposed to support? Currently typescript is set to 2016 target, but that might be really old, also I see there is babel in the repo, and browsers already support classes pretty well. I was thinking that it might make sense to set typescript target to 2019.

pyatyispyatil commented 2 years ago

Well, we can publish this without full strict types but with strict public interface - classes FlameChartContainer and FlameChart. And the settings interface needs to be done, yeah.

Classes are already supported by browsers in 2016. But I think we can set a target for 2019 it's doesn't matter.

Also we should keep in mind that we should support Firefox, Safari and Chrome - 2v. There are often problems with canvas in different browsers.