Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

asset_hash considers output file contents for hash #341

Merged
merged 1 commit into from Apr 4, 2012

Conversation

Projects
None yet
2 participants
Owner

bhollis commented Apr 4, 2012

Fix the asset_hash extension to operate on the hash of the rendered output rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from Sitemap::Page#destination_path and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extensions, which included consolidating the JS and CSS Sprockets environments into one.

This took a few dead ends and a lot of reading through the Rails and Sprockets source code, but I'm glad we didn't release asset_hash, even in a beta, without it. This fixes issue #337.

@bhollis bhollis Fix the asset_hash extension to operate on the hash of the rendered o…
…utput rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from Sitemap::Page#destination_path and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extension, which included consolidating the JS and CSS Sprockets environments into one.
fc79459

@tdreyno tdreyno added a commit that referenced this pull request Apr 4, 2012

@tdreyno tdreyno Merge pull request #341 from bhollis/asset_hash
asset_hash considers output file contents for hash
67a84c0

@tdreyno tdreyno merged commit 67a84c0 into middleman:master Apr 4, 2012

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