sjrd on 0.6.x
Remove dead code: specific coll… Adapt the signature of `js.Arra… Merge pull request #3554 from s… (compare)
sjrd on master
Fix analyzer cycle detection to… Add toString methods to analyze… Do not provide linked ClassInfo… and 1 more (compare)
sjrd on master
Remove Logger.success It is un… Make level helpers final Clean-up ScalaConsoleLogger cod… and 1 more (compare)
new Int8Array(_).toArray
js.Object
for use with certain methods like js.Object.assign
? There is js.Dynamic.literal(foo = "bar")
or js.Dictionary("foo" -> "bar")
, but they do not return a js.Object
and I need to manually asInstanceOf
. Another way is new js.Object { val foo = "bar" }
- but that gives an unused warning. I guess I am searching for something like js.Object.literal
:)
SmallModulesFor(packages)
.
run
command from sbt instead.
I spent the last two days trying to understand a weird a behavior on my application.
I just realized if I switch the order in ...-entrypoint.js and bundling, the application work as expected.
On my entrypoint.js
file (.../target/scala-3.1.0/scalajs-bundler/main/fmgp-ipfs-webapp-fastopt-entrypoint.js) I have something like this:
module.exports = {
"require": (function(x0) {
return {
...
"@input-output-hk/atala-prism-sdk/dist/modules/identity": require("@input-output-hk/atala-prism-sdk/dist/modules/identity"),
"@input-output-hk/atala-prism-sdk": require("@input-output-hk/atala-prism-sdk"),
"@input-output-hk/atala-prism-sdk/dist/modules/crypto/derivation/KeyDerivation": require("@input-output-hk/atala-prism-sdk/dist/modules/crypto/derivation/KeyDerivation"),
...
}[x0]
})
}
After adding a line of code (that uses @input-output-hk/atala-prism-sdk/dist/modules/identity
). A entry is added to entry points before @input-output-hk/atala-prism-sdk
Now everything that uses @input-output-hk/atala-prism-sdk
is undefined.
On the browser console, if I call require("@input-output-hk/atala-prism-sdk")
, the module exists but is mostly empty.
I switch the order it works fine.
Can someone point me to some documentation why the order matters?
Why does @input-output-hk/atala-prism-sdk/dist/modules/identity
was added before @input-output-hk/atala-prism-sdk
? where's the code that decides the order of this?
Cannot use multiple modules with the Closure Compiler
when using fullLinkJS.ScalaJS
with http4s-ember-client
buffer
, crypto
, net
, os
, punycode
, stream
, tls
)git@github.com:alexr007/sjs-questions.git
dom.getElementsByTagName("BODY")(0).innerHTML = html
// note: using addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0")
val dom = document.implementation.createHTMLDocument("mydom");
// this works
dom.getElementsByTagName("BODY")(0).innerHTML = html
// this doesn't: value body is not a member of org.scalajs.dom.Document
dom.document.body
// this doesn't: value body is not a member of org.scalajs.dom.Document
dom.body
How do you access this
from an anonymous function in scalajs? Like is done here:
https://github.com/ueberdosis/tiptap/blob/main/packages/core/src/extensions/keymap.ts#L12
I need to create some kind of literal object with functions like this from ScalaJS:
{
actions: {
// action implementations
activate: (context, event) => {
console.log('activating...');
},
notifyActive: (context, event) => {
console.log('active!');
},
notifyInactive: (context, event) => {
console.log('inactive!');
},
sendTelemetry: (context, event) => {
console.log('time:', Date.now());
}
}
}
I am trying this:
class TAct extends js.Object {
val x: js.Function0[Unit] = () => println("it worked")
}
val myActionObject = js.Dictionary("action" -> new TAct()).asInstanceOf[js.Object]
But it seems to me that the TAct class just turns into an empty object /undefined. I have to pass this into a function which is implemented in javascript. Is there a better way to do this?