Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Switch to fewest modules linking in dev." #2841

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

armanbilge
Copy link
Contributor

Reverts #2229. Just to try! The changes in Scala.js 1.13.1 may have significantly improved the situation.

@bundlemon
Copy link

bundlemon bot commented Apr 11, 2023

BundleMon

Files updated (1)
Status Path Size Limits
index-(hash).js
1.69MB (-30B 0%) -
Unchanged files (7)
Status Path Size Limits
exploreworkers-(hash).js
730.45KB -
index-(hash).css
75.25KB -
workbox-window.prod.es5-(hash).js
1.82KB -
plotworker-(hash).js
89B -
agsworker-(hash).js
88B -
catalogworker-(hash).js
88B -
itcworker-(hash).js
77B -

Total files change -30B 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Contributor

@cquiroz cquiroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok testing this, but maybe @rpiaggio @toddburnside and @hugo-vrijswijk can chime in

@hugo-vrijswijk
Copy link
Contributor

I'll give it a try tomorrow, I think I played with it before, but only in fullLinkJS (once) where it didn't make much of a difference. Faster dev cycles would be nice though 😃

Copy link
Contributor

@toddburnside toddburnside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely worth testing!

@rpiaggio
Copy link
Contributor

I'll take it out for a spin

@hugo-vrijswijk
Copy link
Contributor

hugo-vrijswijk commented Apr 12, 2023

I feel like it is a little slower on initial compile, but for incremental it is faster (which makes sense if it doesn't have to overwrite one giant fastLink file). I think combined with Vite this works great 🥳

I may have spoken too soon, I'm getting the following error when opening explore (after logging in to Orcid):

image

image

hugo-vrijswijk
hugo-vrijswijk previously approved these changes Apr 12, 2023
@hugo-vrijswijk hugo-vrijswijk dismissed their stale review April 12, 2023 10:55

See comment

@toddburnside
Copy link
Contributor

I may have spoken too soon, I'm getting the following error when opening explore (after logging in to Orcid):

I am getting the same error. But, on initial load not logged into Orcid (I don't think)

@armanbilge
Copy link
Contributor Author

If that error is legit — i.e. Scala.js is emitting different / broken code under a different split style, that's a pretty serious bug that we should report.

@hugo-vrijswijk
Copy link
Contributor

It might be a case sensitivity issue? Looking at the code in VS Code gives this hint:
image

Fixing it removes the error, though another similar one pops up after where the browser cannot find a function on the imported module

@hugo-vrijswijk
Copy link
Contributor

I was testing out SmallestModulesFor a bit more with #3049, and it actually works! But it didn't feel much faster. It turns out that the more modules you have, the slower Vite gets. We have around 750. Most of the time taken is the browser loading all the different modules. Which actually makes it feel a little slower (I have no real numbers, just based on poorly counting seconds in my head).

This article also mentions that for a very high number of modules, Vite can become slower: https://betterprogramming.pub/is-vite-really-faster-than-webpack-b414f6cc751c

So, I think for now it is best to stay on FewestModules and take advantage of Scala.js bundling.

It might help to make 1 bundle for all dependencies, and 1 for explore itself, but I don't know if that is an option. That way, dependencies could stay cached while the app bundle changes during development (similar to how webpack outputs main and vendor bundles)

@cquiroz
Copy link
Contributor

cquiroz commented Jun 27, 2023

THat's my experience too. Having FewestModules should make it possible to build less js files on scala.js but vite and browsers start to suffer with too many modules
There is an intermediate mode too that could make sense
scala-js/scala-js#4327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants