This repository has been archived by the owner. It is now read-only.

Support for splitting packaging into more than just javascripts.js #2

Closed
coreyhaines opened this Issue Oct 29, 2010 · 3 comments

Comments

Projects
None yet
2 participants
@coreyhaines
Contributor

coreyhaines commented Oct 29, 2010

Problems:

  • The scripts in my application are getting larger, which means that the javascript.js file is getting very large.
  • The general cache includes all my script files, even though some larger ones are only used on specific pages

proposed solution:
When adding the middleware, allow configuration to set key->directory pairs that would then get packaged up independently. When I want to reference one, I would add the key to the call in the view.

This also means that we would need to not do auto-configuration of the middleware, instead configuring in application.rb.

I'm working on a patch for this.

@coreyhaines

This comment has been minimized.

Show comment
Hide comment
@coreyhaines

coreyhaines Oct 29, 2010

Contributor

So, after some investigation and a couple specs, I find that I can do this almost out of the box, if I split my scripts into other directories besides javascript and add the directory names as handlers. There are only two changes that are needed.

  • The ability to pass the filename/key into the #asset_resource_javascripts call. I'm going to add some specs for passing that in, then push.
  • Take out auto-registering of the middleware (ActiveSupport.on_load(:before_configuration in rails3.rb), instead do it in application.rb, so other handlers can be passed in.
Contributor

coreyhaines commented Oct 29, 2010

So, after some investigation and a couple specs, I find that I can do this almost out of the box, if I split my scripts into other directories besides javascript and add the directory names as handlers. There are only two changes that are needed.

  • The ability to pass the filename/key into the #asset_resource_javascripts call. I'm going to add some specs for passing that in, then push.
  • Take out auto-registering of the middleware (ActiveSupport.on_load(:before_configuration in rails3.rb), instead do it in application.rb, so other handlers can be passed in.
@coreyhaines

This comment has been minimized.

Show comment
Hide comment
@coreyhaines

coreyhaines Oct 30, 2010

Contributor

So, using my fork, it is working so far. The only change was to allow passing in a different name for the resource referenced in the script tag in the view. That name resolves to a directory on the filesystem.

Contributor

coreyhaines commented Oct 30, 2010

So, using my fork, it is working so far. The only change was to allow passing in a different name for the resource referenced in the script tag in the view. That name resolves to a directory on the filesystem.

@ddollar

This comment has been minimized.

Show comment
Hide comment
@ddollar

ddollar Nov 7, 2014

Owner

Hello. I apologize for the delayed response. I am currently declaring issue bankruptcy. If this issue still applies to you please feel free to re-open and explain. Thanks :)

Owner

ddollar commented Nov 7, 2014

Hello. I apologize for the delayed response. I am currently declaring issue bankruptcy. If this issue still applies to you please feel free to re-open and explain. Thanks :)

@ddollar ddollar closed this Nov 7, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.