Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 08 20:43
    @sjrd banned @sw7240614
  • 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
Hanns Holger Rutz
@Sciss

it could look like this

val rPerform = Runner("init")

val pf = PathField()
pf.mode = PathField.Folder
pf.value <--> ArtifactLocation("base")

val p = GridPanel(
  Label("Sound file base directory:"),
  pf,
  Empty(),
  Label(
    "<html><body>Initialization creates three<p>" +
      "sub-directories here: 'db', 'ph', 'tmp'.<p>" +
      "Make sure there is enough free space."
  )
)

p.border          = Border.Empty(4)
p.columns         = 2
p.compactColumns  = true

val ggInit = Button("Initialize")
ggInit.clicked ---> rPerform.runWith("check" -> false)

val bp = BorderPanel(
  north = p,
  south = FlowPanel(ggInit)
)

bp.border = Border.Empty(4)
bp

This is an expression snippet leading to a Widget which is then rendered in a window or container. On the desktop in a regular window, if the workspace was run by an audience in the browser, it would be rendering in a <div>.

So you can see, the nomenclature is close to Swing, but only like 5% of the API is exposed, so it's not too difficult to think of another UI backend like DOM.
in other words, I don't want to introduce another UI representation solely for the purpose of running in the browser. Instead, it should be possible to run a subset of what you do in the regular desktop application, within a client-side browser application. I wouldn't even mind if it looks a bit different.
ritschwumm
@ritschwumm
the layouts will be fun to port, this is an area where swing is very different from html. and equally horrible.
Hanns Holger Rutz
@Sciss
Screenshot from 2020-10-23 13-25-50.png
yes. fortunately, I only use a small number of layouts now, none of which looks too complicated to approximate with CSS.
GroupPanel would be quite hard I guess.
ritschwumm
@ritschwumm
year.. display:grid might do, but that's a bit of a monster (and not supported in IE, but you probably don't care)
Hanns Holger Rutz
@Sciss
that's useful, thanks
Hanns Holger Rutz
@Sciss
excellent, grid-layout seems to allow the implementation of the specification: https://www.w3schools.com/code/tryit.asp?filename=GJZOFRV56E75
Hanns Holger Rutz
@Sciss
basic buttons and panels up and running: https://www.sciss.de/temp/soundprocesses.js/
ritschwumm
@ritschwumm
impressive
Ali Shah
@Alee02
Hey guys, i was testing out the module splitting in scalajs 1.3.0. I created a simple project based on the release notes. However i keep getting org.scalajs.linker.interface.ReportToLinkerOutputAdapter$UnsupportedLinkerOutputException: Linking did not return exactly one public module.
Here is the link to the project for reference : https://github.com/Alee02/module_splitting_scalajs
It's bare bones only containing scalajs and bundler plugin with code from the release notes.
Sébastien Doeraene
@sjrd
@Alee02 Perhaps you're trying to use fastOptJS? With module splitting you need to use fastLinkJS instead.
Ah no you're using scalajs-bundler. That doesn't work with module splitting yet.
Ali Shah
@Alee02
@sjrd ahh ok thanks, i thought latest scalajs bundler 0.20 worked with 1.3.0 :(
Domas Poliakas
@domaspoliakas
I think it does work with 1.3.0, just not the module splitting part
Invert Avian
@Invert_Avian_twitter
hi again, all- the standalone distribution packages at https://www.scala-js.org/doc/internals/downloads.html don't seem to include anything >1.0.0. does the standalone exist for 1.1.0 or greater? if so, where can it be downloaded/built from?
Sébastien Doeraene
@sjrd
Invert Avian
@Invert_Avian_twitter
thanks for replying. I've tried this, though, and building that repository doesn't seem to produce the particular .jar I seem to need, namely a >1.0.0 version of scalajs-cli-assembly_2.12-1.0.0.jar. is that deprecated?
I could also be missing something obvious with the build- I'm a newbie to sbt
Sébastien Doeraene
@sjrd
./scripts/assemble-cli.sh 1.3.0 2.13.3 should produce something that you can use.
2 replies
Tobias Schlatter
@gzm0
@Alee02 is that the full error message you are getting? If yes, there is a bug. The relevant tools should augment the error message to tell you what went wrong (in your case something like "did you use fastOptJS instead of fastLinkJS").
Hanns Holger Rutz
@Sciss
Does anyone know some nice Scala wrappers around IndexedDB ? I found only some old projects which were also depending on a lot of other libraries.
Hanns Holger Rutz
@Sciss
I suppose I can run sjs inside a web worker, right? Is is possible then to use something like Await() to turn an asynchronous call into a synchronous one?
For example, if I had an asynchronous file I/O surrogate, could I implement a synchronous read(Array[Byte], Int, Int) method?
ritschwumm
@ritschwumm
no, there is no way to do blocking in JS. you can make working with async code more convenient though, by using an appropriate monad. cats-effect comes to mind, or even the fake one named Promise - for which async/await is syntactic sugar in JS.
in dotty you could give https://github.com/rssh/dotty-cps-async a shot, that might work, too.
Eric Peters
@er1c
@sjrd FYI, I updated the BitSet PR updated to the Int-based array, I think all of the "initial" comments have been addressed, no rush, thanks!
It was a fun refactoring, I think I also understand it better now too!! :)
Eric K Richardson
@ekrich
I am getting This version (1.3) of Scala.js IR is not supported. Supported versions are up to 1.3-SNAPSHOT after update on master - clean didn't seem to work.
Eric K Richardson
@ekrich
I needed to restart sbt and then clean.
Eric K Richardson
@ekrich
@sjrd I changed the test names as we discussed. I think it is pretty good. scala-js/scala-js#4266
Glen Marchesani
@fizzy33
So I am looking for advice. I/we have a scala js app in the wild. The model for some of our customers is 100K rows (and growing). That data is all in the browser right now. 100K rows going through any kind of json deserialization takes a long long time.
Right now we hide most of this from the user BUT we are also getting customers that anticipate much larger data sets.
Anyone have any advice for how to build out our data model so it performs in the browser ?
We are debating using js.Object and native all the data so there is no deserialization. Then have all the Operations on those objects be via impliciits...
the generation of the serialized json on the server is very strict so we aren't worried about getting bad json or having to report on it.
anywho curious to hear people's thoughts
Li Haoyi
@lihaoyi
which JSON library are you using? e.g. uPickle is a lot faster than Circe or Play-JSON in the browser, even though on the JVM the difference is not nearly as great
going with native js.Objects would be the next step, after that some kind of on-demand downloading/parsing, and after that maybe some kind of streaming/pagination, maybe event-based parsing (SAX-style) to perform computations without needing a data structure at all (uPickle supports this via Visitors).
The ideal architecture would depend on exactly how much larger "much larger" is, and can't really be answered in the abstract
Domas Poliakas
@domaspoliakas
I’m a little confused - if you’re sending data from the server then surely you can’t have no deserialisation?
ritschwumm
@ritschwumm
@fizzy33 do you need the complete set of data in the browser? because "much larger than 100k rows" will get you in trouble where shaving off a constant factor will not help any more, probably.
Andriy Plokhotnyuk
@plokhotnyuk
@fizzy33 Try jsoniter-scala. It can parse white space separated rows or JSON array rows from input streams without holding a whole input in the memory. Also it is one of most efficient JSON parsers for Scala, please see results of benchmarks here or test immediately in your browser using this page.
Hanns Holger Rutz
@Sciss
the dependency copy-to-clipboard links on https://www.scala-js.org/libraries/facades.html are partly outdated; e.g. scalajs-dom copies 0.9.5 while latest release is 1.1.0
Hanns Holger Rutz
@Sciss

if I want to store a JS object in a Blob, created from Scala, is all I have to do extends js.Any (and @JSExportAll)? Like

@JSExportAll case class Meta(blockSize: Int, lastModified: Long) extends js.Any

val b = new Blob(js.Array(Meta(12, 345L)))

?

and in return when I have a Blob, can I just asInstanceOf[Meta] its contents?