Skip to content
Permalink
Browse files

Updates for Scala 2.13

  • Loading branch information...
darkfrog26 committed Jun 29, 2019
1 parent 9007729 commit db3a08ea14d8856ab304a573ddc27ce52e85b5a3
@@ -5,7 +5,7 @@ import io.youi.{History, dom}
import io.youi.dom._
import io.youi.net.Parameters
import io.youi.stream.StreamURL
import org.scalajs.dom._
import org.scalajs.dom.html

import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
@@ -52,7 +52,7 @@ trait ContentScreen extends Screen with PathActivation {
val size = screen.childNodes.length
(0 until size).map(screen.childNodes.item).foreach { child =>
child match {
case e: Element => e.remove()
case e: html.Element => e.remove()
case _ => // Ignore nodes
}
span.appendChild(child)
@@ -3,7 +3,7 @@ package io.youi.app.screen
import io.youi.AnimationFrame
import io.youi.easing.Easing
import io.youi.task._
import org.scalajs.dom._
import org.scalajs.dom.html

import scala.concurrent.Future
import scala.concurrent.duration._
@@ -1,6 +1,6 @@
package io.youi.app.screen

import org.scalajs.dom._
import org.scalajs.dom.html

import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
@@ -7,7 +7,7 @@ import io.youi.app.{ClientApplication, YouIApplication}

import scala.concurrent.{Future, Promise}
import scala.concurrent.ExecutionContext.Implicits.global
import org.scalajs.dom._
import org.scalajs.dom

import scala.util.{Failure, Success}

@@ -28,9 +28,9 @@ trait ScreenManager {
scribe.info("Initializing application...")
init().onComplete {
case Success(_) => {
if (waitForWindowLoad && document.readyState != "complete") {
if (waitForWindowLoad && dom.document.readyState != "complete") {
scribe.info("Application initialized. Waiting for window load to complete...")
window.addEventListener("load", (_: Event) => {
dom.window.addEventListener("load", (_: dom.Event) => {
scribe.info("Window loading complete. Loading application...")
load().foreach { _ =>
scribe.info("Application loaded.")
@@ -4,8 +4,8 @@ import sbtcrossproject.CrossPlugin.autoImport.crossProject
name := "youi"
organization in ThisBuild := "io.youi"
version in ThisBuild := "0.11.11-SNAPSHOT"
scalaVersion in ThisBuild := "2.12.8"
crossScalaVersions in ThisBuild := List("2.12.8", "2.11.12")
scalaVersion in ThisBuild := "2.13.0"
crossScalaVersions in ThisBuild := List("2.13.0", "2.12.8", "2.11.12")
resolvers in ThisBuild += Resolver.sonatypeRepo("releases")
resolvers in ThisBuild += Resolver.sonatypeRepo("snapshots")
scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation", "-feature")
@@ -26,28 +26,27 @@ developers in ThisBuild := List(
Developer(id="darkfrog", name="Matt Hicks", email="matt@matthicks.com", url=url("http://matthicks.com"))
)

val profigVersion = "2.3.5"
val scribeVersion = "2.7.7"
val reactifyVersion = "3.0.3"
val hasherVersion = "1.2.1"
val hookupVersion = "2.0.2"
val profigVersion = "2.3.6"
val scribeVersion = "2.7.8"
val reactifyVersion = "3.0.4"
val hasherVersion = "1.2.2"
val hookupVersion = "2.0.3"

val canvgVersion = "1.4.0_1"
val openTypeVersion = "0.7.3"
val picaVersion = "3.0.5"
val webFontLoaderVersion = "1.6.28"
val canvgVersion = "1.4.0_2"
val openTypeVersion = "0.7.3_1"
val picaVersion = "3.0.5_1"
val webFontLoaderVersion = "1.6.28_1"

val akkaVersion = "2.5.23"
val scalaJSDOM = "0.9.7"
val okHttpVersion = "3.14.2"
val circeVersion = "0.11.1"
val okHttpVersion = "4.0.0"
val circeVersion = "0.12.0-M3"
val uaDetectorVersion = "2014.10"
val undertowVersion = "2.0.21.Final"
val closureCompilerVersion = "v20190415"
val jSoupVersion = "1.11.3"
val undertowVersion = "2.0.22.Final"
val closureCompilerVersion = "v20190618"
val jSoupVersion = "1.12.1"
val scalaXMLVersion = "1.2.0"
val scalacticVersion = "3.0.5"
val scalaTestVersion = "3.0.5"
val scalaTestVersion = "3.1.0-SNAP13"
val scalaCheckVersion = "1.14.0"

lazy val root = project.in(file("."))
@@ -67,7 +66,6 @@ lazy val macros = crossProject(JSPlatform, JVMPlatform).in(file("macros"))
description := "Dependency for internal Macro functionality",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test"
)
)
@@ -89,7 +87,6 @@ lazy val core = crossProject(JSPlatform, JVMPlatform).in(file("core"))
"com.outr" %%% "scribe" % scribeVersion,
"com.outr" %%% "reactify" % reactifyVersion,
"com.outr" %%% "hookup" % hookupVersion,
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test"
),
libraryDependencies ++= Seq(
@@ -117,7 +114,6 @@ lazy val client = crossProject(JSPlatform, JVMPlatform).in(file("client"))
.settings(
name := "youi-client",
libraryDependencies ++= Seq(
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test"
)
)
@@ -135,7 +131,6 @@ lazy val spatial = crossProject(JSPlatform, JVMPlatform).in(file("spatial"))
.settings(
name := "youi-spatial",
libraryDependencies ++= Seq(
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test",
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion % "test"
)
@@ -160,7 +155,6 @@ lazy val dom = project.in(file("dom"))
name := "youi-dom",
libraryDependencies ++= Seq(
"com.outr" %% "profig" % profigVersion,
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test"
),
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv
@@ -173,7 +167,6 @@ lazy val server = project.in(file("server"))
name := "youi-server",
libraryDependencies ++= Seq(
"net.sf.uadetector" % "uadetector-resources" % uaDetectorVersion,
"org.scalactic" %% "scalactic" % scalacticVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
)
)
@@ -185,7 +178,6 @@ lazy val serverUndertow = project.in(file("serverUndertow"))
fork := true,
libraryDependencies ++= Seq(
"io.undertow" % "undertow-core" % undertowVersion,
"org.scalactic" %% "scalactic" % scalacticVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
)
)
@@ -226,7 +218,6 @@ lazy val app = crossProject(JSPlatform, JVMPlatform).in(file("app"))
.settings(
name := "youi-app",
libraryDependencies ++= Seq(
"org.scalactic" %%% "scalactic" % scalacticVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % "test"
)
)
@@ -2,6 +2,6 @@ package io.youi

import org.scalajs.dom._

object LocalStorage extends Storage {
override protected lazy val storage: raw.Storage = window.localStorage
object LocalStorage extends io.youi.Storage {
override protected def storage: raw.Storage = window.localStorage
}
@@ -2,6 +2,6 @@ package io.youi

import org.scalajs.dom._

object SessionStorage extends Storage {
override protected lazy val storage: raw.Storage = window.sessionStorage
object SessionStorage extends io.youi.Storage {
override protected def storage: raw.Storage = window.sessionStorage
}
@@ -2,7 +2,7 @@ package io.youi

import java.io.{ByteArrayInputStream, File, FileInputStream, FileOutputStream, InputStream, OutputStream}
import java.net.URL
import java.nio.file.{Files, Path}
import java.nio.file.Path

import scala.language.implicitConversions

@@ -99,7 +99,7 @@ class Connection {
}

def close(): Unit = if (connected()) {
send.close := Unit
send.close := ()
_connected := false
}
}
@@ -16,7 +16,7 @@ class TextViewExample extends UIExampleScreen {

override def createUI(): Future[Unit] = {
for {
openSans <- GoogleFont.`Open Sans`.`regular`load()
openSans <- GoogleFont.`Open Sans`.`regular`.load()
pacifico <- GoogleFont.`Pacifico`.`regular`.load()
roboto <- GoogleFont.`Roboto`.`900`.load()
berkshire <- GoogleFont.`Berkshire Swash`.`regular`.load()
@@ -1,5 +1,5 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.4")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2-1")
@@ -224,7 +224,7 @@ object UndertowServerImplementation extends ServerImplementationCreator {
}

override def onFullCloseMessage(channel: WebSocketChannel, message: BufferedBinaryMessage): Unit = {
connection.receive.close := Unit
connection.receive.close := ()
super.onFullCloseMessage(channel, message)
}
})

This file was deleted.

This file was deleted.

0 comments on commit db3a08e

Please sign in to comment.
You can’t perform that action at this time.