Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 02 20:24

    oyvindberg on master

    Update sbt-bloop to 1.4.11 (#37… (compare)

  • Dec 02 20:24

    oyvindberg on master

    Update sbt-scalafmt to 2.4.4 (#… (compare)

  • Nov 09 22:39

    oyvindberg on scalajs-react-2

    update scala-js-dom to 2.0.0 slinky update Apply suggestions from code rev… and 4 more (compare)

  • Nov 09 00:45

    oyvindberg on master

    Fix #376 by checking if names a… (compare)

  • Nov 08 23:24

    oyvindberg on master

    Bump bloop to support 2.13.7 Bump default scala 3 version to… Consider casing when picking wh… (compare)

  • Oct 31 06:28

    oyvindberg on master

    Update sbt-ci-release to 1.5.10… (compare)

  • Oct 30 22:36

    oyvindberg on master

    Update sbt-mdoc to 2.2.24 (#374) (compare)

  • Oct 30 22:35

    oyvindberg on master

    Update sbt-bloop to 1.4.10 (#37… (compare)

  • Oct 30 22:32

    oyvindberg on scalajs-react-2

    Check that conversions to scala… scalajs-react 2.0.0-M5, rename … publish snapshots (compare)

  • Oct 30 22:22

    oyvindberg on scalajs-react-2

    Apply suggestions from code rev… regen definitions Check that conversions to scala… and 2 more (compare)

  • Oct 26 20:56

    oyvindberg on scalajs-react-2

    scalajs-react 2.0.0-M4, rename … publish snapshots (compare)

  • Oct 26 20:32

    oyvindberg on webpack-exports

    webpack exports wip (compare)

  • Oct 03 00:39

    oyvindberg on refactor-typescript-library-import

    fixup (compare)

  • Oct 03 00:30

    oyvindberg on refactor-typescript-library-import

    reinstate standard comments dependency handling Remove `Key` (compare)

  • Oct 02 00:23

    oyvindberg on scalajs-react-2

    scalajs-react 2.0.0-RC1, rename… publish snapshots Experiment with effect agnostic… and 1 more (compare)

  • Oct 02 00:17

    oyvindberg on refactor-typescript-library-import

    Refactor Phase1ReadTypescript. … (compare)

  • Oct 02 00:10

    oyvindberg on master

    Update scala-java8-compat to 1.… (compare)

  • Oct 02 00:10

    oyvindberg on master

    Update sbt-ci-release to 1.5.9 … (compare)

  • Oct 02 00:08

    oyvindberg on scala3-future

    (compare)

  • Oct 02 00:05

    oyvindberg on scala3-future

    bump scala 3 version (compare)

elkhadirzyad
@elkhadirzyad
@oyvindberg the function is `` implicit def whyyyDoesItHaveToBeSoComplicated: ValueType[HTMLElement => Callback, RefFn[HTMLElement]] =
ValueType[HTMLElement => Callback, RefFn[HTMLElement]] { (consume, f) =>
val massaged: RefFn[HTMLElement] =
(e: HTMLElement | Null) => Option(e.asInstanceOf[HTMLElement]).foreach(e => f(e).runNow())
  consume(massaged)
} `` should i replace html eimplicit def whyyyDoesItHaveToBeSoComplicated: ValueType[HTMLElement => Callback, RefFn[HTMLElement]] =
ValueType[HTMLElement => Callback, RefFn[HTMLElement]] { (consume, f) =>
  val massaged: RefFn[HTMLElement] =
    (e: HTMLElement | Null) => Option(e.asInstanceOf[HTMLElement]).foreach(e => f(e).runNow())

  consume(massaged)
} `` i should replace HTMlelement with TopNode ?
elkhadirzyad
@elkhadirzyad

@oyvind when i replace the function with

implicit def importantFunctionTodragTopNode :ValueType[HTMLElement => Callback, RefFn[TopNode]] =
    ValueType[HTMLElement => Callback, RefFn[TopNode]] { (consume, f) =>
      val massaged: RefFn[TopNode] =
        (e: TopNode | Null) => Option(e.asInstanceOf[HTMLElement]).foreach(e => f(e.asInstanceOf[HTMLElement]).runNow())

      consume(massaged)
    }

the drag is not working anymore

elkhadirzyad
@elkhadirzyad
the original function is
implicit def importantFunctionTodrag: ValueType[HTMLElement => Callback, RefFn[HTMLElement]] =
    ValueType[HTMLElement => Callback, RefFn[HTMLElement]] { (consume, f) =>
      val massaged: RefFn[HTMLElement] =
        (e: HTMLElement | Null) => Option(e.asInstanceOf[HTMLElement]).foreach(e => f(e).runNow())

      consume(massaged)
    }
Jason Pickens
@steinybot:matrix.org
[m]
Any particular reason for using js.Any over Any? Sébastien is saying that js.Any should never really be used except for in extends (https://matrix.to/#/!GPcZOobOJQzJgrKPRT:gitter.im/$ytxkthOd4OpqjqyVRH__7iVQv7QlSmyttWrOFvS_YR8?via=gitter.im&via=matrix.org)
Øyvind Raddum Berg
@oyvindberg
It's pretty arbitrary I'd say, i thought that was most correct @steinybot:matrix.org
I'd be happy to change it, it should be quite easy
Jason Pickens
@steinybot:matrix.org
[m]
The issue is when value?: any becomes value: UndefOf[js.Any]. There is no Evidence[String, js.Any] so you can't do value = "foo".
Rakshith Begane
@raxith_gitlab

If I have to compile React Material-UI to latest version how should I go about it? What are the challenges you would expect me to see

https://github.com/ScalablyTyped/Distribution/tree/master/m/material-ui

Øyvind Raddum Berg
@oyvindberg
It's hard @raxith_gitlab , see the links in ScalablyTyped/Converter#208 . The newer mui components are polymorphic in a way which is very hard to express in scala
That said i do have a plan to support it in some form, but I don't have the time to implement it for quite a while still
1 reply
Alexis Hernandez
@AlexITC
@raxith_gitlab there is an effort to compile those by https://github.com/nafg/scalajs-facades
doofin
@doofin
Hi ,I would like to know how to work with union types, something like this doesn't work(AuthUI.getInstance(): Any) match {case x@AuthUI => } which has the type |[AuthUI, Null]
Øyvind Raddum Berg
@oyvindberg
def asOption[T](ot: T | Null): Option[T] = Option(ot.asInstanceOf[T])
it's far from awesome, but I've been counting on scala 3 to fix the situation, heh. haven't had the opportunity to try that much yet
doofin
@doofin
Thanks,it works ! so the js Null is equal to null in Scala?
Øyvind Raddum Berg
@oyvindberg
Yes it is
doofin
@doofin
How to import individual components from one package? for example , what correspond to import { initializeApp } from 'firebase/app'; ? It seems that only a global firebase object ^ with @JSImport("firebase", JSImport.Default) is generated under typings.firebase.mod.default
doofin
@doofin
oh seems that I should use the one from
ScalablyTyped / Distribution rather than compile from ts source ,is this repo manually improved?
Alexander Samsig
@asamsig:matrix.org
[m]
@doofin: This might be of interest: ScalablyTyped/Converter#338
doofin
@doofin
Thanks,I am using 1.0.0-beta36 which contains this pr,do I need to do extra setup?
Alexander Samsig
@asamsig:matrix.org
[m]
doofin
@doofin
Thanks,I think most simple method might be just use separate packages for firebase/app ,etc,although it's not recommended
doofin
@doofin
However the versions of those components package have to be manually figured out,their numbering are different
Øyvind Raddum Berg
@oyvindberg
Hey @doofin . The newest versions of firebase are broken unfortunately. I'd recommend using a slightly older version for now and upgrade later. I created an issue to track the fix here ScalablyTyped/Converter#367
I mean surely you can get the newest version to work by digging into the scoped @firebase/foo packages, or by copy/pasting and adapting the imports of some generated code. The firebase/app and so on modules are not generated because of that missing support
doofin
@doofin
I am using firebase 8.10.0 rather than the newest one,maybe it's not old enough?
Lorenzo Gabriele
@lolgab

@doofin I also use firebase but I use it from the global scope and it works pretty well, actually!
You still need to add:

    <script src="/__/firebase/8.8.0/firebase-app.js"></script>
    <script src="/__/firebase/8.8.0/firebase-analytics.js"></script>
    <script src="/__/firebase/8.8.0/firebase-auth.js"></script>
    <script src="/__/firebase/8.8.0/firebase-firestore.js"></script>
    <script src="/__/firebase/init.js"></script>

to my html file

1 reply
gilbertbigras
@gilbertbigras

Hello, The following code (slinky scalablytyped used to work)
Route(RouteProps().setPath("/JumboHello").setRender(_ => JumboHello()))
Now I get this message and cannot figure out how to fix this:

type mismatch;
 found   : String("/JumboHello")
 required: ? | scala.scalajs.js.Array[?]bloop

Any help would be appreciated. Thanks

Alexis Hernandez
@AlexITC
Oh, I think I faced something similar a long time ago, if I rememer, it was related to using a newer version from react-router-dom/react-router, this is what I did: wiringbits/cazadescuentos@f9c6ab1
  • Add react-router dependency to prevent picking a newer react-router-dom
  • Commit the yarn.lock to get reproducible builds
Manu Zhang
@manuzhang
Hi all, my site build on sbt-converter 1.0.0-beta36 (slinky flavour) started to fail two days ago without any code changes https://github.com/manuzhang/MyOvercast/runs/4420151203?check_suite_focus=true. Has anyone seen similar issues? Such errors were reported
possible cause: maybe a semicolon is missing before `value dataSourceVarargs`?
elkhadirzyad
@elkhadirzyad
Hello , r there any news concerning material ui 4 ?
Øyvind Raddum Berg
@oyvindberg
@elkhadirzyad yes! I fixed it just last night! It may be a few weeks until everything is ready for a release, but it's coming now :)
Actually i worked on version 5, so we'll be current. Same fix should also work a bunch of similar libraries
@manuzhang i believe @AlexITC answered your question as well :)
Manu Zhang
@manuzhang
@oyvindberg It looks simply switching from npm to yarn fixed it. Not sure how to commit multiple yarn.lock files though
./js/target/scala-2.13/scalajs-bundler/main/node_modules/copy-to-clipboard/yarn.lock
./js/target/scala-2.13/scalajs-bundler/main/node_modules/browserify-zlib/yarn.lock
./js/target/scala-2.13/scalajs-bundler/main/node_modules/uri-js/yarn.lock
./js/target/scala-2.13/scalajs-bundler/main/node_modules/wildcard/yarn.lock
./js/target/scala-2.13/scalajs-bundler/main/node_modules/source-map-loader/yarn.lock
Øyvind Raddum Berg
@oyvindberg
There should be one in the root of your repo. You're not supposed to check in anything from node_moduled
Emerson Coskey
@EmersonCoskey
ScalablyTyped seems to not be able to find npm or yarn when reloading my project. I'm on macOS, and have both installed through homebrew. Is this a common issue, and what can I do to fix it?
Emerson Coskey
@EmersonCoskey
how can I change what directory it looks in for npm?
Øyvind Raddum Berg
@oyvindberg
Heh, i haven't really had the time to dig into that, but it's definitely something I've seen. A failsafe solution is to symlink yarn into for instance /usr/bin so it's always in your PATH. If you find a better solution feel free to share! :)
Emerson Coskey
@EmersonCoskey
ok thanks! seems like a good temporary solution at the very least
Emerson Coskey
@EmersonCoskey
umm yarn and yarnpkg are already symlinked in usr/local/bin, which is on the PATH
Alexis Hernandez
@AlexITC
@oyvindberg have you tried scalablytyped with https://marmelab.com/react-admin/? I feel the problems are similar to the ones with mui4/mui5
Also, I wonder if new releases will still be available for scala 2.13
Øyvind Raddum Berg
@oyvindberg
@AlexITC no I haven't. If the problem seems to be components where you can specify the underlying component (like a, MyComponent, etc), and all the props follow from that, it is the exact same issue. loads of the most useful react frameworks now follow this pattern
I haven't solved solved the problem, but I found a shortcut which gives good enough results. There is a small boilerplate which needs to be provided for each library to apply that shortcut in a library-specific manner
also yes, scala 2.13 will be supported indefinitely. All the structure to apply somewhat different transformations between scala 2/3 is already there, and there is no hurry to remove it
Øyvind Raddum Berg
@oyvindberg
@EmersonCoskey are you using ScalablyTypedConverterExternalNpmPlugin?
Øyvind Raddum Berg
@oyvindberg
if so maybe this helps ScalablyTyped/Demos@855ab12
Alexis Hernandez
@AlexITC
Thanks for the update
Alexis Hernandez
@AlexITC

I wonder if anyone has an example for using scalablytyped/slinky/recaptcha, it is worth checking before writing my own integration.

I see that the old converter had bindings for it.