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
elkhadirzyad
@elkhadirzyad
Thanks, mr @japgolly , can i execute these scripts on windows os ?
Armin Keyvanloo
@arminio
Is there an up to date project skeleton available somewhere to get one started with the latest versions of scalajs and scalajs-react?
nafg
@nafg
What would you like such a skeleton to contain?
Armin Keyvanloo
@arminio
@nafg Just a working index page would be great. I can't bootstrap a new project manually. I followed the steps on scalajs-react and getting this error:
Uncaught ReferenceError: require is not defined at React.scala:41
Armin Keyvanloo
@arminio
Something like this: https://github.com/chandu0101/scalajs-react-template
But with sjs 1.1.0 and sjs-react 1.7.5
mn98
@mn98
@arminio I had similar pain recently in trying to get started with the simplest of examples. Here's a TODO app I finally got working with no small amount of help from @sloshy!
Armin Keyvanloo
@arminio
thx @mn98. If it works, it would be super helpful.
yup, it works! thanks again @mn98
you should speak with @japgolly to add it (https://github.com/mn98/scalajs-react-examples) to git repos home page as a working bare project
mn98
@mn98
Great, hope that helps. I'd be happy for it to be added, but it might need a bit of a once-over and tidy up from an expert.
1 reply
mn98
@mn98
@arminio @japgolly Hi both, fwiw I tidied up the project skeleton a bit. If it's at all helpful, please do feel free to reference/fork/whatever it.
elkhadirzyad
@elkhadirzyad
do someone worked on material ui 3.9.4 (proposed by https://scalablytyped.org), i need help to do a demo of the component "Stepper" with "Steps", any help ?
zhourelyamani
@zhourelyamani
I want to do a demo of autoComplete component on materiai ui 3.9.4. Can some one help?
Roberto Leibman
@rleibman
@elkhadirzyad where's your repo?
elkhadirzyad
@elkhadirzyad
Autocomplete is blocking me 2
Roberto Leibman
@rleibman
uh? Autocomplete is all nice and good, but in order to be a good developer you really shouldn't rely on it, use emacs or notepad if you need.
Rohan Sircar
@rohan-sircar
I think they're talking about a component called autocomplete, not intellisense
elkhadirzyad
@elkhadirzyad
Yes we r talking about mui autocomplete component
Roberto Leibman
@rleibman
Ah... anyway, I repeat, where's your repo? I've suggested before what you should do.
elkhadirzyad
@elkhadirzyad
image.png
hello everyone, I have a project containing all material ui demos, since autocomplete does not exist, i tried to rely on downshift (https://github.com/trepidacious/scalajs-react-downshift) to create one, in compilation i have no errors, but when i run the app , i got the error below, someone can help ?
Øyvind Raddum Berg
@oyvindberg
I felt curious enough about whether downshift worked with ST (because I need some autocompletion as well and had worked with it before) that I ported the first example I found: https://github.com/ScalablyTyped/SlinkyDemos/blob/master/downshift/src/main/scala/demo/Demo.scala
I guess both slinky and scalajs-react misses syntax for spread props, otherwise it worked perfectly
elkhadirzyad
@elkhadirzyad
image.png
@oyvind i have spread in red, what am i missing ?
Rohan Sircar
@rohan-sircar
Does it compile?
elkhadirzyad
@elkhadirzyad
with implicit class SpreadOpsB <: StBuildingComponent[_] it works
now i have error
image.png
in line 590
image.png
Rohan Sircar
@rohan-sircar
Put the code in code tags please
Wrap it in triple backticks - ```
elkhadirzyad
@elkhadirzyad
ok
Armin Keyvanloo
@arminio

Hi all,
I need some help setting up my first unit test for sjs react. I have the following test:

import utest._
.....

object TestTest extends TestSuite {

  val tests: Tests = Tests {

    "plainElement" - {
      val re: VdomElement = <.div("Good")
      val c               = ReactTestUtils.renderIntoDocument(re)
      test(c, """<div>Good</div>""")
    }
  }
}

When I run it I get this error:

- TestTest.plainElement.0 2ms 
  scala.scalajs.js.JavaScriptException: ReferenceError: document is not defined
    <jscode>.Object.renderIntoDocument(react-dom-test-utils.development.js:1163)
    japgolly.scalajs.react.test.ReactTestUtils$.renderIntoDocument(ReactTestUtils.scala:66)
    <jscode>.array$9(Chicken.scala:51)
    scala.scalajs.runtime.AnonFunction0.apply(AnonFunctions.scala:22)

So renderIntoDocument is erroring as there are no documents to render to.
Does anyone know what is causing this?

Armin Keyvanloo
@arminio

In the setup section of this page: https://github.com/japgolly/scalajs-react/blob/master/doc/TESTING.md#test-scripts
it says:
// React JS itself. // NOTE: Requires react-with-addons.js instead of just react.js

I am not entirely sure what that means and how to set up the reacts addson via the scalajs-bundler

Any help will be much appreciated

Armin Keyvanloo
@arminio

In addition to the above, I have also tried using test-state.
Things are starting to get really frustrating for me.
My test (copied from the test-state example) fail with this error:

-------------------------------- Running Tests --------------------------------
X app.TodoTest 0ms 
  scala.scalajs.js.JavaScriptException: ReferenceError: Sizzle is not defined
    teststate.domzipper.sizzle.Exports.$init$(Exports.scala:7)
    app.MyTestState$.<init>(MyTestState.scala:8)
    app.MyTestState$.<clinit>(MyTestState.scala:8)
    app.TodoTestDsl$.<init>(TodoTestDsl.scala:68)
    app.TodoTestDsl$.<clinit>(TodoTestDsl.scala:58)
    app.TodoTest$.<init>(TodoTest.scala:16)
    app.TodoTest$.<clinit>(TodoTest.scala:8)
    <jscode>.{anonymous}()(TodoTest.scala:8)
    scala.scalajs.reflect.LoadableModuleClass.loadModule(Reflect.scala:24)
    utest.PlatformShims$.loadModule(PlatformShims.scala:26)
[info] 
[error] Failed tests:
[error]         app.TodoTest
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 3 s, completed 07-Sep-2020 17:32:07
sbt:client>

This is my sbt:

lazy val client = (project in file("client"))
  .enablePlugins(ScalaJSPlugin)
  .enablePlugins(ScalaJSBundlerPlugin)
  .settings(
    scalaJSUseMainModuleInitializer := true,
    libraryDependencies ++= Seq(
      "com.github.japgolly.scalajs-react" %%% "core"              % "1.7.5",
      "com.github.japgolly.scalajs-react" %%% "extra"             % "1.7.5",
      "com.github.japgolly.scalacss"      %%% "ext-react"         % "0.6.1",
      "com.lihaoyi"                       %%% "upickle"           % "1.2.0",
      "io.suzaku"                         %%% "diode-react"       % "1.1.13",
      "com.lihaoyi"                       %%% "autowire"          % "0.3.2",
      "com.github.japgolly.scalajs-react" %%% "test"              % "1.7.5" % Test,
      "org.querki"                        %%% "jquery-facade"     % "2.0" % Test,
      "com.lihaoyi"                       %%% "utest"             % "0.7.5" % Test,
//      "com.github.japgolly.test-state"    %%% "core"              % TestStateVer % "test",
//      "com.github.japgolly.test-state"    %%% "dom-zipper"        % TestStateVer % "test",
      "com.github.japgolly.test-state"    %%% "dom-zipper-sizzle" % TestStateVer % "test",
      "com.github.japgolly.test-state"    %%% "ext-scalajs-react" % TestStateVer % "test",
      "com.github.julien-truffaut"        %%% "monocle-core"      % "2.0.4",
      "com.github.julien-truffaut"        %%% "monocle-macro"     % "2.0.4",
      "com.github.japgolly.scalajs-react" %%% "ext-monocle-cats"  % "1.7.5",
      "org.scala-js"                      %%% "scalajs-java-time" % "1.0.0" % Test
    ),
    npmDependencies in Compile ++= Seq(
//      "sizzle""2.3.0",
      "react"     -> "16.13.1",
      "react-dom" -> "16.13.1",
      "bootstrap""4.5.2",
      "jquery""1.9.1",
      "popper.js""1.16.1"
    )

  )
  .settings(addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.1" cross CrossVersion.full))
  .settings(testFrameworks += new TestFramework("utest.runner.Framework"))

Can someone please give me hand to resolve these issues?

Armin Keyvanloo
@arminio
Also I would like to mention that:
val TestStateVer = "2.4.1"
Armin Keyvanloo
@arminio

This is now fixed:

When I run it I get this error:

- TestTest.plainElement.0 2ms 
  scala.scalajs.js.JavaScriptException: ReferenceError: document is not defined
    <jscode>.Object.renderIntoDocument(react-dom-test-utils.development.js:1163)
    japgolly.scalajs.react.test.ReactTestUtils$.renderIntoDocument(ReactTestUtils.scala:66)
    <jscode>.array$9(Chicken.scala:51)
    scala.scalajs.runtime.AnonFunction0.apply(AnonFunctions.scala:22)

So renderIntoDocument is erroring as there are no documents to render to.
Does anyone know what is causing this?

This was fixed by adding requireJsDomEnv in Test := true to build.sbt

But still haven't found a solution to the Test State issue above (Sizzle is not defined)
Can anyone help please?
Armin Keyvanloo
@arminio
FIXED
oh... I added .enablePlugins(JSDependenciesPlugin) and the Sizzle is not defined issue went away!
So even though I don't use the JSDependenciesPlugin myself, it seems that it needs to be enabled for the com.github.japgolly.test-state" %%% "dom-zipper-sizzle dependency to work
Armin Keyvanloo
@arminio
Is my understanding correct?
Armin Keyvanloo
@arminio
Hi @japgolly, would you be able to tell me plz what the Sack class represents in TestState?
nafg
@nafg
@arminio if you provide a link maybe someone else can
nafg
@nafg
I just did some browsing, it looks like it's used by the implementation as a typeclass for quasi-derivation internally
Anyway he doesn't reply here much, you might try tweeting him or opening an issue on the repo asking for to add a few lines of documentation ("private internal implementation detail" or an explanation of how people can use it)
David Barri
@japgolly
Oh wow, what funny timing this is for me to check in here :D
David Barri
@japgolly
@nafg is right. My habit when in front of a computer is to spend about 5-10 reading reddit or whatever, then it's just full-steam-ahead coding non-stop. I find the burden of having to reply to github, email, and twitter sometimes more than enough so it's extremely rare that I go out looking for more spaces to reply / chat / talk. I'm just a work machine. So yeah sorry @arminio, I hope there's enough knowledge around people here that everyone can help everyone out. Otherwise feel free to raise a StackOverflow question or Github issue if no one knows, I'll try to make time to respond but there might be a wait because I've literally got months and months worth of work already queued up.