Code Monkey home page Code Monkey logo

asset_cache_repo's Introduction

To reproduce rails/sprockets#127 as we are experiencing it:

How is this setup?

Basically the parent and child apps are the same, but the child app's assets are symlinked in public/assets and tmp/cache/sprockets-4.0. You can compile in either app but you can only delete the cache or clobber in the parent app.

This is trying to mimic how deploy releases work.

Reproducing the ๐Ÿ›

  1. Bundle both asset_cache_test_parent and asset_cache_test_child directories

  2. cd asset_cache_test_parent

  3. Run ./assets_script

This will clobber assets, remove your tmp/cache and then re-compile all assets.

  1. Make a change in the app/assets/stylesheets/all/banana.scss file. It can be as simple as changing the background color from red to green.

  2. Run bundle exec rake assets:precompile and you'll see the output that indicates it compiled.

  3. cd ../asset_cache_test_child

  4. Make a change in the app/assets/stylesheets/all/banana.scss file. Be sure to change it to a color you haven't used before. So if you changed red to green in the parent file change red to blue in the child folder. This is important becasue if the change is exactly the same you won't be reproducing the issue, because the cache hasn't changed from a previous version's cache.

  5. Run bundle exec rake assets:precompile and you will see that the files did not compile. This is because there is a cache confusion and the child app isn't seeing that it changed versus the parent app. If you flip flop these and change the child first instead of the parent the parent will fail to update.

Fixing the ๐Ÿ›

If you change the branch to sprockets-issue from https://github.com/eileencodes/sprockets and re-run this in order of these events you'll see that both child and parent apps compile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.