Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2.43 KB

1.1.0.md

File metadata and controls

62 lines (48 loc) · 2.43 KB

v1.1.0

  • [Router] Add a new Redirect.Method called Redirect.Force which bypasses the History API and redirects by setting window.location.href directly.

  • [Router] Add a new rewrite rule removeQuery which removes the query portion of a URL. (e.g. a/b?c=1 to a/b)

  • Opening links in new tabs using target="_blank" without rel="noopener is a security risk and performance impediment. Google's Lighthouse auditor flags it.

    Two new methods have been introduced to scalajs-react that address this by default:

    • The anchor vdom tag (<.a) gained .toNewWindow:

      /** A link to open a new window (tab) to a given URL.
        *
        * Like: `<a href="https://google.com" target="_blank" rel="noopener"></a>`
        *
        * @param noopener See https://developers.google.com/web/tools/lighthouse/audits/noopener
        */
      def toNewWindow(href      : String,
                      noopener  : Boolean = true,
                      noreferrer: Boolean = false)
    • Added CallbackTo.windowOpen:

      /** When executed, opens a new window (tab) to a given URL.
        *
        * @param noopener See https://developers.google.com/web/tools/lighthouse/audits/noopener
        * @param focus    Whether or not to focus the new window.
        */
      def windowOpen(url     : String,
                     noopener: Boolean = true,
                     focus   : Boolean = true): CallbackTo[Window] =
  • Add .renderIntoDOM to VdomElement and VdomTags.

  • Fix VDOM attributes not accepting types: Byte, Short, Float, Double, Long

  • Fix React warnings with SVG VDOM.

  • Refactored vdom.Builder which is an internal mechanism for efficiently composing VDOM. There is now:

    • An interface - advanced users can create their own if they like
    • vdom.Builder.ToVdomElement - builds a VdomElement which was the previous default
    • vdom.Builder.ToJs - provides raw JS values like props: js.Object and more
  • vdom.TagMod now has a .toJs method which turns the VDOM tree into a bunch of raw JS values. This is for advanced hackers only.

  • Remove code deprecated ≤ v1.0.0.

  • Upgrade dependencies:

    • Scalaz to v7.2.14
    • Scala.JS to v0.6.18
    • scala-js-dom to v0.9.3
    • React to v15.6.1