Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 01 22:51

    oyvindberg on refactor-remote-cache

    (compare)

  • May 01 22:51

    oyvindberg on master

    Refactor run cache and sbt plug… (compare)

  • May 01 22:34

    oyvindberg on refactor-remote-cache

    Refactor run cache and sbt plug… (compare)

  • Apr 30 22:40

    oyvindberg on master

    Be more tolerant with missing d… (compare)

  • Apr 30 14:41

    oyvindberg on scala-ast-codec

    (compare)

  • Apr 30 14:41

    oyvindberg on master

    JSON codec for scala AST (#291)… (compare)

  • Apr 30 14:19

    oyvindberg on scala-ast-codec

    JSON codec for scala AST - Col… (compare)

  • Apr 30 09:45

    oyvindberg on master

    Update sourcecode to 0.2.6 (#29… (compare)

  • Apr 30 09:45

    oyvindberg on master

    Update fansi to 0.2.13 (#298) … (compare)

  • Apr 28 22:22

    oyvindberg on master

    Update sbt-mdoc to 2.2.20 (#295) (compare)

  • Apr 28 22:20

    oyvindberg on master

    Update scalatest to 3.2.8 (#296) (compare)

  • Apr 28 22:20

    oyvindberg on master

    Update os-lib to 0.7.6 (#299) (compare)

  • Apr 12 21:13

    oyvindberg on v1.0.0-beta32

    (compare)

  • Apr 12 21:13

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Apr 12 01:10

    oyvindberg on sbt15

    (compare)

  • Apr 12 01:10

    oyvindberg on master

    Support sbt 1.5.x along with 1.… (compare)

  • Apr 12 01:03

    oyvindberg on sbt15

    Support sbt 1.5.x along with 1.… (compare)

  • Apr 11 23:42

    oyvindberg on scala-ast-codec

    JSON codec for scala AST - Col… (compare)

  • Apr 02 21:46

    oyvindberg on reintroduce-circe-fork

    (compare)

  • Apr 02 21:46

    oyvindberg on master

    Revert "Prepare to release on m… (compare)

Ø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
Øyvind Raddum Berg
@oyvindberg
The latter
For the former you may want to turn off stReactEnableTreeShaking if you have that enabled for recharts
Peter Storm
@peterstorm
I dont have that enabled :(
Should I link my build file?
Peter Storm
@peterstorm
How I tried starting a whole new slinky project, and just importing the depencies for the MaterialUI project, and I have the same error... so weir :(
The recharts error :(
Peter Storm
@peterstorm
I guess I'll try to turn it on actually
Peter Storm
@peterstorm
That didnt work either :( Any other suggestions?
Øyvind Raddum Berg
@oyvindberg
@peterstorm I had a quick look on a computer now.
for recharts, first check that the slinky demo repo works for you. ResponsiveContainerworks there, so there is no particularly good reason why it shouldnt work in another project.
for the linux build issue if it doesnt go away with clean, sbt restart and so on I'll need more info. run show stConversionOptions in sbt, and also give me the full error message please
Peter Storm
@peterstorm
Ill try and clone the repo, thanks :)
Peter Storm
@peterstorm
I actually tried to just replace the type with a type without the Disabled at the end, even though the method said it needed that other type, and it worked! Weirdly 😅