Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 16 10:56
    fdietze commented #342
  • Mar 30 03:51
    sjrd commented #402
  • Mar 30 01:08
    ScalaWilliam edited #402
  • Mar 30 01:06
    ScalaWilliam opened #402
  • Mar 17 18:54
    sjrd commented #401
  • Mar 17 18:47
    cquiroz commented #401
  • Mar 11 14:10
    cquiroz review_requested #401
  • Mar 11 13:15
    cquiroz synchronize #401
  • Mar 11 12:51
    cquiroz opened #401
  • Mar 08 17:55

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ 0… (compare)

  • Mar 08 17:54

    cquiroz on v0.21.0-RC1

    (compare)

  • Mar 08 17:53

    cquiroz on master

    Sync NPM lock file Merge pull request #392 from vh… (compare)

  • Mar 08 17:53
    cquiroz closed #392
  • Mar 08 15:37
    cquiroz commented #392
  • Mar 08 15:34
    vhiairrassary commented #392
  • Mar 08 15:33
    vhiairrassary synchronize #392
  • Mar 08 15:32
    vhiairrassary commented #350
  • Mar 08 11:44

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ 5… (compare)

  • Mar 08 11:41

    cquiroz on master

    Add support for Webpack 5 and d… Parse errors and warnings Fix tests and 2 more (compare)

  • Mar 08 11:41
    cquiroz closed #390
Mathieu
@mathieuleclaire
Does it mean, that all js mode would be packed in my js file ?
It could possibly be huge
And you are right, I don't need dynamic loading, just a couple of identified modes and one or two themes
Julien Richard-Foy
@julienrf
I don’t follow. On the one hand I understand that you say that you only need a couple of modes and themes, and on the other hand I understand that you say that the resulting bundle could be huge.
Mathieu
@mathieuleclaire
If I use a the dynamic strategy I mean.
Julien Richard-Foy
@julienrf
With dynamic module loading, the dynamically loaded modules would not be part of the bundle, so the bundle wouldn’t be huge
But I’ve never tried to do that in Scala.js, so I can’t really help :-/
Mathieu
@mathieuleclaire
OK, but the dynamic loaded module is used if you want to have all syntax highlighting potentially for all languages, which is not my case.
I tried with extra JSImport but the output js remains the same
but I guess my syntax is wrong
Julien Richard-Foy
@julienrf
Do you also refer to the JSImported module in your program entry point?
Mathieu
@mathieuleclaire
No. And that was the key.
Mathieu
@mathieuleclaire
So this works: in my facade:
@js.native
@JSImport("ace-builds/src-noconflict/mode-scala.js", JSImport.Namespace)
object scalamode extends js.Object
and I need to call scalamode in my program entry point
Is it the regular way to achieve this ?
Julien Richard-Foy
@julienrf
Yes, Webpack only includes modules that are “used”, in the resulting bundle
Do you mind updating the related issue?
Mathieu
@mathieuleclaire
Yes, sure. Thanks for helping !
Julien Richard-Foy
@julienrf
Thanks for your patience!
Mathieu
@mathieuleclaire
Same compliment for you !
the version currently used for webpack 4 has several deprecations
[info] Updating NPM dependencies
[error] npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[error] npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
[error] npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
[error] npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
[error] npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
[error] npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
Russ White
@russwyte

I tried this:

   npmDevDependencies in Compile ++= Seq(
      "source-map-loader" -> "2.0.1"
    ),

but that results in this error:

