Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 23 2021 09:24
    @sjrd banned @yensaoxuan_twitter
  • Apr 18 2021 19:06
    @sjrd banned @Amitgup48798297_twitter
  • Mar 29 2021 07:47
    @sjrd banned @quangs
  • Jan 23 2021 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
Sébastien Doeraene
@sjrd
The generated code will be exactly the same. traits that extend js.Any have no footprint JS.
August Nagro
@AugustNagro
Great talk Sebastien, learned some new things. I'm a big fan of the anonymous class inference for config objects.. the 'two lookup' problem is one of my biggest annoyances with using any compile-to-js language.
Sébastien Doeraene
@sjrd
Thanks :)
Andrew Adams
@adamsar
Hey I just checked out the video, learned some good stuff thanks. I also felt like I got a personal shout out with the | syntax gitter part ;)
Sébastien Doeraene
@sjrd
The video was recorded a month ago. It was not targeted at a single example. It has been the most common question here for the past 5 years.
Andrew Adams
@adamsar
Hopefully will no longer be the top question soon!
Sébastien Doeraene
@sjrd
Yup ;)
Matt Hughes
@matthughes
@sjrd The new { } feature in Scala3 you called “anonymous class inference” but I can’t find any reference to that on the Dotty or Scala3 docs. What section would that be under?
Sébastien Doeraene
@sjrd
It's not documented 😆 and I invented the name.
It's just one of the many unlisted improvements to type inference.
Matt Hughes
@matthughes
haha :) what % of new, undocumented features did you add just to benefit sjs?
Sébastien Doeraene
@sjrd
I didn't do anything 😁
Except redesign the internal data structure used for "goto"s in a way that is friendlier to the Scala.js backend.
Daniel Schoepe
@dschoepe
Hi, I'm working on a JVM Scala project, but need to interact with a JavaScript library for parsing JS source map files. My thinking was to define a few shared case classes and then pass data between ScalaJS interacting with the JS library and JVM Scala by converting to and from JSON or some other serialization format. I was wondering if there is already some existing library that automates all the scaffolding around it (e.g. how to invoke the ScalaJS code) or provides another way of calling ScalaJS from the JVM.
Sébastien Doeraene
@sjrd
Have you considered using a JVM library for parsing source maps? There's at least com.google.debugging.sourcemap.SourceMapConsumerFactory in Google's closure-compiler library.
Daniel Schoepe
@dschoepe
As far as I could tell, that's missing some features compared to Mozilla's library. In particular, I couldn't find something similar to computeColumnSpans and wanted to avoid reimplementing that.
Sébastien Doeraene
@sjrd
If you really need the JS library, then you can use any serialization library that cross-compiles for Scala/JVM and Scala.js (most do). What you'll need in addition is how to spawn a process with the JS lib, and how to communicate with it. There, any mechanism to handle IPC would work fine. I can mention https://github.com/scala-js/scala-js-js-envs which is what we use in sbt-scalajs, although it might be overkill for your use case, since it abstracts over several JS engines.
Adam Warski
@adamw

Hey :)

When running JS tests from sbt using scala 3.0.0-RC3 & scalatest, I'm getting an enigmatic [error] Error during tests: and a list of test classes - nothing more. Any hints on how to get more information?

For scala.js 2.13, this works fine

Sébastien Doeraene
@sjrd
Hum, that doesn't seem right. Do you have a reproduction somewhere?
Adam Warski
@adamw
@sjrd https://github.com/softwaremill/quicklens, not a minimized project :)
Sébastien Doeraene
@sjrd
I'll have a look, but probably not today.
Adam Warski
@adamw
ok, thx :) I'll disable the scala3-js for now - it will be in a comment
Daniel Schoepe
@dschoepe

If you really need the JS library, then you can use any serialization library that cross-compiles for Scala/JVM and Scala.js (most do). What you'll need in addition is how to spawn a process with the JS lib, and how to communicate with it. There, any mechanism to handle IPC would work fine. I can mention https://github.com/scala-js/scala-js-js-envs which is what we use in sbt-scalajs, although it might be overkill for your use case, since it abstracts over several JS engines.

Thanks, that looks exactly like what I was looking for actually!

fromscalatohaskell
@fromscalatohaskell_gitlab
JS noob question - how can we refer to require('path/to/image.png') in ScalaJS so that webpack can see my images and not complain? They are seen by my SCSS and transformer to some hash-file thing?
Tobias Schlatter
@gzm0
object A {
  @js.native
  @JSImport('path/to/image.png', JSImport.Namespace)
  val image = js.native
}
2 replies
Chris Kipp
@ckipp:matrix.org
[m]
Can I get some input on some ScalaJS stuff. I recently was given the keys to scoverage so I'm trying to push forward a release, however I'm a bit consued by the sjs1 vs _sjs1.5 versioning scheme for artifacts, and I'm unsure what this should be here: https://github.com/scoverage/scalac-scoverage-plugin/pull/311#discussion_r621883170
it's an odd situation where both the compiler plugin and the runtime is being fully cross released, so the sbt crossproject doesn't include the normal _sjs. So it's being done manually, but am unsure if we actually want the sjs1.5 instead of sjs1
however I'm unsure if that's just a bi-product of the full cross and if that's needed in this scenario
it works int he sbt plugin, but that's because there is some hacky stuff to do a take(3) and add it to the artifact that the sbt plugin is including in the build
Sébastien Doeraene
@sjrd
It should be _sjs1. There's no such thing as _sjs1.5.
2 replies
Naftoli Gugenheim
@nafg
This message was deleted
How can I get source maps to go to some custom uri?
I want to add a handler in the backend but it should be under some custom path, like /_source_maps/...
Right now they're just 404
In the .js.map they're like /../../../../...
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
@nafg I saw there was a flag for that. Here's an example PR: https://github.com/raquo/Laminar/pull/91/files
Naftoli Gugenheim
@nafg
There's no API in the sbt plugin?
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
🤷‍♂️ right now it seems to be a scalac flag.
Naftoli Gugenheim
@nafg
All the stuff in scalaJSLinkerConfig is irrelevant?
This message was deleted
Tobias Schlatter
@gzm0
no, that can also be useful (that stuff is very old, and I don't think we have given it an awful lot of thought).
Basically, the compiler options can be useful per compilation unit, the linker config is for everything.
Sorry, I don't have an awful lot of time right now :-/
Naftoli Gugenheim
@nafg
nm, the closest thing is relativizeSourceMapBase which only determines how many dots to put in
ok thanks
vovoks
@vovoks
Hello, guys! Please, tell me how I make Scala Array[Byte] on JS?
Tobias Schlatter
@gzm0
From JavaScript code you mean? You cannot.
(you can create a Scala.js function that creates one, but you cannot do anything with it except for passing it back to Scala.js code).