Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 29 2019 08:35
    @sjrd banned @8bitpitRBX_twitter
  • May 23 2019 13:44
    @sjrd banned @BIGCRYPTO001_gitlab
  • May 01 2019 14:31
    @sjrd banned @Certificates1_gitlab
  • Apr 22 2019 15:31
    @sjrd banned @lerbatax
  • Jan 31 2019 23:04
    sjrd commented #3555
  • Jan 31 2019 22:56
    sjrd review_requested #3555
  • Jan 31 2019 22:56
    sjrd opened #3555
  • Jan 31 2019 21:06

    sjrd on 0.6.x

    Remove dead code: specific coll… Adapt the signature of `js.Arra… Merge pull request #3554 from s… (compare)

  • Jan 31 2019 21:06
    sjrd closed #3554
  • Jan 31 2019 20:54
    erikvanoosten commented #2665
  • Jan 31 2019 16:33
    sjrd commented #3538
  • Jan 31 2019 15:54

    sjrd on master

    Fix analyzer cycle detection to… Add toString methods to analyze… Do not provide linked ClassInfo… and 1 more (compare)

  • Jan 31 2019 15:54
    sjrd closed #3552
  • Jan 31 2019 15:54

    sjrd on master

    Remove Logger.success It is un… Make level helpers final Clean-up ScalaConsoleLogger cod… and 1 more (compare)

  • Jan 31 2019 15:54
    sjrd closed #3553
  • Jan 31 2019 15:33
    sjrd commented #2665
  • Jan 31 2019 15:30
    erikvanoosten commented #2665
  • Jan 31 2019 10:41
    sjrd review_requested #3554
  • Jan 31 2019 10:41
    sjrd opened #3554
  • Jan 31 2019 10:05
    gzm0 synchronize #3552
Tobias Schlatter
@gzm0
Ah, that would be nice.
Good point. We have done this with very old scala versions.
So, how many screens of IR cleaner report are left?
Sébastien Doeraene
@sjrd
In one of my branches, I'm down to 2000 errors IIRC :sweat_smile:
(usually they get fixed in the dozens at a time, though)
Greg Fagan
@gregfagan

Hello, I'm new to scala coming from a typescript/react background. Was trying to get scalajs-react imported to my project after following the scalajs hello world tutorial, but it looks like scalajs-react hasn't been updated for scalajs 1.0 yet. I changed my scalajs dependency version to 0.6.32, but it looks like scalajs-react is still trying to import a version for sjs1:

[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.github.japgolly.scalajs-react:core_sjs1_2.13:1.6.0

can anyone help? sorry I do not understand very much about scala or sbt yet

trepidacious
@trepidacious
What's a good, simple, light logging library for scala and scala-js 1.0?
@gregfagan If you're running sbt interactively, have you run reload?
Greg Fagan
@gregfagan
yes

this is my plugins.sbt:

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")

and this is build.sbt:

import Dependencies._

enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSBundlerPlugin)

ThisBuild / scalaVersion := "2.13.1"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "com.example"
ThisBuild / organizationName := "example"

lazy val root = (project in file("."))
  .settings(
    name := "hello",
    libraryDependencies += scalaTest % Test,
    libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "1.0.0",
    libraryDependencies += "com.github.japgolly.scalajs-react" %%% "core" % "1.6.0"
  )

npmDependencies in Compile ++= Seq(
  "react" -> "16.13.1",
  "react-dom" -> "16.13.1"
)

scalaJSUseMainModuleInitializer := true
Tobias Schlatter
@gzm0
You are using the wrong bundler version.
You need addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.17.0")
Greg Fagan
@gregfagan
thank you!!
are there other view libraries that scalajs developers prefer? I was looking at react because that's what I'm familiar with, but maybe the community uses something else. Ideally with declarative UI semantics
trepidacious
@trepidacious
I've enjoyed using React, slinky is a very good alternative to scalajs-react as well
Oh also, slinky is available for scalajs 1.0 I think
Habris Mun
@HabrisMun_twitter
anyone here familiar with scala react?
having troubles understanidng modState, setState etc
with one of my react components, it has the capability of creating a new item into the database. It enters the database just fine, but i don't know how to get it to modify the list without refreshing.
AsyncCallback.fromFuture(Api.People.addInsurancePlan(company, planName)).flatMap(a => state.setState(magic goes here).asAsyncCallback).toCallback
and i really don't know what to do because i don't think i understand what's going on underneath the hood. FlatMap lets me access the item from the database, but how do i get it to use that item that is now inserted the database, and insert it into the list for me? saying state.setState(a) doesn't work , says methods are overloaded
state is a StateSnapshot
Roberto Leibman
@rleibman
It's fairly complicated, though the documentation is not bad. I suggest you start with something simpler, start with a button add a non-async callback to start with, then try an asynccallback (you need to map and completeWith, I believe so that you can convert the result to a callback when the async completes). BTW, the project has its own gitter, you may find more detailed help there.
Anthony Cerruti
@srnb_gitlab
@gregfagan declarative? check out outwatch
Antoine Doeraene
@sherpal
@gregfagan you can also check laminar (https://github.com/raquo/Laminar) (not sure about the declarative part, though)
Anthony Cerruti
@srnb_gitlab
Ooh Laminar looks sick
Yilin Wei
@yilinwei
@HabrisMun_twitter Are you still having issues?
Dawid Dworak
@ddworak
@gregfagan you can try https://udash.io as well :)
Rich
@Rich2
How does Scala.js handle Array[Long]s?
Sébastien Doeraene
@sjrd
@Rich2 In a way that they are compatible with the semantics of Array[Long] on the JVM.
Rich
@Rich2
Is the performance reasonable?
Sébastien Doeraene
@sjrd
It depends how you define reasonable. It's not the end of the world, but if you expect it to as fast as the JVM, you're going to be disappointed.
Giuseppe Cannella
@gekomad
how can i passing a js class to scala?
example:
class Car {
    constructor(brand) {
    this.carname = brand;
    }
}
mycar = new Car("Ford");
JSwrapper.f(mycar)
@JSExportTopLevel("JSwrapper")
object JSwrapper {
 @JSExport def f[A](s: A) = ???
}
Sébastien Doeraene
@sjrd
What's wrong with what you've got so far?
Giuseppe Cannella
@gekomad
@sjrd println(s.toString) doesn't print any fields
it prints [[object Object]]
Anthony Cerruti
@srnb_gitlab
Ah
Sébastien Doeraene
@sjrd
Well, that is consistent to doing mycar.toString() directly in JavaScript.
Anthony Cerruti
@srnb_gitlab
println and console.log do different things
Sébastien Doeraene
@sjrd
So that is the expected behavior.
Anthony Cerruti
@srnb_gitlab
If you want to call console.log, call js.Dynamic.global.console.log( (although I think global was changed in SJS 1.x so correct me if I'm wrong please)
Giuseppe Cannella
@gekomad
no, println is only an example, actually I need to get the class's fields
Sébastien Doeraene
@sjrd
global was changed in 1.x but that answer still applies
@gekomad Do you mean be able to write s.carname in Scala.js?
For that you'll need to define a facade type for the JS class:
// in Scala.js:
class Car(brand: String) extends js.Object {
  val carname: String = js.native
}

@JSExport def f(s: Car): Unit = println(s.carname)
Giuseppe Cannella
@gekomad
thanks @sjrd I'll look into it
Habris Mun
@HabrisMun_twitter
@yilinwei Yes i apologize for not responding earlier. Power keeps going out here, likely by influence of corona which is affecting productivity -.-
I haven't tried to make progress since i've posted
Nikolay Khoroshevskyi
@rossoha
@sjrd I’va found this repo https://github.com/sjrd/scalatscomp - Could you please give a couple words about it? Seems that it was’t update for some time. Is it still wip ? Also I see that it doens’t compiles and it seems to me that it was genrated programaticaly.. if I’m right, could you give a coule words about that as well. Thanks.
Sébastien Doeraene
@sjrd
@rossoha That was the product of a 24-hour hackaton. We barely had the beginning of a proof of concept. It's completely unusable.