[error] npm ERR! notarget No matching version found for source-map-loader@2.0.1 0.2.3.
Russ White
@russwyte
It looks like version 1.1.3 should work for webpack 4 - but I am not sure I have a good way to specify that.
It seems to me that if that library is already in npmDevDependencies - then that version should be used instead of the hard coded version.
Milan Satala
@msatala
Hi guys, I'm pretty sure it was asked and answered before but I'm not able to find it. Is it possible to use Scala.js 1.3+ module splitting in combination with scalajs-bundler?
Sébastien Doeraene
@sjrd
No, it's not possible yet.
We are proposing a project to implement that at GSoC this year (assuming our org gets accepted).
Milan Satala
@msatala
@sjrd Thank you for answering.
On a project where we don't have scalajs-bundler nor module splitting yet we will go the module splitting route since we deploy often and the JS output is quite large.
Sébastien Doeraene
@sjrd
Let us know how it goes. Module splitting is fairly new, and we're eager to hear from practical experiences using it.
Milan Satala
@msatala
Will do. We have 108k lines of scala.js code. My idea is to use module splitting to have a single large js file which contains all "static code" (std lib + other libs) and another file containing our code that changes often.
Milan Satala
@msatala
Looking at dynamic imports compatibility https://caniuse.com/es6-module-dynamic-import we might even go that route and load pages dynamically.
Sébastien Doeraene
@sjrd
For dynamic imports, we have something built-in since 1.4.0 with js.dynamicImport.
Milan Satala
@msatala
Yup, that's what I meant.
Russ White
@russwyte

If I get some time today I plan to PR this change so that developers can override versions of concat-with-sourcemaps and source-map-loader:

    val devDependencies =
      npmDevDependencies ++ (
        if (currentConfiguration == Compile) npmManifestDependencies.compileDevDependencies
        else npmManifestDependencies.testDevDependencies
      ) ++ webpackPackages ++ Seq(
        "webpack-dev-server" -> webpackDevServerVersion,
      ) ++ (
        if (npmDevDependencies.exists{case (name, _) => name == "source-map-loader"}) Seq.empty 
        else Seq("source-map-loader" -> sourceMapLoaderVersion)
      ) ++ (
        if (npmDevDependencies.exists{case (name, _) => name == "concat-with-sourcemaps"}) Seq.empty
        else Seq("concat-with-sourcemaps" -> "1.0.7")
      )

Any thoughts? Is there a more preferred solution? Maybe the same way webpackDevServerVersion is handled?

Carlos Quiroz
@cquiroz
@russwyte Please note that there is a PR to get webpack 5 and that changes the use of source-map-loader etc
Russ White
@russwyte
@cquiroz Thanks! Yes - I saw that PR, but it looked like it was not making progress. I was just hoping maybe I could provide a quick fix. I will pull that WP5 PR down and see if I can contribute there.
cquiroz
@cquiroz:matrix.org
[m]
Publication seems to be failing
I think we may want to try to move to sbt-ci-release and abandon travis once and for all
Philipp Dörfler
@phdoerfler
image.png
Hi! I'd like to use a JS/TS lib which is hosted on github packages instead of npm, I looked through the scalajs-bundler docs and the source and I did find a settingKey for adding additional args to npm, is that how I would do that?
There's no resolver mechanism as there is in sbt where I can add additional maven / ivy repositories, is there?
(I could add this line in a project -wide .npmrc config file, but ideally I'd want to keep everything in my SBT build)
Philipp Dörfler
@phdoerfler
turns out, I can't simply add that line to a project-wide .npmrc because whilst I can install the package with npm myself this way, scalajs-bundler doesn't seem to pick up that config file by itself. Which I'm kinda glad for tbh.
All in all this could probably do with better documentation and I'd file a PR if I knew what to do, but I don't :D
Philipp Dörfler
@phdoerfler

I'm afraid using npmExtraArgs doesn't work either because it adds the args after install:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '--//npm.pkg.github.com/:_authToken',
1 verbose cli   'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
1 verbose cli   '--@jensforstmann:registry',
1 verbose cli   'https://npm.pkg.github.com'
1 verbose cli ]

Which npm does not like at all. Full log: https://gist.github.com/phdoerfler/7510a775ce2032576028768b2bfbfcaf

Dan Di Spaltro
@dispalt
@cquiroz:matrix.org it looks like the rc1 for 0.21 didn't work, right?
cquiroz
@cquiroz:matrix.org
[m]
Nope, the release script is failing, I’m trying to move it to sbt-ci-release