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
jhegedus42
@jhegedus42
test
at the sbt prompt
something like this :
image.png
it is possible to set breakpoints , somehow, for the javascript part too, in intellij, with sourcemaps and such ... but i have not set that up myself ... thanks god that scala is type safe and i do not have to debug absolutely almost anything ... ever !
over, out, hope this helps a little bit
Mustafa Kuscu
@mcku
Hi, how can backticks be used in js.Dynamic.literal object construction?
e.g., js.Dynamic.literal(`a-b` = 1) stringifies to {"a$minusb":1} instead of {"a-b":1}
Anthony Cerruti
@srnb_gitlab
@sjrd Any chance I can write a trait that will have all of its vals of its implementations exported to the top level
Anthony Cerruti
@srnb_gitlab
@mcku What you want is js.Dictionary("a-b" -> 1)
Anthony Cerruti
@srnb_gitlab
Huh, if I export one module with fs2 and then another module with fs2 will they be compatible? My worry is that both fs2 instances in either module will be transpiled with different symbols
Anthony Cerruti
@srnb_gitlab
Does ScalaJS 1.x export to exports or module.exports?
Is there some way to use ScalaJS code with exports and all inside another function?
object CustomFunctionThing {

  @JSExportTopLevel
  val customModuleFunction = js.module(ActualModule)

}

@JSExport
object ActualModule {

  @JSExport
  val actualValue = "foo"

}
==
module.exports = {
  customModuleFunction(module, exports, require) {
    module.exports = {actualValue: "foo"}
  }
}
ritschwumm
@ritschwumm
@mcku sounds like a bug to me
Shadaj Laddad
@shadaj
@mcku agree with @ritschwumm looks like a bug, but in the meantime you can use js.Dynamic.literal("a-b" -> 1) which should emit the correct key
Ah, just saw that @srnb_gitlab just put that a bit earlier, nevermind then!
Anthony Cerruti
@srnb_gitlab

It's not a bug, they're making a literal object

{
  a$minusb: 1
}

and then when they stringify it it becomes

{
  "a$minusb": 1
}
a dictionary stringified is just the dictionary
So instead of making a literal, they should be making a dictionary
Mustafa Kuscu
@mcku
I understand those but backtick concept in Scala gives the impression that, what is inside the ` will be preserved as it is verbatim. This is not an exceptional case for scala-js in general, i mean, backticks are used in the same manner in scala-js, however, in the context of js.Dynamic.literal the behavior appears to be different.
That's not a big issue at all, e.g., in the context of JSON handling that's just an extra factor to consider which can be solved by using js.Dictionary.
Then one might wonder why would one build literal objects if js.Dynamic.literal cannot build full kinds of JS objects...
Anthony Cerruti
@srnb_gitlab
You can merge a dictionary and a literal
Sébastien Doeraene
@sjrd
It's a scalac limitation. Even backticked keys are mangled by the typer before they can be intercepted by Scala.js in literals. It's a won't fix bug.
Does ScalaJS 1.x export to exports or module.exports?
It exports to exports
Anthony Cerruti
@srnb_gitlab
Ok
That's fine
Sébastien Doeraene
@sjrd
But you have access to module with js.Dynamic.global.module in 1.x.
Anthony Cerruti
@srnb_gitlab
My only worry to get past now is fs2 not interacting properly between two different node modules
Sébastien Doeraene
@sjrd
So you can manipulate however you like in a main method.
You mean Scala classes compiled in two different JavaScript modules through two separate projects? They won't be compatible.
Anthony Cerruti
@srnb_gitlab
:weary:
So I'll have to make an extra module that I import using facades?
Sébastien Doeraene
@sjrd
Yes, I guess.
Anthony Cerruti
@srnb_gitlab
:weary:
Mustafa Kuscu
@mcku
just realized that js.Dynamic.literal("a-b"->1) appears to be equivalent to js.Dynamic.literal(`a-b`=1) :)
Anthony Cerruti
@srnb_gitlab
You can try "\"a-b\"" -> 1 maybe?
Mustafa Kuscu
@mcku
Anthony Cerruti
@srnb_gitlab
The third one is the behavior you want right?
Mustafa Kuscu
@mcku
Yep
Anthony Cerruti
@srnb_gitlab
Nice
And you're sure you don't want Dictionary
Mustafa Kuscu
@mcku
I don't know. dictionary is good for accessing object properties, but imho literal is good for the construction part.
Anthony Cerruti
@srnb_gitlab
Well you're constructing a literal here the same way you'd construct a dictionary
Eric K Richardson
@ekrich
@sjrd In regards to the PR I am working on I had a couple of questions if you have time.
Sébastien Doeraene
@sjrd
I can spare some time now, but let's move it to https://gitter.im/scala-js/scala-js/contrib
Eric K Richardson
@ekrich
Ok, didn't know about that room.
Marc Grue
@marcgrue
Thanks for the suggestions, @jhegedus42. I can run tests from the sbt shell inside IntelliJ but the debug window shows nothing, argh. Probably some silly simple setting somewhere. Probably easier to solve with 4 eyes sitting by my computer...
jhegedus42
@jhegedus42
@marcgrue u need to attach the debugger to sbt