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 08:35
    @sjrd banned @8bitpitRBX_twitter
  • May 23 13:44
    @sjrd banned @BIGCRYPTO001_gitlab
  • May 01 14:31
    @sjrd banned @Certificates1_gitlab
  • Apr 22 15:31
    @sjrd banned @lerbatax
  • Jan 31 23:04
    sjrd commented #3555
  • Jan 31 22:56
    sjrd review_requested #3555
  • Jan 31 22:56
    sjrd opened #3555
  • Jan 31 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 21:06
    sjrd closed #3554
  • Jan 31 20:54
    erikvanoosten commented #2665
  • Jan 31 16:33
    sjrd commented #3538
  • Jan 31 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 15:54
    sjrd closed #3552
  • Jan 31 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 15:54
    sjrd closed #3553
  • Jan 31 15:33
    sjrd commented #2665
  • Jan 31 15:30
    erikvanoosten commented #2665
  • Jan 31 10:41
    sjrd review_requested #3554
  • Jan 31 10:41
    sjrd opened #3554
  • Jan 31 10:05
    gzm0 synchronize #3552
Sébastien Doeraene
@sjrd
The real question is: does Circe 0.12 support Scala.js? Which you can probably find out on their readme.
Mark Dixon
@mnd999
That's a nice way of looking at it, but probably circe is more important to scalajs than scalajs is to circe
Sébastien Doeraene
@sjrd
It's not a "nice" way of looking at it. It's the technological way of looking at it. Scala.js does not support libraries. It provides the compiler and the infrastructure necessary for projects to add Scala.js support to their build, or not. Scala.js does not have the power to support libraries, technologically speaking. It's the other way around.
Răzvan Rotaru
@roti
Hi, how can I use v1.0.0-M8-scala-2.13.0 instead of v1.0.0-M8? the sbt plugin does not seem to have a scala 2.13 version...
Travis Brown
@travisbrown
@mnd999 FWIW I think the more relevant question here is "does Scala.js support widely-used parts of the Java standard library?"
…and in the relevant case here the answer is "no" (for reasons I understand), which is why you'll need the workaround discussed here for circe 0.12+: https://github.com/circe/circe/releases/tag/v0.12.0-M4
Sébastien Doeraene
@sjrd

Hi, how can I use v1.0.0-M8-scala-2.13.0 instead of v1.0.0-M8? the sbt plugin does not seem to have a scala 2.13 version...

Use v1.0.0-M8. There is no v1.0.0-M8-scala-2.13.0 on Maven. From that tag we published v1.0.0-M8 for support of 2.13.

Răzvan Rotaru
@roti
@sjrd ok, thanks
Răzvan Rotaru
@roti

I'm new to scalajs, and I'd like to understand how JS modules are supported. In my project I have following error:

LinkingException: There were module imports without fallback to global variables, but module support is disabled.
To enable module support, set `scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))`.

