Closed jonhyman closed 9 years ago
Yeah that was one of my concerns at that time.. (https://github.com/jwhitley/requirejs-rails/pull/217#issuecomment-94054054) Great you fixed it.
@jonhyman Thanks for this! Let me do a git log -p
and see what, exactly, was removed in favor of asset.digest_path
.
Just got bit by this issue, serving up a cached version when we'd made modifications to one of the dependencies. Is there anything I can do to help get this merged?
@lsimoneau Sorry for the delay. I'll get onto it within the next two days.
Any updates on this? This keeps biting us.
@lsimoneau I'm inundated with work right now. Will try to get to it in the next few days. Why not switch your Gemfile over to using your personal repo temporarily?
@lsimoneau we're using my fork/branch in prod and it works well
No worries, I'll switch to a fork. Again, if there's anything I can do to help (adding tests? something else?) let me know.
All, I'm releasing a new version. Let me know how it goes.
This change seems to have broken when Sprockets::DigestUtils.pack_hexdigest
is not available because of an older version of sprockets (2.3.1) running from rails 4.0.
Unfortunately upgrading sprockets is not an option, because it appears to break other dependencies.
Is there an alternative that I can use? Happy to submit a patch.
Sprockets 2 has Sprockets::Base.file_digest()
and Sprockets::Asset.digest_path()
Can you fork and try doing something like
if defined?(Sprockets::DigestUtils) && Sprockets::DigestUtils.respond_to?(:pack_hexdigest)
hex_digest = Sprockets::DigestUtils.pack_hexdigest(file_digest)
else
hex = Sprockets::Base.file_digest(file_digest)
end
and see if that works for you?
…he static contents from sprockets.
In https://github.com/jwhitley/requirejs-rails/pull/217, @koenpunt switched to copying the built file to
asset.digest_path
. However, this is the digest of the original source file. If a dependency of one of the files changes, then the hash will remain the same. This causes massive problems with browsers not getting the new contents because the filename is the same and the browser pulls from cache.