sprockets-rails icon indicating copy to clipboard operation
sprockets-rails copied to clipboard

Collapsing library assets with huge dependency trees

Open elia opened this issue 10 years ago • 3 comments

ref https://github.com/opal/opal-rails/issues/51 cc @wied03

The problem is that serving 50 (or more) assets when debug mode is on can slow down the page load significantly. On the other hand if you're not a library maintainer you probably don't need to debug all the internal dependency of, say, opal (but I suspect the situation is similar with other libraries).

The proposed solution is to have a list of assets for which the :debug flag is automatically turned off even when assets.debug is set to true.

elia avatar May 28 '15 08:05 elia

The problem is that serving 50 (or more) assets when debug mode is on can slow down the page load significantly.

For this reason, and others you have mentioned (no preamble and postamble support), I think we should consider the current debug approach deprecated and to be replaced by source maps.

Always serving a concatenated bundle in development matches how the files will be concatenated in production and give way for bundle processors to run both in dev and production identically.

josh avatar May 28 '15 17:05 josh

Makes sense, now wondering how usable v4 is today…

elia avatar May 28 '15 17:05 elia

Btw that's also the approach I tried in Opal 0.7 but ended up completely breaking source maps due (I think) to ending newlines and sourcemaps concatenation so it it reverted in v0.8.

Any experience with similar problems in sprockets 4?

elia avatar May 28 '15 17:05 elia