Asset pipeline dependency issues with plugins

(Michael - #1

[I don’t know if this is a bug, or if we just don’t really understand how it should work, recategorise at will]

We already noticed this during the development of the AdSense plugin, but our test environment wasn’t very clean, so we blamed that. This weekend we installed a new test server and the problem still seems to exist.

When installing a plugin using rake plugin:install , followed by rake assets:precompile and a restart, the client translations (from config/locales/client.en.yml in the plugin directory) are often missing.

We found we had to do a rm -rf public/assets/application* and clean tmp/cache as well before precompiling the assets in order to make sure the assets are recompiled to include the new client translations. Even rake assets:clean doesn’t seem to do the trick. Such a harsh delete causes downtime for the forum while precompiling the new asset files, so this is not really a desired way of doing things.

There’s probably something I’m missing here, since I’m not very familiar with the asset pipeline. As far as I understand, those files must be added to the Sprockets manifest. But I’m clueless how this is done, especially with plugins. And I’m even more clueless how Sprockets does seem to find those files after all when the compiled assets are removed.

Google AdSense plugin
(Sam Saffron) #2

I think this should be working with my latest patches of rake asset:precompile.

rake asset:clean should not really be needed now we automatically nuke tmp.

(Michael - #3

I can confirm that, it’s working pretty well now.

(Sam Saffron) #4