This project is archived and is in readonly mode.

#6114 ✓resolved
Matthew Ratzloff

Asset refactoring broke expansions

Reported by Matthew Ratzloff | December 3rd, 2010 @ 09:19 PM | in 3.1

Change 6a609dbc82d03eb92a85970aa157192657f14882 broke expansions (this was arrived via git bisect). Now register_javascript_expansion and register_stylesheet_expansion both set each other's values, so because stylesheets are registered last, Rails produces HTML that tries to load stylesheets as if they were JavaScript. Was this commit tested?

Here is some debugging of the current (399730bdd2f133e9fecac501e2f2333be5f29aa2) version using a simplified version of our codebase:

register_javascript_expansion
========================================================================
expansions (parameter):
{:defaults=>["http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", "jquery-cookie/jquery.cookie", "rails"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables/media/js/jquery.dataTables"], :fancybox=>["jquery-fancybox/fancybox/jquery.fancybox-1.3.4.pack"], :multiselect=>["jquery-tmpl/jquery.tmpl.min", "jquery-blockui/jquery.blockUI", "jquery-localisation/jquery.localisation.min", "jquery-multiselect/js/ui.multiselect"]}

javascript expansions (before merge):
{}

stylesheet expansions (before merge):
{}

javascript expansions (after merge):
{:defaults=>["http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", "jquery-cookie/jquery.cookie", "rails"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables/media/js/jquery.dataTables"], :fancybox=>["jquery-fancybox/fancybox/jquery.fancybox-1.3.4.pack"], :multiselect=>["jquery-tmpl/jquery.tmpl.min", "jquery-blockui/jquery.blockUI", "jquery-localisation/jquery.localisation.min", "jquery-multiselect/js/ui.multiselect"]}

stylesheet expansions (after merge):
{:defaults=>["http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", "jquery-cookie/jquery.cookie", "rails"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables/media/js/jquery.dataTables"], :fancybox=>["jquery-fancybox/fancybox/jquery.fancybox-1.3.4.pack"], :multiselect=>["jquery-tmpl/jquery.tmpl.min", "jquery-blockui/jquery.blockUI", "jquery-localisation/jquery.localisation.min", "jquery-multiselect/js/ui.multiselect"]}


register_stylesheet_expansion
========================================================================
expansions (parameter):
{:defaults=>["jquery-ui-1.8.6.g2"], :datatables=>["jquery-datatables"], :fancybox=>["../javascripts/jquery-fancybox/style"], :multiselect=>["../javascripts/jquery-multiselect/css/ui.multiselect", "jquery-multiselect"]}

javascript expansions (before merge):
{:defaults=>["http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", "jquery-cookie/jquery.cookie", "rails"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables/media/js/jquery.dataTables"], :fancybox=>["jquery-fancybox/fancybox/jquery.fancybox-1.3.4.pack"], :multiselect=>["jquery-tmpl/jquery.tmpl.min", "jquery-blockui/jquery.blockUI", "jquery-localisation/jquery.localisation.min", "jquery-multiselect/js/ui.multiselect"]}

stylesheet expansions (before merge):
{:defaults=>["http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", "jquery-cookie/jquery.cookie", "rails"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables/media/js/jquery.dataTables"], :fancybox=>["jquery-fancybox/fancybox/jquery.fancybox-1.3.4.pack"], :multiselect=>["jquery-tmpl/jquery.tmpl.min", "jquery-blockui/jquery.blockUI", "jquery-localisation/jquery.localisation.min", "jquery-multiselect/js/ui.multiselect"]}

javascript expansions (after merge):
{:defaults=>["jquery-ui-1.8.6.g2"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables"], :fancybox=>["../javascripts/jquery-fancybox/style"], :multiselect=>["../javascripts/jquery-multiselect/css/ui.multiselect", "jquery-multiselect"]}

stylesheet expansions (after merge):
{:defaults=>["jquery-ui-1.8.6.g2"], :ie=>["http://html5shim.googlecode.com/svn/trunk/html5.js"], :ie6=>["jquery.supersleight.min"], :datatables=>["jquery-datatables"], :fancybox=>["../javascripts/jquery-fancybox/style"], :multiselect=>["../javascripts/jquery-multiselect/css/ui.multiselect", "jquery-multiselect"]}
register_javascript_expansion

If I find a solution I'll try to post a patch.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages