Where communities thrive


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

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Jan 22 00:44

    oyvindberg on v1.0.0-beta29.2

    (compare)

  • Jan 22 00:44

    oyvindberg on v1.0.0-beta29-patch

    Update ammonite-ops to 2.3.8 Update sbt-mdoc to 2.2.13 Better error logging in CI and 12 more (compare)

  • Jan 22 00:44

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Jan 18 20:06

    oyvindberg on master

    Update sbt-mdoc to 2.2.15 (compare)

  • Dec 19 2020 17:56

    oyvindberg on master

    Update library-developer.md Ad… (compare)

  • Dec 15 2020 02:32

    oyvindberg on scala-companion-objects

    (compare)

  • Dec 14 2020 23:08

    oyvindberg on scala-companion-objects

    Generate more specific types fo… (compare)

  • Dec 14 2020 01:25

    oyvindberg on v1.0.0-beta29.1

    (compare)

  • Dec 14 2020 01:25

    oyvindberg on v1.0.0-beta29-patch

    Another bugfix for remote cache (compare)

  • Dec 14 2020 01:25

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 14 2020 00:55

    oyvindberg on master

    Restore compatibility with old … (compare)

  • Dec 14 2020 00:24

    oyvindberg on master

    Restore compatibility with old … (compare)

  • Dec 14 2020 00:03

    oyvindberg on master

    Another bugfix for remote cache (compare)

  • Dec 13 2020 12:17

    oyvindberg on master

    Reintroduce `^` classes (compare)

  • Dec 11 2020 09:55

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 11 2020 09:54

    oyvindberg on master

    add scalablytyped icon (#235) … (compare)

  • Dec 11 2020 09:49

    oyvindberg on master

    try to speed up CI (compare)

  • Dec 11 2020 09:40

    oyvindberg on improve-class-extraction

    (compare)

  • Dec 11 2020 09:40

    oyvindberg on master

    Improve ExtractClasses and Reso… (compare)

Peter Storm
@peterstorm
I've basically been doing that :(
But yeah, it must be a config issue
Because it works fine when I run the demo repo
Peter Storm
@peterstorm
IT WORKS!
I deleted every single folder that didnt have anything to do with my code
did sbt clean
And then tried to do it all over again :D
Alexis Hernandez
@AlexITC
great!
Øyvind Raddum Berg
@oyvindberg
@AlexITC I'm struggling with the CI for the demo repo, the builder container doesn't have enough memory to build mui. What it means is that CI will be green if I run stPublishCache from my computer, but it's not able to publish itself. If you want to update the published demo you need to run dist in sbt and check in the results, which will be on the docs folder
nice @peterstorm :)
also @AlexITC an easy fix for missing history api on github pages would be to use hash routing instead.
Alexis Hernandez
@AlexITC
The CI is an issue I face in my repos as well, the hash routing is a nice idea
Øyvind Raddum Berg
@oyvindberg
I'm thinking to just publish mui core and icons to maven central
as long as its 3.9.3 it's not changing much anyway
and deal properly with it later
it's just a small handful of libraries which end up being so incredibly much source code anyway
I ran dist now and pushed it by the way
Alexis Hernandez
@AlexITC
that sounds reasonable to me, it will definitely help in some of our internal projects because the compile time will be reduced considerably
Øyvind Raddum Berg
@oyvindberg
But @AlexITC if you setup remote cache on s3, ci will be instant
Alexis Hernandez
@AlexITC
Agree, and I plan to do that, but the package maven library can certainly help to new devs because it is less configuration
Øyvind Raddum Berg
@oyvindberg
[warn ] 2020-11-16T00:52:31.544315Z Phase3Compile.scala:144  Built /home/olvind/.ivy2/local/org.scalablytyped.slinky/react_sjs1_3.0.0-M1/16.9-dt-20200711Z-805e37/jars/react_sjs1_3.0.0-M1.jar in 48664 ms [id => react, thread => 1, phase => build, flavour => SlinkyFlavour]
The future is approaching
nafg
@nafg
what future is that?
Øyvind Raddum Berg
@oyvindberg
it's building ST for scala 3.0.0-M1, using 2.13 version of slinky
nafg
@nafg
oh exciting :)
Øyvind Raddum Berg
@oyvindberg
I'm quite curious how it'll turn out with proper union types
Sören Brunk
@sbrunk
🤞
Peter Storm
@peterstorm
Anyone here a master of Refs and MateriaulUI? :D
Peter Storm
@peterstorm
Looks like the inputRef doesnt work on TextFields in Material UI, I get a null Pointer :(
Vitaly Lavrov
@lavrov

I'm quite curious how it'll turn out with proper union types

def foo(color: "primary" | "secondary") would be quite close to TS version :)

nafg
@nafg
@elkhadirzyad where in that line is the error?
elkhadirzyad
@elkhadirzyad
@nafg , its ok
elkhadirzyad
@elkhadirzyad

hello, i want to display the demo of circular progress integration with using styleBuilder given in material ui demos, when i add val classes = styles1(js.undefined), it gives me blank pagen any suggestions`object DemoCircularIntegration {
case class Props()
//val classes = styles(js.undefined)
case class State(loading: Boolean = false, success: Boolean = false) {
def setLoading = copy(success = false, loading = true)

def setSuccess = copy(success = true, loading = false)

}

class Backend(t: BackendScope[Props, State]) {
var timer: js.UndefOr[js.timers.SetTimeoutHandle] = js.undefined

def unmount = Callback {
  timer.foreach(js.timers.clearTimeout)
  timer = js.undefined
}

def setSuccess = Callback {
  timer = js.timers.setTimeout(2000)(t.modState(_.setSuccess).runNow())
}

def handleButtonClick(loading: Boolean) = {
  (t.modState(_.setLoading) >> setSuccess).when(!loading) >> Callback.empty
}
val classes = styles1(js.undefined)

def render(props: Props, state: State): VdomElement = {
 // val css = props.style
 // val classes = css.styles
  //val buttonCss = if (state.success) css.buttonSuccess else css.common.emptyStyle


    <. div(
     <.  div(
          Mui.Fab.color(typings.materialUiCore.mod.PropTypes.Color.primary).onClick(_ => handleButtonClick(state.loading))(

            if (state.success) Muii.Check() else Muii.Save()
          ),
        HicpCircularProgress(size=68,className="fabProgress")().when(state.loading)
        ),
       div(
          HicpRaisedButton(touchTapCallback=_ =>handleButtonClick(state.loading), disabled=state.loading)


          ("Accept terms")
          ),
        HicpCircularProgress(size=24,className="buttonProgress")().when(state.loading)
        )

}

}`

Alexis Hernandez
@AlexITC
See this example
elkhadirzyad
@elkhadirzyad
@AlexITC , i want to include val classes = styles1(js.undefined) but i dont know where
Alexis Hernandez
@AlexITC
See this another example
elkhadirzyad
@elkhadirzyad
@AlexITC thank u, however i use scalajs react not slinky, i have State(), Prop(), Backend(), render() functions, i dont know where to put this line val classes = styles1(js.undefined) in order to use styles, when i put it inside render(), the page is blank
Alexis Hernandez
@AlexITC
oh, apologize, I got used to slinky and forgot that there are other flavours
elkhadirzyad
@elkhadirzyad
@oyvindberg , any idea where to put the line val classes = styles(js.undefined), when i put it in render, it gives blank page
Øyvind Raddum Berg
@oyvindberg
@elkhadirzyad render is probably the right place for it. checkout the error message in the browser console
@lavrov yes, "foo" | "bar" will be interesting, and also T | Null, and just general type inference and compile times. I hope it will be a big improvement :)
Øyvind Raddum Berg
@oyvindberg
@peterstorm I gave refs a shot now. it'll be fairly untyped, and refs are almost always the wrong answer, but if you really have to you just have to handle null case (in this case with an Option)
diff --git a/material-ui/src/main/scala/demo/button/Button.scala b/material-ui/src/main/scala/demo/button/Button.scala
index 56de112..f01beaf 100644
--- a/material-ui/src/main/scala/demo/button/Button.scala
+++ b/material-ui/src/main/scala/demo/button/Button.scala
@@ -12,7 +12,7 @@ import typings.materialUiCore.createMuiThemeMod.{Theme, ThemeOptions}
 import typings.materialUiCore.spacingMod.SpacingOptions
 import typings.materialUiCore.{stylesMod, components => Mui}
 import typings.materialUiStyles.components.ThemeProvider
-import typings.std.global.window
+import typings.std.global.{console, window}

 import scala.scalajs.js

@@ -47,10 +47,17 @@ object ButtonTest {
       s"Increment it, ${props.name}"
     )

+    val ref = Hooks.useRef[Any](null)
+
     div(
       /* text field controlled by the value of the state hook above*/
-      Mui.TextField.StandardTextFieldProps().value(state).disabled(true),
-      incrementButton
+      Mui.TextField.StandardTextFieldProps().value(state).disabled(true).innerRef(ref),
+      incrementButton,
+      Option(ref.current).map(x => {
+        val dynamic = x.asInstanceOf[js.Dynamic]
+        console.warn(dynamic)
+        "has reference"
+      })
     )
   }
 }
Peter Storm
@peterstorm
Ah ok, didn’t know refs was not the right answer. I solved it using useState instead and the onchange property, but thanks a lot for getting back :)
Øyvind Raddum Berg
@oyvindberg
most usage of ref is to break reacts rules. in a few cases you have to though, so it's nice that it at least kind of works
Peter Storm
@peterstorm
Anybody know why a Material Dialog doesn’t want to preserve styling when I give it Grid with container flag, and children as Grid with item flag? Everything just fills the whole page. I’m using a full screen Dialog.
Alexis Hernandez
@AlexITC
@oyvindberg did you ever deployed the material-ui generated code to maven central?
elkhadirzyad
@elkhadirzyad
hello @oyvindberg , i have a question about useState() function, is it mandatory to use it inside ScalaFnComponent type ?
Øyvind Raddum Berg
@oyvindberg
@AlexITC no, didnt get around to it
@elkhadirzyad read the react hooks documentation