rails / sprockets-rails

Sprockets Rails integration
MIT License
579 stars 246 forks source link

Collapsing library assets with huge dependency trees #254

Open elia opened 9 years ago

elia commented 9 years ago

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.

josh commented 9 years ago

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.

elia commented 9 years ago

Makes sense, now wondering how usable v4 is today…

elia commented 9 years ago

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?