Closed BenMorganIO closed 10 years ago
I'm not very familiar to the caching in sprockets, but i'll have a look.
As a note, this is currently what I am doing within my Rails application to remove the files beforehand:
class ApplicationController < ActionController::Base
before_action :remove_old_dart_files
protect_from_forgery with: :exception
def remove_old_dart_files
files = Dir["#{Rails.root}/tmp/cache/assets/dart2js*"]
dart_app_mtime = File.mtime("#{Rails.root}/app/assets/dart/dart_app.dart")
files.each do |file|
File.delete(file) if File.mtime(file) < dart_app_mtime
end
end
end
Yeah that would do the Job. But it's not like it should be done. Sprockets is only unable to detect the changes, because the actual dart_app.js doesn't change.
@BenMorganIO would you please try 760bfb2bef597c54fa375da54168ad94bf833141 (the current head).
This worked for me and recognized changes in all imported dart-files, except the ones from the SDK.
Problem is now fixed in master with v0.2.0
When I load a page up with dart information as so:
It successfully compiles. If I change the contents to:
It appears that the console does not log the updated print, but rather
hey there
. If I delete the cache and reload, it successfully recompiles.Are you able to identify that if the file has changed, to recache the compiled dart code?