Basic Custom Bundler solution for #157 #158

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

jgable commented Feb 25, 2012

I took a look and think this is a basic solution for extending the existing Bundle() method to allow some custom bundlers. I'm not happy about having to know about the internal workings of the JavaScriptBundle Render method in order to stop the hashkey from appending, but I think it's a good stopgap solution that doesn't require you to change much other code.

I added some generic methods for creating the JavaScriptBundle from the Factory and refactored the existing Create() to use them. I made sure the unit tests still passed and added a couple that should give a basic testing of the new custom bundle functionality. There weren't any BundleTests so I didn't bother to create them, but I did add an example in the SquishItAspNetTest Global.asax.cs below the existing Bundle() (I commented it out so there wouldn't be any surprises).

Adding primitive support for custom javascript bundlers
I took a look and think this is a basic solution for extending the existing Bundle() method to allow some custom bundlers.  I'm not happy about having to know about the internal workings of the JavaScriptBundle Render method in order to stop the hashkey from appending, but I think it's a good stopgap solution that doesn't require you to change much other code.

I added some generic methods for creating the JavaScriptBundle from the Factory and refactored the existing Create() to use them.  I made sure the unit tests still passed and added a couple that should give a basic testing of the new custom bundle functionality.  There weren't any BundleTests so I didn't bother to create them, but I did add an example in the SquishItAspNetTest Global.asax.cs below the existing Bundle() (I commented it out so there wouldn't be any surprises).

@jgable jgable referenced this pull request Feb 25, 2012

Closed

Render Tags Without Hash? #157

Collaborator

AlexCuse commented Feb 25, 2012

Thanks for the code! I think we might be able to do this in a more user-friendly way though (you're right, you shouldn't need to know the internal workings of the render method to get this working).

Something like a "WithoutCacheKey()" method on the existing bundle interface that can be added in your chain of calls should be a bit easier to use (and find!).

AlexCuse added a commit to AlexCuse/SquishIt that referenced this pull request Feb 25, 2012

- adding WithoutRevisionHash to bundle base (alternate solution for #157


  and #158)
- adding test for varying output base href for javascript bundle
- removing empty IBundle interface

jgable commented Feb 25, 2012

I'm good with that. I'll close this in favor of your solution.

@jgable jgable closed this Feb 25, 2012

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