Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 10:57
  • Jan 30 2019 22:22
    bitpirate starred japgolly/scalajs-react
  • Jan 30 2019 08:11

    japgolly on master

    Update docs for changes in 1.4.0 (compare)

  • Jan 29 2019 13:20
  • Jan 28 2019 08:08
    booleguo starred japgolly/scalajs-react
  • Jan 28 2019 04:09

    japgolly on v1.4.0

    (compare)

  • Jan 28 2019 04:05

    japgolly on master

    Towards v1.4.1 (compare)

  • Jan 28 2019 04:04

    japgolly on master

    Prepare for v1.4.0 Upgrade React to 16.6.3 React.lazy and 85 more (compare)

  • Jan 28 2019 04:04
    japgolly closed #521
  • Jan 28 2019 04:04
    japgolly opened #521
  • Jan 28 2019 04:03

    japgolly on v1.4.x

    Add note about Reusability/Reus… doc formatting Prepare to release v1.4.0 (compare)

  • Jan 28 2019 04:02
    wiitht starred japgolly/scalajs-react
  • Jan 28 2019 03:18

    japgolly on v1.4.x

    Test AsyncCallback.init Update Travis CI caching (compare)

  • Jan 28 2019 03:02

    japgolly on v1.4.x

    Update Travis CI cache dirs Revise changelog (compare)

  • Jan 28 2019 03:00
    japgolly labeled #520
  • Jan 28 2019 03:00
    japgolly labeled #519
  • Jan 27 2019 17:36
  • Jan 26 2019 06:49
    japgolly commented #520
  • Jan 26 2019 05:55
    japgolly commented #519
  • Jan 26 2019 02:35
    cquiroz opened #520
Matthew de Detrich
@mdedetrich
@yilinwei
Antonio R. Rodríguez Santiesteban
@rodant

Hi here, I'm having also issues migrating from 1.4.2 to 1.7.7, router errors like:

"Multiple (2) (unconditional) routes specified for path #explorer?iri=https://ochun1.inrupt.net/"

and I don't grasp why. Here is the code:
`
sealed trait AppPage

case object Home extends AppPage

case class Explorer(iri: String = IRI.BlankNodeIRI.toString) extends AppPage {
lazy val dirIri: String = IRI(if (iri.endsWith("/")) iri else s"$iri/").normalize.toString
}

private val config = RouterConfigDsl[AppPage].buildConfig { dsl =>
import dsl._

(trimSlashes
  | staticRoute(root, Home) ~> render(SPOTBox.Page(IRI.BlankNodeIRI.toString))
  | dynamicRouteCT[Explorer]("#explorer?iri=" ~ string(".+").caseClass[Explorer]) ~> dynRender(p => SPOTBox.Page(p.dirIri)))
  .notFound(redirectToPage(Home)(SetRouteVia.HistoryReplace))
  .renderWith(layout)

}`

thanks for any hints in advance.

Antonio R. Rodríguez Santiesteban
@rodant
Ok, problem solved by using removeLeadingSlashes as first Rule.
jhegedus42
@jhegedus42
I am upgrading now everything I can and I get lots of linking errors from scalajs-react-bridge
image.png
jhegedus42
@jhegedus42
    val scala             = "2.12.10"
    val scalaJSDom          = "1.1.0"
    val scalajsReact      = "1.7.7"
    val scalaCSS          = "0.6.1"
    val kinoplan          = "0.2.1"
    val akka     = "2.5.23"
    val akkaHttp = "10.1.9"

    val monocleVersion   = "2.0.0"
    val scalaTestVersion = "3.0.8"
and related imports:
      "com.github.japgolly.scalajs-react" %%% "core"  % versions.scalajsReact,
      "com.github.japgolly.scalajs-react" %%% "extra" % versions.scalajsReact,
      "com.github.japgolly.scalacss" %%% "ext-react"  % versions.scalaCSS,
      "com.github.japgolly.scalacss" %%% "core"       % versions.scalaCSS,
      "com.github.japgolly.scalacss"                  %% "ext-scalatags" % versions.scalaCSS,
      "org.scala-js" %%% "scalajs-dom"                % versions.scalaJSDom,
      "com.payalabs" %%% "scalajs-react-bridge"           % "0.8.2",
      "org.scalatest" %%% "scalatest"                     % versions.scalaTestVersion % "test",
      "io.kinoplan" %%% "scalajs-react-material-ui-core"  % versions.kinoplan,
      "io.kinoplan" %%% "scalajs-react-material-ui-icons" % versions.kinoplan,
      "io.kinoplan" %%% "scalajs-react-material-ui-lab"   % versions.kinoplan
any ideas where to start debugging this ?
it compiles just fine
Artsiom Miklushou
@mikla
@jhegedus42 for me it doesn't compile...

any ideas where to start debugging this ?

maybe you can start with upgrading you Scala to 2.13, 2.12 is kind of quite old.

