diff --git a/tests/react-integration-test/check-japgolly-3/c/componentstest/build.sbt b/tests/react-integration-test/check-japgolly-3/c/componentstest/build.sbt index 0089a928ac..ba227f35dc 100644 --- a/tests/react-integration-test/check-japgolly-3/c/componentstest/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-39f3a9" +version := "0.0-unknown-c53eb1" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react-bootstrap/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react-bootstrap/build.sbt index 656ad6d3f4..9433ca7fd4 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react-bootstrap/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-8e5b08" +version := "0.32-11e77c" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react-contextmenu/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react-contextmenu/build.sbt index 6e48d33c38..cd34c34122 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react-contextmenu/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-11f9bc" +version := "2.13.0-381358" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react-dropzone/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react-dropzone/build.sbt index f2c22635b3..3463c0fbe0 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react-dropzone/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-ffb43d" +version := "10.1.10-3383ee" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react-markdown/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react-markdown/build.sbt index a8255d6baa..7fa7d0254b 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react-markdown/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react-markdown/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-markdown" -version := "0.0-unknown-18b4dd" +version := "0.0-unknown-30c16f" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react-select/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react-select/build.sbt index 40edeb20f3..7b89cebda1 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react-select/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-6a72f3" +version := "0.0-unknown-8f2c2a" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/r/react/build.sbt b/tests/react-integration-test/check-japgolly-3/r/react/build.sbt index bd4184feed..e0df7aa861 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/r/react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-8d196c" +version := "16.9.2-43ffc0" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/anon.scala b/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/anon.scala index a926a6168c..0e30c99db0 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/anon.scala +++ b/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/anon.scala @@ -15,39 +15,39 @@ object anon { trait `0` extends StObject { - var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any + var ref: js.UndefOr[Exclude[Any, String]] = js.undefined } object `0` { - inline def apply( - defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any - ): `0` = { - val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) + inline def apply(): `0` = { + val __obj = js.Dynamic.literal() __obj.asInstanceOf[`0`] } extension [Self <: `0`](x: Self) { - inline def setDefaultProps(value: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any): Self = StObject.set(x, "defaultProps", value.asInstanceOf[js.Any]) + inline def setRef(value: Exclude[Any, String]): Self = StObject.set(x, "ref", value.asInstanceOf[js.Any]) + + inline def setRefUndefined: Self = StObject.set(x, "ref", js.undefined) } } trait `1` extends StObject { - var ref: js.UndefOr[Exclude[Any, String]] = js.undefined + var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any } object `1` { - inline def apply(): `1` = { - val __obj = js.Dynamic.literal() + inline def apply( + defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any + ): `1` = { + val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) __obj.asInstanceOf[`1`] } extension [Self <: `1`](x: Self) { - inline def setRef(value: Exclude[Any, String]): Self = StObject.set(x, "ref", value.asInstanceOf[js.Any]) - - inline def setRefUndefined: Self = StObject.set(x, "ref", js.undefined) + inline def setDefaultProps(value: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any): Self = StObject.set(x, "defaultProps", value.asInstanceOf[js.Any]) } } diff --git a/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/mod/package.scala b/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/mod/package.scala index ae3750473a..d6c698f95a 100644 --- a/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/mod/package.scala +++ b/tests/react-integration-test/check-japgolly-3/r/react/src/main/scala/typingsJapgolly/react/mod/package.scala @@ -25,7 +25,7 @@ import org.scalajs.dom.EventTarget import org.scalajs.dom.HTMLElement import org.scalajs.dom.HTMLInputElement import org.scalajs.dom.SVGElement -import typingsJapgolly.react.anon.`1` +import typingsJapgolly.react.anon.`0` import typingsJapgolly.react.mod.^ import typingsJapgolly.react.reactStrings.a_ import typingsJapgolly.react.reactStrings.abbr @@ -581,7 +581,7 @@ Unit] type PropsWithChildren[P] = P & typingsJapgolly.react.anon.Children /** Ensures that the props do not include string ref, which cannot be forwarded */ -type PropsWithRef[P] = P | (PropsWithoutRef[P] & `1`) +type PropsWithRef[P] = P | (PropsWithoutRef[P] & `0`) /** Ensures that the props do not include ref at all */ type PropsWithoutRef[P] = P | (Pick[P, Exclude[/* keyof P */ String, ref]]) diff --git a/tests/react-integration-test/check-japgolly-3/s/semantic-ui-react/build.sbt b/tests/react-integration-test/check-japgolly-3/s/semantic-ui-react/build.sbt index 9cd8954b18..d0f936078a 100644 --- a/tests/react-integration-test/check-japgolly-3/s/semantic-ui-react/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-809265" +version := "0.0-unknown-9fccd7" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-event-listener/build.sbt b/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-event-listener/build.sbt index d4e819ae79..bacaaff246 100644 --- a/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-event-listener/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-c3d4e0" +version := "0.38.0-82774e" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-ref/build.sbt b/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-ref/build.sbt index 201589db55..6b61efcd8d 100644 --- a/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-ref/build.sbt +++ b/tests/react-integration-test/check-japgolly-3/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-ef4634" +version := "0.38.0-4cb953" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "2.1.1", "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "react" % "16.9.2-8d196c", + "org.scalablytyped" %%% "react" % "16.9.2-43ffc0", "org.scalablytyped" %%% "std" % "0.0-unknown-f97ab0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/c/componentstest/build.sbt b/tests/react-integration-test/check-slinky-3/c/componentstest/build.sbt index f77e36c478..919ea68cff 100644 --- a/tests/react-integration-test/check-slinky-3/c/componentstest/build.sbt +++ b/tests/react-integration-test/check-slinky-3/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-0911db" +version := "0.0-unknown-2758d9" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react-bootstrap/build.sbt b/tests/react-integration-test/check-slinky-3/r/react-bootstrap/build.sbt index a97f24e032..7943558746 100644 --- a/tests/react-integration-test/check-slinky-3/r/react-bootstrap/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-67c572" +version := "0.32-daad1b" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react-contextmenu/build.sbt b/tests/react-integration-test/check-slinky-3/r/react-contextmenu/build.sbt index a96cd0bb8d..0df21c5b16 100644 --- a/tests/react-integration-test/check-slinky-3/r/react-contextmenu/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-272fbc" +version := "2.13.0-5fb46c" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react-dropzone/build.sbt b/tests/react-integration-test/check-slinky-3/r/react-dropzone/build.sbt index 8a911e3471..5344de2e5d 100644 --- a/tests/react-integration-test/check-slinky-3/r/react-dropzone/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-e3d0de" +version := "10.1.10-6c604f" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react-markdown/build.sbt b/tests/react-integration-test/check-slinky-3/r/react-markdown/build.sbt index 340ffc36ec..0aaa232975 100644 --- a/tests/react-integration-test/check-slinky-3/r/react-markdown/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react-markdown/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-markdown" -version := "0.0-unknown-f95880" +version := "0.0-unknown-aab417" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react-select/build.sbt b/tests/react-integration-test/check-slinky-3/r/react-select/build.sbt index dfdc9e2653..64672c0eb0 100644 --- a/tests/react-integration-test/check-slinky-3/r/react-select/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-baf25e" +version := "0.0-unknown-42082b" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/r/react/build.sbt b/tests/react-integration-test/check-slinky-3/r/react/build.sbt index faef545a00..71f3e46b1b 100644 --- a/tests/react-integration-test/check-slinky-3/r/react/build.sbt +++ b/tests/react-integration-test/check-slinky-3/r/react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-822543" +version := "16.9.2-126b35" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/anon.scala b/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/anon.scala index c3ac051a28..4db8579432 100644 --- a/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/anon.scala +++ b/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/anon.scala @@ -10,39 +10,39 @@ object anon { trait `0` extends StObject { - var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any + var ref: js.UndefOr[Exclude[Any, String]] = js.undefined } object `0` { - inline def apply( - defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any - ): `0` = { - val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) + inline def apply(): `0` = { + val __obj = js.Dynamic.literal() __obj.asInstanceOf[`0`] } extension [Self <: `0`](x: Self) { - inline def setDefaultProps(value: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any): Self = StObject.set(x, "defaultProps", value.asInstanceOf[js.Any]) + inline def setRef(value: Exclude[Any, String]): Self = StObject.set(x, "ref", value.asInstanceOf[js.Any]) + + inline def setRefUndefined: Self = StObject.set(x, "ref", js.undefined) } } trait `1` extends StObject { - var ref: js.UndefOr[Exclude[Any, String]] = js.undefined + var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any } object `1` { - inline def apply(): `1` = { - val __obj = js.Dynamic.literal() + inline def apply( + defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any + ): `1` = { + val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) __obj.asInstanceOf[`1`] } extension [Self <: `1`](x: Self) { - inline def setRef(value: Exclude[Any, String]): Self = StObject.set(x, "ref", value.asInstanceOf[js.Any]) - - inline def setRefUndefined: Self = StObject.set(x, "ref", js.undefined) + inline def setDefaultProps(value: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any): Self = StObject.set(x, "defaultProps", value.asInstanceOf[js.Any]) } } diff --git a/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/mod/package.scala b/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/mod/package.scala index 716c9f5b7f..e1af7d3875 100644 --- a/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/mod/package.scala +++ b/tests/react-integration-test/check-slinky-3/r/react/src/main/scala/typingsSlinky/react/mod/package.scala @@ -22,7 +22,7 @@ import slinky.web.SyntheticTouchEvent import slinky.web.SyntheticTransitionEvent import slinky.web.SyntheticUIEvent import slinky.web.SyntheticWheelEvent -import typingsSlinky.react.anon.`1` +import typingsSlinky.react.anon.`0` import typingsSlinky.react.mod.^ import typingsSlinky.react.reactStrings.a_ import typingsSlinky.react.reactStrings.abbr @@ -595,7 +595,7 @@ Unit] type PropsWithChildren[P] = P & typingsSlinky.react.anon.Children /** Ensures that the props do not include string ref, which cannot be forwarded */ -type PropsWithRef[P] = P | (PropsWithoutRef[P] & `1`) +type PropsWithRef[P] = P | (PropsWithoutRef[P] & `0`) /** Ensures that the props do not include ref at all */ type PropsWithoutRef[P] = P | (Pick[P, Exclude[/* keyof P */ String, ref]]) diff --git a/tests/react-integration-test/check-slinky-3/s/semantic-ui-react/build.sbt b/tests/react-integration-test/check-slinky-3/s/semantic-ui-react/build.sbt index 9fd8b8a8af..ae10219e28 100644 --- a/tests/react-integration-test/check-slinky-3/s/semantic-ui-react/build.sbt +++ b/tests/react-integration-test/check-slinky-3/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-7db6d8" +version := "0.0-unknown-79496e" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-event-listener/build.sbt b/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-event-listener/build.sbt index b2706930bf..4cad295680 100644 --- a/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-event-listener/build.sbt +++ b/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-865c9f" +version := "0.38.0-d9c115" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-ref/build.sbt b/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-ref/build.sbt index 9ae405b2bf..696150be51 100644 --- a/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-ref/build.sbt +++ b/tests/react-integration-test/check-slinky-3/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-cffa37" +version := "0.38.0-fb2cbc" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", "me.shadaj" %%% "slinky-web" % "0.7.2", - "org.scalablytyped" %%% "react" % "16.9.2-822543", + "org.scalablytyped" %%% "react" % "16.9.2-126b35", "org.scalablytyped" %%% "std" % "0.0-unknown-dc99ee") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/Exports.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/Exports.scala index 984a212e2e..6d26165ff5 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/Exports.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/Exports.scala @@ -93,9 +93,8 @@ object Exports { if (scope.stack contains mod) mod else CachedReplaceExports(newScope, loopDetector, mod) - resolvedModule.nameds.flatMap { - case n if n.name === TsIdent.default => Empty - case n => export(codePath, jsLocation, newScope, exportType, n, None, loopDetector) + resolvedModule.nameds.flatMap { n => + export(codePath, jsLocation, newScope, exportType, n, None, loopDetector) } case _ => scope.fatalMaybe(s"Couldn't find expected module $from") diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala index d3e79f9981..cb26c13e9c 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala @@ -6,6 +6,8 @@ import org.scalablytyped.converter.internal.ts.TsTreeScope.LoopDetector import org.scalablytyped.converter.internal.ts.modules.Exports.export import org.scalablytyped.converter.internal.ts.transforms.SetCodePath +import scala.collection.mutable + /* Skip traversing the entire tree if the module is cached */ object CachedReplaceExports { val Unique = TsIdent("__CachedReplaceExports__") @@ -106,24 +108,62 @@ class ReplaceExports(loopDetector: LoopDetector) extends TreeTransformationScope `new`.withMembers(`new`.members ++ missingTypes).asInstanceOf[T] } - case class CanBeShadowed(maybe: Boolean, trees: IArray[TsContainerOrDecl]) - + case class CanBeShadowed(shadowable: Boolean, trees: IArray[TsContainerOrDecl]) + + /** + * The main thing this does is to produce the resulting structures which are exported from `owner`. + * + * A somewhat surprising problem is that modules will frequently re-export everything from other modules, + * and there will be name clashes. In most cases this is fine, and typescript keeps for instance all overloaded methods. + * + * In other cases the name clash only produces a subset of the possible overloads. + * + * Whenever a name clash TS cares about occurs, order in the input matters. ST should be good, + * as initial ordering should generally survive until module resolution. + * + * Below you'll see some guesswork, which seems to produce good results. + * more research should really go into this. + * + * The problem is most grave with `default` exports, so the code is stricter for that case + */ def newMembers( scope: TsTreeScope, owner: TsDeclNamespaceOrModule, jsLocation: ModuleSpec => JsLocation, trees: IArray[TsContainerOrDecl], ): IArray[TsContainerOrDecl] = { - val (canBeShadowed, canNotBe) = trees.map(newMember(scope, owner, jsLocation)).partition(_.maybe) - val keep = canNotBe.flatMap(_.trees) - val keepMaybe = { - val takenName = keep.collect { case x: TsNamedDecl => x.name }.toSet - canBeShadowed.flatMap(_.trees.filter { - case x: TsNamedDecl => !takenName(x.name) - case _ => true - }) + val (shadowable, notShadowable) = trees.map(newMember(scope, owner, jsLocation)).partition(_.shadowable) + + def keepTypesOverwriteValues( + ts1: IArray[TsContainerOrDecl], + ts2: IArray[TsContainerOrDecl], + ): IArray[TsContainerOrDecl] = { + val (values1, types1) = ts1.partitionCollect { case x: TsNamedValueDecl => x } + val (values2, types2) = ts2.partitionCollect { case x: TsNamedValueDecl => x } + types1 ++ types2 ++ (if (values2.isEmpty) values1 else values2) + } + + def nameOpt(x: TsContainerOrDecl): Option[TsIdent] = x match { + case x: TsNamedDecl => Some(x.name) + case _ => None + } + + val b = mutable.TreeMap.empty[Option[TsIdent], IArray[TsContainerOrDecl]] + shadowable.foreach { group => + group.trees.groupBy(nameOpt).foreach { + case (name @ Some(TsIdent.default), trees) => + b.update(name, keepTypesOverwriteValues(b.getOrElse(name, Empty), trees)) + case (maybeName, trees) => + b.update(maybeName, b.getOrElse(maybeName, Empty) ++ trees) + } + } + + notShadowable.flatMap(_.trees).groupBy(nameOpt).foreach { + case (optionalName, trees) => + b.update(optionalName, keepTypesOverwriteValues(b.getOrElse(optionalName, Empty), trees)) } - keepMaybe ++ keep + + IArray.fromTraversable(b.values).flatten } def newMember(scope: TsTreeScope, owner: TsDeclNamespaceOrModule, jsLocation: ModuleSpec => JsLocation)( @@ -139,7 +179,7 @@ class ReplaceExports(loopDetector: LoopDetector) extends TreeTransformationScope decl match { /* fix for @angular/core */ case TsExport(NoComments, _, _, TsExportee.Star(_, name)) if owner.name === name => - CanBeShadowed(maybe = false, Empty) + CanBeShadowed(shadowable = false, Empty) case e: TsExport => val ret = Exports.expandExport(scope, jsLocation, e, loopDetector, owner) if (ret.isEmpty && scope.root.pedantic) { @@ -153,11 +193,8 @@ class ReplaceExports(loopDetector: LoopDetector) extends TreeTransformationScope scope.logger.fatal(("didn't expand to anything", other.toString)) } } - val canBeShadowed = e match { - case TsExport(_, _, ExportType.Named, TsExportee.Star(_, _)) => true - case _ => false - } - CanBeShadowed(canBeShadowed, ret) + + CanBeShadowed(shadowable = true, ret) case g @ TsGlobal(_, _, ms, _) => val ret: IArray[TsNamedDecl] = @@ -167,16 +204,16 @@ class ReplaceExports(loopDetector: LoopDetector) extends TreeTransformationScope } .map(x => Utils.withJsLocation(x, JsLocation.Global(TsQIdent.of(x.name)))) - CanBeShadowed(maybe = false, IArray(g.copy(members = ret))) + CanBeShadowed(shadowable = false, IArray(g.copy(members = ret))) - case x: TsDeclModule => CanBeShadowed(maybe = false, IArray(x)) - case x: TsAugmentedModule => CanBeShadowed(maybe = false, IArray(x)) + case x: TsDeclModule => CanBeShadowed(shadowable = false, IArray(x)) + case x: TsAugmentedModule => CanBeShadowed(shadowable = false, IArray(x)) // might clash with an interface in the presence of commonjs modules - case x: TsDeclTypeAlias => CanBeShadowed(maybe = true, IArray(x)) + case x: TsDeclTypeAlias => CanBeShadowed(shadowable = true, IArray(x)) case x: TsNamedValueDecl => - if (hasExportedValues) CanBeShadowed(maybe = false, IArray.fromOption(KeepTypesOnly(x))) - else CanBeShadowed(maybe = false, IArray(x)) - case x => CanBeShadowed(maybe = false, IArray(x)) + if (hasExportedValues) CanBeShadowed(shadowable = false, IArray.fromOption(KeepTypesOnly(x))) + else CanBeShadowed(shadowable = false, IArray(x)) + case x => CanBeShadowed(shadowable = false, IArray(x)) } } }