101 questions with no answers
0
votes
0
answers
165
views
Idiomatic way to talk to REST backend from a Scala.js frontend?
I wrote a SPA with Scala.js, where I use a library called RosHTTP in
order to communicate with a REST backend. It helps me add query
parameters, set headers, work with cookies and increase transfer
...
0
votes
0
answers
37
views
Is there a mechanism to access a NodeJS app remotely
I have a third party TypeScript library that I would like to access from my Scala application. The library I want to use is dydx-v4-clients
I have been able to access the library by creating a facade. ...
0
votes
0
answers
56
views
Use a SBT task with different settings from one module
When testing locally, I do not care about code size, therefore I switch GCC off by using following line in my frontend and worker modules settings:
Compile / fullLinkJS / scalaJSLinkerConfig ~= { _....
0
votes
0
answers
130
views
Scala scala.js cannot find module js script in sbt build
I'm trying to import a JS Script script.js into a scala program App.scala and use its methods add and divide.
However on running the program, I keep getting the error, Cannot find module 'resources/...
0
votes
0
answers
50
views
How do I post a non-string value in a Scala Http request?
From a Scala program, I need to send values with different primitive types to a Node server.
Http("http://middleware-api:3000/createPromoCodeInCms?")
.postForm
.param("lifetime&...
1
vote
0
answers
126
views
Does the Scala.js ecosystem offer any way(s) to augment or replace the auto-generated setter/mutator methods for property fields of scala classes?
Please consider a family of plain and case classes, cross-compiled to JVM and Scala.js, which make mixed use of properties with automatically and manually defined accessor methods. Many come from ...
1
vote
0
answers
73
views
How to use uTest-wrapping with scalajs sbt test to test async events?
I tried the uTest test wrapping in GitHub with the following code:
object AjaxExp01SOTest extends TestSuite {
val log = JSLog.getLogger(getClass().getSimpleName)
JSLog.setGlobalLevel(Level.DEBUG)
...
1
vote
0
answers
83
views
Binding.scala - SBT Out Of Memory issues
I have a large @html function (125 lines) and after that sbt fails with OutOfMemory. I increased sbt's memory to 8g and same thing so it's not just it needed a little more memory.
Is this a known ...
1
vote
0
answers
251
views
ScalaJS: Referring to non-existent class play.twirl.api.Html
Tried to upgraded from ScalaJS 0.6.x to 1.3.1. Now I'm stuck with this linking error. It's a play framework cross project where I use twirl templates on client and server side. Here are the ...
1
vote
0
answers
262
views
[ReferenceError]: window is not defined
I have an object Window in scalajs:
@js.native
@JSGlobalScope
object Window extends js.Object {
def window: Int = js.native
}
And I am using window as follows:
val text: Option[String] =
for {
...
1
vote
0
answers
260
views
Scala - Custom Encoder for Upickle/Ujson Library
I am working with the Upickle/Ujson and want to write a custom encoder to get the hang of things.
Suppose I have the following hierarchy (from the tutorial here: Link)
import upickle.default._
...
1
vote
0
answers
77
views
Reactive components in binding.scala + scalatags
I want to do similar to scalajs-bootstrap for my own css. But as per my knowledge it doesn't perform partial dom update like Binding.scala does. I know we can use Binding.scala and scalatags together ...
1
vote
0
answers
79
views
"Using fallback derivation for type ... (derivation: MacroWritersImpl)" warning in Slinky, setState acts weird
I'm trying to redo the TicTacToe tutorial for React using Slinky.
At some point the game is supposed to remember whose player the turn is. For that, in the tutorial, they add a xIsNext boolean. ...
2
votes
0
answers
50
views
How does garbage collection in regards to Ctx.Owner in scala.rx work?
I am trying to wrap my head around how exactly ownerships works in scala.rx. At the moment I have a Scala.js web application that just imports rx.Ctx.Owner.Unsafe._ wherever I am using Rxs. This - ...
1
vote
0
answers
57
views
Filtering data before applying update with scala-js-d3
I am using scala-js-d3 to draw some rather complicated graphs. For performance reasons I want to filter the update set before applying transformations.
My code so far looks like this:
def showData(a: ...
0
votes
0
answers
35
views
scalajs access top level variable
this scalajs works as expected:
console.log(js.eval("numItems").asInstanceOf[Int]) returns the correct value.
However, this code always returns zero. Any idea?
@js.native
@js.annotation....
0
votes
0
answers
189
views
PlotlyJS with ScalaJS: Problem with 3D graph / WebGL
With plain Javascript it works:
var data = [{
"z": [[8.83, 8.89, 8.81, 8.87, 8.9, 8.87], [8.89, 8.94, 8.85, 8.94, 8.96, 8.92], ..., [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]],
"type": "...
1
vote
0
answers
159
views
Scala.JS generated module throws "Uncaught TypeError: Cannot read property 'Object' of undefined"
I've compiled a simple Scala class to JavaScript using Scala.JS, and I want to import it to a JavaScript code, but importing it throws the following exception:
Uncaught TypeError: Cannot read ...
4
votes
0
answers
113
views
Is sbt the only option when it comes to scala.js and IntelliJ IDE?
I'm writing a scala library that can be compiled into both JVM bytebodes and javascript minified npm package (through scalajs).
It will be released on both maven central and npm public repositories, ...
1
vote
0
answers
53
views
Scala.js @JSGlobal - cannot perform run sbt
I'm struggling with an error and I cannot think of good solution.
I have class:
@JSGlobal("THREE.Scene")
class Scene extends js.Object {
def add(obj: js.Object): Unit = ???
}
and main:
[...]
...
1
vote
0
answers
454
views
SBT plugin is added as a dependency in my published library
I recently released my first Scala & Scala.js cross-building library to Sonatype. Now I want to use the Scala.js lib in one of my applications, however if I want to add a dependency to my lib ...
1
vote
0
answers
126
views
Can Nashorn viably port JavaScript libraries to the JVM side of cross-built Scala.js projects?
This question addresses the flip side of another question: Can JSweet viably port Java libraries for use in cross-built Scala.js projects?
Imagine making a Scala.js facade for a JavaScript library, ...
0
votes
0
answers
90
views
JSON I/O across Scala.js and Scala on JVM
I have a Scala Play Framework/Scala.js project where the server is Play compiled to JVM and the client is compiled via Scala.js to JavaScript. There are some shared classes used by both server and ...
1
vote
0
answers
130
views
Scala.JS: How to enforce fastOptJS - when running tests
When I run my server tests it always runs a full optimization on the client module. (server/test)
I tried different things to enforce to use only fast optimization, without success.
Even ...
1
vote
0
answers
237
views
Intellij: Run crossProject test (Scala / Scala.js) does not work
I have a Scala / Scala.js Crossproject. (scala-adapters-wizard)
I cannot run my 'shared' Scala Tests in Intellij.
If I open the Configuration, I can select the Module (sharedJVM).
But this gives ...