Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:21
    scala-steward closed #366
  • 08:21
    scala-steward opened #386
  • Nov 30 16:57
    weihsiu commented #385
  • Nov 30 16:33
    sjrd commented #385
  • Nov 30 16:26
    weihsiu commented #385
  • Nov 30 16:21
    weihsiu commented #385
  • Nov 30 09:43
    sjrd commented #385
  • Nov 30 01:15
    weihsiu commented #385
  • Nov 29 18:41
    sjrd commented #385
  • Nov 29 18:23
    weihsiu opened #385
  • Nov 19 17:13
    nnovod-umms commented #384
  • Nov 19 17:11
    sjrd labeled #384
  • Nov 19 17:10
    sjrd closed #384
  • Nov 19 17:10
    sjrd commented #384
  • Nov 19 16:44
    nnovod-umms opened #384
  • Nov 18 18:01
    nafg closed #354
  • Nov 18 18:01
    nafg commented #354
  • Nov 15 16:42
    sjrd closed #383
  • Nov 15 16:39
    scala-steward opened #383
  • Nov 02 22:47
    scala-steward synchronize #363
Domas Poliakas
@domaspoliakas
Hello friends
I’m trying to get the path of the scalajs bundler target from another task and having some issues

If I do

sbt:main> inspect main/npmUpdate/crossTarget
[info] Setting: java.io.File = < … project path ...>\app\electron-main\target\scala-2.13\scalajs-bundler\main

Then you can see I get the path correctly, but doing

      println((npmUpdate / crossTarget).value.getAbsolutePath())

In a different task in the same submodule yields

< … project path …>\app\electron-main\target\scala-2.13

Does anyone have any ideas for what I’m doing wrong?

Domas Poliakas
@domaspoliakas
As per the wisdom of the rubber duck, typing the question out gave me an idea of trying Compile / npmUpdate / crossTarget and that does exactly what I was looking for :)
sidnt
@sidnt
when scalajs bundler is used to put all dependencies of a js application in the emitted js file, when the sjs app is served from serverX, are all the dependencies also served from serverX? IOW, does using sjs bundler mean that we can't use the various CDN servers to pull in the js dependencies and thus ease the load on serverX and delegate the network/compute load of fetching the dependencies on the clients?
Julien Richard-Foy
@julienrf
This is true. But the problem exists regardless of scalajs-bundler I guess. Do you know how does the Webpack community handle this?
sidnt
@sidnt
not yet
Nikita Gazarov
@raquo

@sidnt one of the webpack solutions for this is called Externals https://webpack.js.org/configuration/externals/

Alternatively, you can also define a Scala.js facade with JSGlobal instead of JSImport for your JS dependency, although it will probably be hard to use pre-made facades that already rely on JSImport that way

nafg
@nafg
Hi is a release planned?
nafg
@nafg
Hmm what about support for scalajs 1.3?
Julien Richard-Foy
@julienrf
@nafg I am not sure what the plans are. Sébastien plans to add support for Scala.js 1.3. Then we need a contributor to step up to make a release.
Carlos Quiroz
@cquiroz
Looking at the release notes with module splitting seems would have a non trivial impact on bundler
Sébastien Doeraene
@sjrd
At first we'll make a release that makes it work with 1.3.0 but without module splitting.
Then we can think about how to support and leverage module splitting in scalajs-bundler.
Binh Nguyen
@ngbinh
@julienrf now that we have scala.js 1.3.0 support, can you please cut a new release for scalajs bundler?
nafg
@nafg
@ngbinh IIUC @sjrd is already working on it
Binh Nguyen
@ngbinh
@nafg ah ok, thanks
nafg
@nafg
@ngbinh see above conversation
Binh Nguyen
@ngbinh
The PR to support scala.js 1.3.0 is already merged in scalajs bundler master. I probably can fetch and publish a private version my own but wondering if a new version should be cut soon
Sébastien Doeraene
@sjrd
Yes, today.
Binh Nguyen
@ngbinh
awesome! Thanks
Sébastien Doeraene
@sjrd
I have published 0.20.0 with support for Scala.js 1.3.0.
Carlos Quiroz
@cquiroz
@sjrd Thanks a lot, seems to be working fine
Carlos Quiroz
@cquiroz
Are you planning to add support to multiple modules or is it something for community contributions?
Sébastien Doeraene
@sjrd
A community contribution would be most welcome :) I unfortunately have a zillion other things to do.
nafg
@nafg
It would be nice if the npmDependencies -> package.json stuff were a separate plugin from the bundling stuff
Sébastien Doeraene
@sjrd
Yes, that too. At least a separate AutoPlugin, even if in the same artifact at the beginning.
Dan Di Spaltro
@dispalt
yeah agreed and good point
Carlos Quiroz
@cquiroz
I guess it is basically making it produce the scalajs.webpack.js file to a given dir
nafg
@nafg
@cquiroz wdym
unarist
@unarist
looks like release notes are not pushed to the website?
Jason Pickens
@steinybot
Any idea why I’m guessing weird relative paths in my source map? Such as:
[error] Module Warning (from ./node_modules/scalajs-friendly-source-map-loader/index.js):
[error] (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../home/nick/Forks/scala.rx/scalarx/shared/src/main/scala/rx/Ctx.scala': Error: Can't resolve '../../../../../../../../../home/nick/Forks/scala.rx/scalarx/shared/src/main/scala/rx/Ctx.scala' in '/Users/jason/source/erp/erp-front/target/scala-2.12/scalajs-bundler/main’
Where is /home/nick/ even coming from? Possibly related to scalacenter/scalajs-bundler#173. Maybe I ought to ask in the scalajs channel.
Sina
@sinaghaffari
Hi everyone. I'm having a lot of trouble figuring out how to bundle things like fonts using scalajs-bundler. I'm using scalacss to define font-faces which have "url(...)"s in them. I've tried a bunch of different things, but can't seem to get scalajs-bundler to actually recognize that the fonts are being referenced and including them within the bundle
Carlos Quiroz
@cquiroz
You probably need to specify a font loader on your webpack configuration
If the url is to some external site it should just work
Sina
@sinaghaffari
The url is to a local directory relative to the scala file
so something like ../../../../public/fonts/My-Font.eot
I defined a file-loader in my webpack config
Sina
@sinaghaffari
Im actually not sure if the url should be relative to the .scala source file, or the compiled js file, or the bundled js file
Carlos Quiroz
@cquiroz
that’s tricky, it has to be relative to the bundled file
but I’ve used aliases pointing to a resources dir
Sina
@sinaghaffari
I gave up and used an external url :(
I figure that the same server that's serving the JS will serve the font, so there wont be any problems there
Carlos Quiroz
@cquiroz
e..g.
const resourcesDir = path.resolve(rootDir, "../common/src/main/resources”);
and then I need to add tha to the search dir
  resolve: {
     alias: {
       resources: resourceDir
That lets you refer on you import something like resources/fonts/etc