jhegedus42
@jhegedus42
I am not sure I should upgrade
things tend to be always a bit lagging behind
bleeding edge is always a bit problematic
I am upgrading stuff and now everying breaks...
in any case ...
i solved it

@jhegedus42 for me it doesn't compile...

you mean the git code ?

this ?
jhegedus42
@jhegedus42
well, now I am having strange errors like this :
arn] Module Warning (from ./node_modules/source-map-loader/index.js):
[warn] (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../../../ramnivas/open-source/scalajs-react-bridge/core/target/scala-2.12/src_managed/main/com/payalabs/scalajs/react/bridge/GeneratedImplicits.scala': Error: Can't resolve '../../../../../../../../../../../ramnivas/open-source/scalajs-react-bridge/core/target/scala-2.12/src_managed/main/com/payalabs/scalajs/react/bridge/GeneratedImplicits.scala' in '/Users/joco/dev/im/github_private/im2020/modules/js/target/scala-2.12/scalajs-bundler/main'
GeneratedImplicits
which comes from :
 IO.write(file, s"""
                    |package com.payalabs.scalajs.react.bridge
                    |
                    |import scala.scalajs.js
                    |import scala.scalajs.js.Any._
                    |import japgolly.scalajs.react.CallbackTo
                    |
                    |trait GeneratedImplicits {
                    |  $functions
                    |}
        """.stripMargin.trim
  )
but that is about source maps
[warn] Module Warning (from ./node_modules/source-map-loader/index.js):
so no big deal
Scala 2.13 ^
it's quite a big lib upgrade
jhegedus42
@jhegedus42
wow
I don't know what I did
but things started to work now again!
mvillafuertem
@mvillafuertem
hi there, i am trying to write a simple facade but i am getting this error. TypeError: null is not an object (evaluating 'c.ctor__Ljapgolly_scalajs_react_CtorType') I've been looking at other examples of facade and I don't know what I can be doing wrong. Any hint? Thanks in advance.

I have test with this

// Test 1
@js.native
@JSImport("@react-navigation/stack", JSImport.Namespace)
object RawComponent extends js.Object {
  def createStackNavigator(props: js.Object): js.Any = js.native
}

private val component =
    JsFnComponent[js.Object, Children.Varargs](RawComponent)


// Test 2

@js.native
@JSImport("@react-navigation/stack", "createStackNavigator")
object RawComponent extends js.Function1[js.Any, js.Any] {
  def apply(i: js.Any): js.Any = js.native
}

private val component =
    JsFnComponent[js.Object, Children.Varargs](RawComponent)

the original component https://github.com/react-navigation/react-navigation/blob/master/packages/stack/src/navigators/createStackNavigator.tsx#L28

Øyvind Raddum Berg
@oyvindberg
@mvillafuertem IIRC that is a function which returns a component. You can call it normally, and then put the result into JsComponent
mvillafuertem
@mvillafuertem
@oyvindberg Thanks! now it looks like this

@js.native
@JSImport("@react-navigation/stack", JSImport.Namespace)
object RawComponent extends js.Object {
  def createStackNavigator(): StackNavigator = js.native
}

@js.native
trait StackNavigator extends js.Object {

  val Navigator: ComponentClassP[js.Object] = js.native
  val Screen:    ComponentClassP[js.Object] = js.native

}
private val Stack = RawComponent.createStackNavigator()

val Navigator = JsFnComponent[DefaultNavigatorOptions[StackNavigationOptions, ParamListBase], Children.Varargs](Stack.Navigator)
 val Screen    = JsFnComponent[js.Object, Children.Varargs](Stack.Screen)
Mayeul Marcadella
@Marcadella_gitlab

Hi, Scalajs-react won't apply width and size to an img for some reason.

<.img(
            ^.src := ...,
            ^.width := "50",
            ^.height := "50"
          )

But the DOM gets only <img src=...>. Any idea why?

johnhungerford
@johnhungerford
is there a way to express a general type for a react component of a given prop type, such that I can make it the parameter of another component that can then render it?
class MyComponent(someComponent : Component[SomePropsType, ?, ?, ... ] ) {
   ...
   val downstreamProps : SomePropsType
   ...
   lazy val component = ScalaComponent.builder[ Unit ]
          .render_P( pr => render(  someComponent(downstreamProps) ) )
          .build
}
in the Component[SomePropsType, ...] type, if I leave the other type parameters as _, the compiler won't allow me to pass props to the component
nafg
@nafg
Use type parameters
This is a general scala question btw, not specific to scalajs-react
johnhungerford
@johnhungerford
I know how to use type parameters -- the issue is that the CtorType parameter (P, S, B, CT[-p, +u] <: CtorType[p, u]) is so weird, I haven't been able to figure out how to express it generically so that I can call .apply(props) on any possible react component
nafg
@nafg
You need to specify the same constraints and structure in your type parameters
Try it and post back with specific code and compiler errors