what is the typical workflow here? configuring scala-js to output one single js file, including all JS modules? or use browser friendly modules, like requirejs? (and I'm asking for the development stage, the production build is another story)

Mustafa Kuscu
@mcku
@roti are you using scalajs-bundler already?
Also, you can use its library bundling mode for faster development: see https://scalacenter.github.io/scalajs-bundler/reference.html#bundling-mode-library-only
Răzvan Rotaru
@roti
no, I just set up a project with https://github.com/vmunier/sbt-web-scalajs
Răzvan Rotaru
@roti
@mcku thank you, I managed to get it up and running.

I am now stuck in another problem. I defined a JS interface for React:

@js.native
@JSImport("react", "React")
object React extends js.Object {

  def createElement(component: String, props: Map[String, Any], children: Element*): Element = js.native

}

react is bundled in my output, so it's there, however it's not working. my object is not linked to the JS object "React".

any ideas how to debug this are greatly appreciated
aappddeevv
@aappddeevv
Try @JSImport("react", JSImport.Namespace)
You can look at other people's facades for hints as you go, slinky, scalajs-react, scalajs-reaction (and many others).
Zak Patterson
@zakpatterson
With respect to @raquo's question about @inline annotations from some 12 hours ago, does the inliner have to be explicitly enabled? Are inline annotations ignored by default and only turned on via -opt:inline and opt:l:inline? i'm trying to find some example of this, I assume we only want to enable those inlines in CI and on our releases
Ólafur Páll Geirsson
@olafurpg
Hi all! Is it expected that scalajs-tools_2.12:0.6.28 is published but not scalajs-tools_2.13:0.6.28? I'm aware that scalajs-tools has been split into io/logger/linker for v1 but I couldn't find a mention in the release notes that scalajs-tools won't be available for 2.13 on 0.6.x
Screenshot 2019-08-25 at 14.47.02.png
Context: I'm working on adding 2.13 support to mdoc and my current strategy involves dropping support for the mdoc:js modifier on 2.13
we use scalajs-tools to link code from scala code fences in markdown https://scalameta.org/mdoc/docs/js.html
Sébastien Doeraene
@sjrd
Yes, that's expected. The tools for 2.13 will only be available in 0.6.29.
The lack of release for scala-parallel-collection for 2.13 before the release of 2.13 prevented is from getting the tools ready in 0.6.28.
Ólafur Páll Geirsson
@olafurpg
Thanks for the update. I'm eagerly waiting for 0.6.29 then! :D
Sébastien Doeraene
@sjrd
Anyone wants to advance the support of Scala.js in dotty? I wrote up a tutorial to do so, linked from this meta good first issue: lampepfl/dotty#7113
Carlos Quiroz
@cquiroz
Are there specific tasks open to support dotty?
Sébastien Doeraene
@sjrd
Make it work, one test file at a time.
Carlos Quiroz
@cquiroz
:D
Sébastien Doeraene
@sjrd
Of course at some point there will be the big task of non-native JS classes (aka Scala.js-defined JS classes). But before getting there, there is a lot that can be addressed just by enabling shared tests (the ones that also work on the JVM)
Russ White
@russwyte

In a class Foo with a nested class Bar Is there are a way to create a js.constorOf[Bar] where Bar not a top level class?

When I try to do that now (in 0.6.28) I get: An undefined behavior was detected: [object Object…s not an instance of Foo at runtime - but no compile time error.

This is pretty bad for my application because the class I need the constructor for needs to be aware of it’s parent type. Any suggestions?

Russ White
@russwyte

I see this is supported in 1.0.0-M8:

https://www.scala-js.org/news/2019/06/03/announcing-scalajs-1.0.0-M8/

Is there any chance this could be applied to 0.6.x since many of my dependencies aren’t ready for 1.0.0-M8?

Sébastien Doeraene
@sjrd
No, you have to upgrade to 1.x, and encourage your dependencies to do the same.
If there was any we could have implemented it in 0.6.x, we would have done so already.
TATSUNO Yasuhiro
@exoego

I want to disable fastOptJS/fullOptJS in compile phase for a sbt sub project, something like skip in fastOptJS in Compile := true, but it seems no effect right now.
Are there any way to disable fastOptJS/fullOptJS in specific project?

Suppose we have sbt projects like this.

  • root project (just aggregate below)
    • common project X
    • project A, depends on X
    • project B, depends on X
    • project C, depends on X

Project X contains common source shared in project A, B, and C.
Project X should be tested (so fastOptJS in Test should be performed).
However, X's JS is not used production, so disabling f*OptJS in compile phase can reduce build time in (root/)fullOptJS.

Sébastien Doeraene
@sjrd
You can override fast and fullOptJS to be a no op, like any other task.
Or you could just not invoke it in the first place ...
TATSUNO Yasuhiro
@exoego
Thanks.
I override with below and it works.
.setings(
  fastOptJS in Compile := Attributed.blank(file("")),
  fullOptJS in Compile := Attributed.blank(file(""))
)
Mustafa Kuscu
@mcku

Also when compiling under dotty, BaseCharsetTest:

ClassType(Ljava_io_Serializable) expected but UndefType found for tree of type org.scalajs.ir.Trees$Undefined

this error when the case is empty

could not reproduce it in a minimal sense

adding expectedChars would get rid of those
See: https://github.com/scala-js/scala-js/pull/3756/files/9e0a1959e5a5d1d4f90b01bb70b7da071831a21c#diff-8e8b9776805c3c46a92816f342baf75dR225

Ntend7777
@Ntend7777
Hello
Sébastien Doeraene
@sjrd
@mcku looks like a dotty bug. It should infer Unit for the type of the match, instead of Serializable.
Mustafa Kuscu
@mcku
they ought to run the scalajs test case to reproduce the bug then, right?
Sébastien Doeraene
@sjrd
Yes.
But it's very possible that it won't reproduce on the JVM, because the JVM backend has a tendency to tolerate and fix things on the fly, whereas the Scala.js backend is more strict in what it accepts.
Eric K Richardson
@ekrich
Which versions of Scala.js emit ES5 or ES6?
For 1.0.0-M8 (Scala.js now emits ECMAScript 2015 code by default) is that ES5?
Sébastien Doeraene
@sjrd
2015 is 6
Eric K Richardson
@ekrich
So does 0.6.x also emit ES6?
Mustafa Kuscu
@mcku
yes, since 0.6.26 scalajs emits ES modules. Many people use ES/ES6 to mean ES2015 and newer.. ES5 is, roughly speaking, old, troublesome JS syntax which has no appeal..