Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.24k stars 378 forks source link

Update browserslist configuration #2600

Open FezVrasta opened 2 years ago

FezVrasta commented 2 years ago

High-level description

Right now a lot of code is transpiled, resulting in slower code. One example is the function parameters spread, that is converted into a for loop that allocates a new array, that then needs to be garbage collected.

Could the config be updated to only support modern browsers?

Steps to reproduce

Current behavior

Environment

finetjul commented 2 years ago

VTK.js attempts to be used by the largest user base.

The current browserslist setting is restrictive already (i.e. > 0.5%, last 2 versions, Firefox ESR, not dead).

From what I understand, what blocks browserlist from supporting rest parameters is ALL versions of IE (>0.5% but dead?) and Opera Mini(1.07%).

Interestingly, OperaMini and IE < 11 do not support WebGL, VTK.js without WebGL does not make sense. So we could add the supports webgl criteria to the browserslist config. That would leave only IE=v11 which is only 0.48% of usage (but already considered dead?).

Can you check if that makes a difference ?

Alternatively, your project can also depend on vtk.js instead of @kitware/vtk.js and you implement your own browserslist rule.

@floryst @jourdain