Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 23 06:34
    @sjrd banned @Rebeka58_gitlab
  • Jun 08 2020 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
Hanns Holger Rutz
@Sciss
ok
nafg
@nafg
If you want something like BorderPanel you might use absolute positioning, or maybe CSS Grid?
But in general you should try to unlearn Swing while doing HTML
Hanns Holger Rutz
@Sciss
first, I will just make the minimum case, Button, Label, ComboBox, FlowPanel, that should be enough to create some basic examples
nafg
@nafg
For instance web pages are scrolling documents, not windows that like to be resized
Hanns Holger Rutz
@Sciss
Well, I'm doing both, so I want the APIs to be fairly close to each other
nafg
@nafg
Maybe use react-native via Slinky
then you can write the code once
Or just embed a web view with JavaFX
Hanns Holger Rutz
@Sciss
No, the application is desktop/swing (and will remain that way, I hate web UIs), just some user break-outs should be able to run in a client side browser window. So JavaFX doesn't help. It seems with DOM + some sugar from Laminar that's not too bad
nafg
@nafg
idk what break-outs means but abstracting over an HTML and Swing version of those bits is not necessarily worth it
ritschwumm
@ritschwumm
agreed, that might become quite frustrating. although html and swing are conceptually quite similar, all the details are different.
@Sciss i don't know what you are trying to achieve, but have you seen open stage control https://openstagecontrol.ammd.net/ ?
works quite well to cobble together a bit of a ui running in the browser that talks to the rest of your stuff over OSC.
ritschwumm
@ritschwumm
(actually, i generate the description for the ui in o-s-c from scala code and send it there over OSC)
Hanns Holger Rutz
@Sciss
it's a bit more generic; basically inside soundprocesses you have different DSLs, one for real-time sound synthesis, one for offline, one for patterns, one that can lead to expressions/actions/controls/widgets. the last one, widget, is what would be useful to be able to render in scala.js as well, if I want to make, for example, an online sound installation, and it needs a couple of user controls. but it's not necessarily about controlling an OSC device.

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.
Hanns Holger Rutz
@Sciss
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.