Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 01 21:50

    oyvindberg on v1.0.0-beta33

    (compare)

  • Jun 01 21:49

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Jun 01 21:07

    oyvindberg on support-abstract-new-syntax

    (compare)

  • Jun 01 21:06

    oyvindberg on master

    Support `abstract new` syntax (… (compare)

  • Jun 01 20:59

    oyvindberg on support-abstract-new-syntax

    Support `abstract new` syntax (compare)

  • Jun 01 20:45

    oyvindberg on dotty-support

    better erasure for this.type fixup `val a: Null = js.native` seems… and 2 more (compare)

  • May 29 07:56

    oyvindberg on dotty-support

    fork tests (compare)

  • May 29 07:00

    oyvindberg on dotty-support

    workaround for https://github.c… (compare)

  • May 29 06:51

    oyvindberg on dotty-support

    build snapshots (compare)

  • May 25 08:16

    oyvindberg on dotty-support

    scalafmt (compare)

  • May 25 08:08

    oyvindberg on dotty-support

    bump runtime (compare)

  • May 24 23:38

    oyvindberg on master

    Update sbt-mdoc to 2.2.21 (#306… (compare)

  • May 24 23:38

    oyvindberg on master

    Update scalatest to 3.2.9 (#307… (compare)

  • May 24 23:38

    oyvindberg on master

    Update os-lib to 0.7.7 (#308) … (compare)

  • May 24 23:32

    oyvindberg on master

    Minimization: Include what `Sho… (compare)

  • May 24 23:32

    oyvindberg on minimization-bugfix

    (compare)

  • May 24 23:07

    oyvindberg on poc-laminar

    scalafmt (compare)

  • May 24 22:52

    oyvindberg on poc-laminar

    laminar poc (compare)

  • May 24 21:02

    oyvindberg on minimization-bugfix

    Minimization: Include what `Sho… (compare)

  • May 24 21:01

    oyvindberg on master

    Update sourcecode to 0.2.7 (#30… (compare)

Peter Storm
@peterstorm
If I use metals in VsCode
Will it have to go through this every startup then?
Or can it use some cached stuff?
Øyvind Raddum Berg
@oyvindberg
that's good. did you have to adjust some sbt config or environment variables? or is this just the project import in metals which allocates more memory?
no, it'll be cached
you can also share cached conversion runs between machines using remote cache https://scalablytyped.org/docs/remotecache
Peter Storm
@peterstorm
i googled the thing about heap size, and found you coul start sbt like so sbt -men 2048:)
Øyvind Raddum Berg
@oyvindberg
so it'll be instantaneous until you change anything
aha. there are some config files somewhere as well so you don't have to always repeat it
Peter Storm
@peterstorm
Yeah, I'm on windows for work at the moment, and it took too long to figure out where that lives on Windows :D I'm usually a unix guy
mvillafuertem
@mvillafuertem
@peterstorm you can set this options -men 2048 in .sbtops or .jvmopts file
Peter Storm
@peterstorm
Cheers
Damn, material ui core takes ages to build :D I think I have waited for atleast 10 minutes :D
Øyvind Raddum Berg
@oyvindberg
It builds in less than two minutes on my newish laptop, you may want to give sbt even more memory
Peter Storm
@peterstorm
Alright, gotcha
Peter Storm
@peterstorm
I cant get it to build, it just goes on forever
Øyvind Raddum Berg
@oyvindberg
I don't suppose you enabled stEnableScalaJsDefined? that will leave it compiling for 10x as long.
other than that it's hard to say. you can thread dump sbt and see what scalac is up to. you can check how much cpu it uses, if its blowing through most/all cores its likely its stuck in GC, if its mostly stuck at 100% its compiling
Peter Storm
@peterstorm
Oh yes I did :D
I will try removing that, thank you
Peter Storm
@peterstorm
That worked, thanks!
Øyvind Raddum Berg
@oyvindberg
cool, and make sure to checkout the demos
And in case you havent seen, material-ui 3.9.3 is the newest that works well, there is an open issue for version 4+
Peter Storm
@peterstorm
Yeah, i basically snatched the dashboard demo and going to use that to build on further I think :)
Alexis Hernandez
@AlexITC
@oyvindberg I have finally merged my changes to the demos, unfortunately, circleci is failing, do you have idea why? It seems that the process is being killed by a memory error: https://app.circleci.com/pipelines/github/ScalablyTyped/SlinkyDemos/15/workflows/6a607a20-7e39-4003-8fec-ef40ffa5418d/jobs/18
Øyvind Raddum Berg
@oyvindberg
Cool, thanks @AlexITC ! I can take care of ci tomorrow :)
Peter Storm
@peterstorm
Can anyone help me import font-awesome with Slinky? I installed it via npmDependencies, but have no idea how to import it 😅
Peter Storm
@peterstorm
Cheers, thank you! Is there a way to be able to use the classes in className? @oyvindberg
Peter Storm
@peterstorm
Hmmm, having trouble with MaterialUI and the Menu component. It doesn't expose the methods that are usually there with other components :( So I cant set the props for some reason...
Weird, it needed an argument for apply first
Øyvind Raddum Berg
@oyvindberg
Required props need to be provided before you get a builder instance
How about the classnames? What are you trying to do that is not working?
Peter Storm
@peterstorm
Like so svg(slinky.web.svg.className := "svg-inline--fa fa-bars fa-w-14 fa-fw"
the fa bits, I just really wanna be able to use thos
And a different question, I can't seem to figure out. Material UI's Menu component has a anchorEl prop, that takes a HTMLElement
I want a useState hook with a HTMLElement in it, but how do I define the "null" case?
Peter Storm
@peterstorm
This is what I have by the way:
@react
object Header {

    private val css = HeaderStyle

    case class Props(menuHandler: () => Unit, userProfile: String)

    val component = FunctionalComponent[Props] { props =>

        val (profile, setProfile) = useState(???)
        val (profileOpen, setProfileOpen) = useState(false)

        def profileClickHandlerOpen(event: SyntheticMouseEvent[dom.raw.HTMLElement]): Unit = {
            setProfile(event.currentTarget)
            setProfileOpen(true)
        }

        def profileClickHandlerClose: SyntheticEvent[Event, Object] => Unit = _ => {
            setProfileOpen(false)
            setProfile(???)
        }

        header(className := "headerArea")(
            Grid.container(true).spacing(GridSpacing.`8`).alignItems(GridItemsAlignment.center)(
                Hidden.mdUp(true)(
                    Grid.item(true).xs(GridSize.`2`)(
                        ul(className := "headerLeft")(
                            li(onClick := props.menuHandler, className := "menuTrigger")(
                                svg(slinky.web.svg.className := "svg-inline--fa fa-bars fa-w-14 fa-fw", slinky.web.svg.role := "img", slinky.web.svg.aria-"hidden" := "true", CustomAttribute[String]("focusable") := "false", CustomAttribute[String]("date-prefix") := "fal", 
                                                CustomAttribute[String]("data-icon") := "bars", CustomAttribute[String]("xlmns") := "http://www.w3.org/2000/svg", CustomAttribute[String]("viewBox") := "0 0 448 512")(
                                                    path(fill := "currentColor", d := "M442 114H6a6 6 0 0 1-6-6V84a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6zm0 160H6a6 6 0 0 1-6-6v-24a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6zm0 160H6a6 6 0 0 1-6-6v-24a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6z")
                                                )
                            )
                        )
                    )
                ),
                Grid.md(GridSize.`12`).item(true).xs(GridSize.`10`)(
                    ul(className := "headerRight")(
                        div(className := "profileWrap")(
                            span(className := "profileImg")(
                                img(src := Avatar.asInstanceOf[String], alt := "avatar")
                            ),
                            span(onClick := (event => profileClickHandlerOpen(event)), className := "name")(
                                span(className := "text")("test"),
                                i(className := "fa fa-angle-down")
                            ),
                            Menu.apply(profileOpen).keepMounted(true).anchorEl(profile).onClose(profileClickHandlerClose).elevation(1).className("profileWrapper").anchorOrigin(PopoverOrigin(center, top)).getContentAnchorElNull
                                .transformOrigin(PopoverOrigin(center, top)).classes(PartialClassNameMapMenuCl.apply().setPaper("profilePaper"))(
                                    ul(
                                        li("test"),
                                        li("test")
                                    )
                                    /* Button.component(router.Link[String](to = "/profile"): ReactElement)("Profile"),
                                    Button.component(router.Link[String](to = "/"): ReactElement)("Logout") */
                                )
                        )
                    )
                )
            )
        )
    }
}
Øyvind Raddum Berg
@oyvindberg
@peterstorm why do you want to construct the icon so manually? in the two examples I gave you you get ready to use react components so you don't even have to say svg yourself
For things which can be T | Null you have to cast, at least until scala 3. I typically write some helper methods for it, but there is nothing in scala, scala.js or ST to make that smooth to work with for now.
btw if you're having problems with slinkys dom dsl (:= and friends) I can recommend to have a look inside typings.react.components, you will find all of a, button and so on using the same builder pattern as the ST components
Peter Storm
@peterstorm
@oyvindberg I honestly just knicked that piece of code from somewhere else, and I reckon it's because the bars are animating then? I 'm not really versed in stuff like that
Peter Storm
@peterstorm
I'm just gonna used the MatrialUI icons, I don't know why I didn't think about that, thank you again
Pascal Mengelt
@pme123

did you figure it out @pme123 ? seems like its coming from somewhere inside webpack?

Ok finally I found the time - started from scratch and it worked - I created a simple example project with all the nice stuff from the Slinky starter project and a working Scalably Plotly example: https://github.com/pme123/scalably-slinky-example

Øyvind Raddum Berg
@oyvindberg
cool @pme123 . in the meantime I also added this little demo https://github.com/ScalablyTyped/SlinkyDemos/blob/master/plotly/src/main/scala/demo/Main.scala
Peter Storm
@peterstorm
Is there a way I can force recompilation of certain npm dependencies? I'm trying to use recharts, but even though my code compiles I get errors like this:
Uncaught TypeError: Cannot read property 'ResponsiveContainer' of undefined
    at $c_Ltypings_recharts_components_ResponsiveContainer$.make__Ltypings_recharts_components_ResponsiveContainer$__sjs_js_Array (ResponsiveContainer.scala:40)
    at eval (OrderChart.scala:33)
    at $c_sjsr_AnonFunction1.apply__O__O (AnonFunctions.scala:27)
    at $c_Lslinky_core_FunctionalComponent$.slinky$core$FunctionalComponent$$$anonfun$apply$1__sjs_js_Object__F1__sr_ObjectRef__Lslinky_core_facade_ReactElement (FunctionalComponent.scala:108)
    at OrderChart (FunctionalComponent.scala:106)
    at renderWithHooks (react-dom.development.js:14803)
    at mountIndeterminateComponent (react-dom.development.js:17482)
    at beginWork (react-dom.development.js:18596)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
I just took the SimpleLineChart from the MaterialUI example. And I got it to work on its own, afaik
Peter Storm
@peterstorm
And I just tried to build my project on my linux machine, and it complains that a certain type isn't part of the materialUICore package... but it works on my Windows Machine :D typings.materialUiCore.anon.PartialClassNameMapExpansDisabled works fine on windows, but not my linux machine :(
Øyvind Raddum Berg
@oyvindberg
that's weird. have you tried clean and all of that?
Peter Storm
@peterstorm
To which one of the errors? :D