Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 21 23:39
    Atry commented #288
  • Jan 18 17:38
    vhiairrassary synchronize #390
  • Jan 18 17:32
    vhiairrassary edited #393
  • Jan 18 17:30
    vhiairrassary edited #393
  • Jan 18 17:26
    vhiairrassary converted_to_draft #393
  • Jan 18 17:26
    vhiairrassary opened #393
  • Jan 18 17:06
    vhiairrassary edited #390
  • Jan 18 17:06
    vhiairrassary edited #390
  • Jan 18 17:02
    vhiairrassary edited #390
  • Jan 18 16:59
    vhiairrassary synchronize #390
  • Jan 18 09:00
    vhiairrassary commented #390
  • Jan 18 08:57
    vhiairrassary edited #390
  • Jan 18 08:56
    vhiairrassary edited #390
  • Jan 18 08:54
    vhiairrassary synchronize #390
  • Jan 18 08:07
    vhiairrassary edited #390
  • Jan 18 07:36
    vhiairrassary edited #390
  • Jan 18 07:35
    vhiairrassary edited #390
  • Jan 18 07:35
    vhiairrassary edited #390
  • Jan 11 09:15
    vhiairrassary edited #390
  • Jan 11 08:31
    vhiairrassary commented #287
Julien Richard-Foy
@julienrf
maybe you can explicitly supply the sources, from the Project Structure settings?
nkgm
@nkgm
I guess so. BTW are these properly indexed on Sonatype? I can't seem to find the artifacts using the search feature.
nkgm
@nkgm
Yes but when I try to browse the actual artifacts I get 404
Julien Richard-Foy
@julienrf
I’ve noticed that too, I had to manually find the correct path
nkgm
@nkgm
And I don't get any search results for 0.16, weird
nkgm
@nkgm
Yeah IntelliJ hates that naming for some reason. At least now I can add them manually.
Thanks for your help @julienrf.
nkgm
@nkgm
Using fastOptJS::startWebpackDevServer; ~fastOptJS for development and it works beautifully while editing .scala files.
Now I'm trying to get it to work with a css file included via @JSImport("./styles.css", JSImport.Namespace) (which otherwise works outside of HMR).
I've adjusted webpackMonitoredDirectories and includeFilter, so whenever I edit/save the css file I can see that the build is triggered ie Build triggered by src/main/resources/styles.css. Running 'fastOptJS'. but it doesn't actually do a rebuild (which I verified by inspecting library-fastopt.js).
I can't seem to find any working examples of that either and I'm running out of ideas. Any help?
PS I'm using BundlingMode.LibraryOnly() :)
nkgm
@nkgm
Created a super minimal example with latest everything and BundlingMode.Application - same fate. Is this something I should avoid? Or how do other devs normally handle it?
Julien Richard-Foy
@julienrf
@nkgm I don’t use webpack-dev-server but I know this project that uses it, maybe you can learn from its build definition? https://github.com/scalacenter/scastie/blob/bff1b5df6cac7affc9b041697095cd31c2352a9c/build.sbt#L211-L255
nkgm
@nkgm
I'll try that. Thanks @julienrf.
Alexis Hernandez
@AlexITC
From time to time, I have seen this error, but I haven't been able to reproduce it with a minimal project, any ideas? it's surprising that this fails because the log says to have written the proper webpack config before trying to using it (where it fails):
[info] Building webpack library bundles for cazadescuentos-admin-webapp-fastopt in /home/dell/projects/mine/discount-alerts/admin-webapp/target/streams/_global/_global/_global/streams/fastOptJS-webpack-libraries
[info] Writing scalajs.webpack.config.js
[error] ModuleNotFoundError: Module not found: Error: Can't resolve './cazadescuentos-webapp-fastopt-entrypoint.js' in '/home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main'
[error]     at factory.create (/home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/webpack/lib/Compilation.js:925:10)
[error]     at factory (/home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:401:22)
[error]     at resolver (/home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
[error]     at asyncLib.parallel (/home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
[error]     at /home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/neo-async/async.js:2830:7
[error]     at /home/dell/projects/mine/discount-alerts/admin-webapp/target/scala-2.13/scalajs-bundler/main/node_modules/neo-async/async.js:6877:13
nkgm
@nkgm
@AlexITC this will sound kind of basic, but when the error happens, and without triggering any more actions from sbt, have you checked target/scala-2.13/scalajs-bundler/main/ for the missing *-fastopt-entrypoint.js file? Is everything else there? And what do you normally do to recover from the error?
Alexis Hernandez
@AlexITC
apparently, the slinky template I used generates some custom webpack configs that are on the root folder, I renamed the project name, and those files depend on such name, hence, changing the webpack config fixed the problem
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