scala-js / scala-js-dom

Statically typed DOM API for Scala.js
Other
315 stars 160 forks source link

is changing `Array` -> `FrozenArray` binary compatible? #789

Closed yurique closed 1 year ago

yurique commented 1 year ago

After updating 2.3.0 -> 2.6.0 (as part of Laminar update) I got a compilation error in this piece of code:

Option(ev.dataTransfer).exists(_.types.contains(format))

types became a FrozenArray and no longer has the .contains method.

So this is obviously not source-compatible (which is okay and expected), but is it binary compatible?

PR: https://github.com/scala-js/scala-js-dom/pull/763

Relevant change: https://github.com/scala-js/scala-js-dom/commit/976316c78355572a14c837aee4835ec27746e588#diff-bee8c85a4317c93e362f64be85e566c7583875855b80a078cc8dddc277700a72R78

armanbilge commented 1 year ago

Yes, see:

Specifically:

Most changes in the DOM facades belong to one of those, since it is often fixing types and adding members in classes/traits. They would be flagged as false positives.

yurique commented 1 year ago

Right, this does make sense in the context of js+dom :)

Thanks!

Are there extension methods for the frozen array somewhere? (To get the .contains back, for example)

armanbilge commented 1 year ago

Are there extension methods for the frozen array somewhere? (To get the .contains back, for example)

I guess not, sorry about that 😕 we should add them, or find some other solution.

yurique commented 1 year ago

No worries! (there are always workarounds to be found :) )