scala-js/scala-js-dom

Suggestions for the 2.0.0 migration guide (as seen in the release notes)

yurique opened this issue · 4 comments

I might be wrong about some of these and would love to be corrected where I got it wrong. (I'm reverse engineering it as I migrate to 2.0.0 and dropping notes here :) ).

  • org.scalajs.dom.ext.EasySeq is gone, use .toSeq on DOMList instead
  • org.scalajs.dom.ext.LocalStorage is gone, use dom.window.localStorage instead
    • org.scalajs.dom.ext.LocalStorage.apply(key) – use Option(dom.window.localStorage.getItem(key))
    • org.scalajs.dom.ext.LocalStorage.apply(key) = newValue – use dom.window.localStorage.setItem(key, newValue)
  • new-based constructor doesn't work for MutationObserverInit – I don't have a workaround, so I just copied the MutationObserverInit.apply into my code (to avoid the deprecation) (#624) see Sébastien's response

(will post comments here if I find more)

  • org.scalajs.dom.NodeList now takes a type parameter, use NodeList[Node] (is this correct?)

@yurique Thanks for this, much appreciated! I created a discussion in #627, would you mind commenting there with your notes/tips and closing this issue? That can be a community-sourced migration guide, I'll link it from the release notes 😁

@armanbilge awesome idea! Moving things over there.

Moved to the discussion #627.