oyvindberg on master
Adjust `withRef` to take a java… (compare)
oyvindberg on master
Bloop 1.5.0, Scala 3.1.2/2.13.8… Slinky 0.7.2, Scalajs-react 2.1… Fix #431 by ignoring files and 5 more (compare)
oyvindberg on master
fix test (compare)
oyvindberg on master
Fix instructions in import-prob… (compare)
oyvindberg on master
"as" clauses in mapped types ca… TypeParamsReferencedInTree is n… Allow repeated types in tuples … (compare)
oyvindberg on master
Slinky 0.7.2, Scalajs-react 2.1… Fix #431 by ignoring files Fix #444 by handling `ForwardRe… (compare)
oyvindberg on master
Bloop 1.5.0, Scala 3.1.2/2.13.8… (compare)
oyvindberg on master
Update scalatest to 3.2.12 (#44… (compare)
oyvindberg on master
Fix #438: Instantiable23 type n… (compare)
oyvindberg on master
Update fansi to 0.3.1 (#414) (compare)
oyvindberg on fansi-0.3.1
Update fansi to 0.3.1 (compare)
oyvindberg on master
Update sbt-tpolecat to 0.3.1 (#… (compare)
oyvindberg on sbt-tpolecat-0.3.1
Update sbt-tpolecat to 0.3.1 (compare)
oyvindberg on scalatest-3.2.9
oyvindberg on master
Update sbt-bloop to 1.5.0 (#439) (compare)
oyvindberg on master
Update sbt-mdoc to 2.3.2 (#429) (compare)
oyvindberg on master
Update sourcecode to 0.2.8 (#40… (compare)
oyvindberg on sourcecode-0.2.8
Update sourcecode to 0.2.8 disable checksums (compare)
oyvindberg on master
Update sbt-sonatype to 3.9.12 (… (compare)
oyvindberg on master
Update sbt-assembly to 1.2.0 (#… (compare)
Think of it like a maven repo with transient libraries, where if they are not found the plugin will automatically rebuild them locally.
I guess if you're iterating and adding libraries it helps. My current approach is I have a separate project that contains all the sjs library facades that I plan to use in my downstream project. Since that doesn't change much, I'll just modify/recompile/republish any time I need to add/change libraries.
The advantage is that it is less work, than publishing a library, especially if you're not sitting with an internal repo already.
I'd prefer to your approach any day in an organization, but you're doing open source work or a hobby project remote cache is handy.
scalaVersion := "2.13.8"
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta37")
polymorphic expression cannot be instantiated to expected type;
[error] found : [T]typings.reactstrap.components.SharedBuilder_UncontrolledDropdownProps1835145360[typings.reactstrap.mod.UncontrolledDropdown[T],T]
[error] required: japgolly.scalajs.react.vdom.html_<^.TagMod
[error] (which expands to) japgolly.scalajs.react.vdom.TagMod
[error] UncontrolledDropdown()(
type mismatch;
[error] found : String
[error] required: ? | scala.scalajs.js.Array[?]
[error] Route(RouteProps().setExact(true).setPath(s"${routeMatch.path}/register")).withKey("register")(RegisterPage.component()),
/* The props of this component has an unsupported shape. You can use `set` manually to use it, but with no compiler support :/ . Couldn't find props for (typings.reactRouter.mod.RouteProps[Path, typings.reactRouter.mod.ExtractRouteParams[Path, java.lang.String]]) & (typings.reactRouter.mod.OmitNative[
T,
/ * keyof react-router.react-router.RouteProps<string, react-router.react-router.ExtractRouteParams<string, string>> * / typings.reactRouter.reactRouterStrings.location_ | typings.reactRouter.reactRouterStrings.component | typings.reactRouter.reactRouterStrings.render | typings.reactRouter.reactRouterStrings.children | typings.reactRouter.reactRouterStrings.path | typings.reactRouter.reactRouterStrings.exact | typings.reactRouter.reactRouterStrings.sensitive | typings.reactRouter.reactRouterStrings.strict]) because: IArray(Could't extract props from T because couldn't resolve ClassTree.) */
object Route {
def apply[T /* <: js.Object */, Path /* <: String */](
p: (RouteProps[Path, ExtractRouteParams[Path, String]]) with (OmitNative[
T,
/* keyof react-router.react-router.RouteProps<string, react-router.react-router.ExtractRouteParams<string, string>> */ location_ | typings.reactRouter.reactRouterStrings.component | render | children | path | exact | sensitive | strict
])
): Builder[T, Path] = new Builder[T, Path](js.Array(this.component, p.asInstanceOf[js.Any]))
@JSImport("react-router-dom", "Route")
@js.native
val component: js.Object = js.native
@scala.inline
class Builder[T /* <: js.Object */, Path /* <: String */] (val args: js.Array[Any])
extends AnyVal
with StBuildingComponent[typings.reactRouterDom.mod.Route[T, Path]]
implicit def make[T /* <: js.Object */, Path /* <: String */](companion: Route.type): Builder[T, Path] = new Builder[T, Path](js.Array(this.component, js.Dictionary.empty))()
}
type mismatch;
[error] found : String
[error] required: ? | scala.scalajs.js.Array[?]
[error] Route(RouteProps().setExact(true).setPath(s"${routeMatch.path}/register")).withKey("register")(RegisterPage.component()),
Flavour.Slinky
the converter generate a different facade
/* The props of this component has an unsupported shape. You can use `set` manually to use it, but with no compiler support :/ . Could't extract props from T because couldn't resolve ClassTree. */
object Route {
def apply[T /* <: RouteProps */](p: T): Builder[T] = new Builder[T](js.Array(this.component, p.asInstanceOf[js.Any]))
@JSImport("react-router-dom", "Route")
@js.native
val component: js.Object = js.native
@scala.inline
class Builder[T /* <: RouteProps */] (val args: js.Array[Any])
extends AnyVal
with StBuildingComponent[tag.type, typings.reactRouterDom.mod.Route[T]]
implicit def make[T /* <: RouteProps */](companion: Route.type): Builder[T] = new Builder[T](js.Array(this.component, js.Dictionary.empty))()
}
Hi @oyvindberg, I found the problem, yarn add @types/react-router-dom@5.1.2
transiently installs the @types/react-router@5.1.18
version, which generates a weird facade, it was necessary to explicitly set the version of @types/react-router
to 5.1.2
.
Another thing is that the stIgnore
option apparently doesn't ignore if the version is added, right? because I was trying to exclude the wrong version and apparently it didn't work.
stIgnore ++= List("@types/react-router@5.1.18")
npm install
), the command runs on every compile
, which takes quite some time, and outputs quite a bit of useless logs every time.
externalNpm := baseDirectory.value
.
npm install
once before running sbt.
@oyvindberg: Howdy! before I pop this on the issue (this one? ScalablyTyped/Converter#125), can you confirm that this code:
export type PascalCasedProperties<Value> = Value extends Function
? Value
: Value extends Array<infer U>
? Value
: {[K in keyof Value as PascalCase<K>]: Value[K]};
which fails to parse with ScalablyTyped (Right(Parse error at 51.22 '']'' expected but 'as' found)
) is broken for the same reason as the issue I linked?
[error] 2022-05-19T18:54:30.269491Z Phase3Compile.scala:147 err Compiling std (1807 Scala sources)
Compiled std (2999ms)
[E] Unexpected error when compiling std: 'class dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to class dotty.tools.dotc.core.Symbols$ClassSymbol (dotty.tools.dotc.core.Symbols$NoSymbol$ and dotty.tools.dotc.core.Symbols$ClassSymbol are in unnamed module of loader java.net.URLClassLoader @4451e4fe)'
[E] Failed to compile 'std'
[id => std, thread => 250, phase => build, flavour => NormalFlavour]
[warn ] 2022-05-19T18:54:30.275106Z ScalablyTypedWorkerImpl.scala:269 td 15656
Failure: You might try to set:
def scalablyTypedIgnoredLibs = Seq("std")
std: Compilation failed: Compiled std (2999ms) (/Users/simon/Code/mill-full-stack/mill-full-stack/node_modules/typescript/lib)
1 targets failed
stModule.scalablyTypedImportTask java.lang.Exception
com.github.lolgab.mill.scalablytyped.worker.ScalablyTypedWorkerImpl.scalablytypedImport(ScalablyTypedWorkerImpl.scala:296)
com.github.lolgab.mill.scalablytyped.ScalablyTyped.$anonfun$scalablyTypedImportTask$2(ScalablyTyped.scala:56)
mill.define.Task$TraverseCtx.evaluate(Task.scala:380)
scala.scalajs.js.typedarray.Uint8Array
, given that https://scalablytyped.org/docs/conversion-options#stusescalajsdom is set to true (it is by default). The few cases where you'll see usage of the other types would be in inheritance clauses, as that is a much more complicated rewrite
as
:)
as
token, and then ignore it with a warning