question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intermediate SplitStyle mode

See original GitHub issue

I have been trying to use snowpack with scala.js new split modules in development mode.

This is really meant for development mode where I want to change code in my application and want to see the results as soon as possible in the browser. A tool like snowpack is able to detect what changed and only load those

I tried the setting:

    scalaJSLinkerConfig ~= (_.withModuleSplitStyle(ModuleSplitStyle.SmallestModules)),

And that will create modules for each class and indeed only the few that change will be updated and captured by snowpack

However for my test application there is a large set of modules, in my case 3172 files including e.g. one for each scala class in use, or dependencies like scalajs-react

ls -al target/scala-2.13/seqexec_fastopt/
...
-rw-------     1 cquiroz  staff    11819 Dec 11 14:28 japgolly.scalajs.react.extra.router.RoutingRules.js
...
-rw-------     1 cquiroz  staff    25248 Dec 11 17:25 web.client.table.package$.js
...
-rw-------     1 cquiroz  staff     1190 Dec 11 14:28 java.lang.ThreadLocal.js
...

Though snowpack only detects the changed files, the sheer amount of files means it needs to check a lot of files and it also puts pressure on the browser as well (needing to track thousands of modules).

What would be great (I have no idea how involved this is) is to have modules grouped, e.g. all from dependency X into an X.js and keep the application classes split, this would let the dev tool to load application files as they change, while caching dependencies grouped in “bigger” files

I don’t if this is feasible but I’ll open this to discuss

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:36 (34 by maintainers)

github_iconTop GitHub Comments

10reactions
cquirozcommented, Apr 4, 2022

I did a quick test an for one of my apps we went from 2401 files to 74. Also the load time in browser went from some secs to negligible. Thanks a lot for this feature I think it will be of extremely useful

4reactions
gzm0commented, Dec 20, 2020

At any rate the smallest modules mode is really impressive

TY 😃 Also took me over half a year to build 😛

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intermediate and Advanced Workouts & Routines
Looking for intermediate and advanced workouts and routines? Here are my picks for the best weight training workout routines.
Read more >
The Ultimate 6 Day Workout Split for Building Muscle & Strength
This is a workout split that should be saved for more advanced lifters. ... and it's vital to avoiding overtraining, no matter what...
Read more >
Pros and Cons of Split System Training Routines - Verywell Fit
Split system training is a program of weight training that divides training sessions by body regions, usually upper and lower body training.
Read more >
The 8 Most Effective Training Splits - T-Nation
It's time for a new training split, one that better fits your goals and your schedule. Choose one of these 8 proven splits...
Read more >
What Is The Best Intermediate Split-Training Routine For ...
At the intermediate level, a body-part split is pretty standard. Usually, this involves working just one or two muscle groups per day and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found