GithubHelp home page GithubHelp logo

Comments (7)

greypants avatar greypants commented on June 4, 2024

Good question.

That's actually intentional... or at least it was at one point. Originally, I was recommending including the generated css and js files into app/assets/{javascripts,stylesheets}/application.{css,js}, in which case, Rails would take care of revisioning the files.

In the original version of this based on gulp-starter. I'm revisioning in multiple steps.

  1. First, hit all the assets, so their filenames change first.
  2. Then replace the changed filenames in css and js files.
  3. Now we can revision the css and js files. If any child asset filenames have changed, the css and js file will have changed too, which will change the newly generated hash.

If we versioned everything at the same time, the hash of the css and js files wouldn't change as a result of referenced assets changing, and you could have cached files being served pointing to old filenames.

But I guess I stripped out those later steps and decided to let Rails handle that bit. Not sure if I still agree with that decision or not, but that's the state of things.

At some point, I need to get this up to date with gulp-starter

from gulp-rails-pipeline.

davidham avatar davidham commented on June 4, 2024

@greypants thanks for the response. I'm using gulp-rails-pipeline for my app but I'm not using browserify--I'm still doing AMD modules. My rev-manifest.json has a font file, my one graphic file, a CSS sourcemap, and a js file named bind.polyfill.js, which I guess gets past your pattern in the commit referenced above. Was your intention to have your gulp pipeline create the global.js bundle and the Sass-ified CSS file, and then have the developer =require them in application.js and application.css? So if I were to build my JS file on the gulp side and then require it from the Rails side, the revving should work? Thanks for any advice you can offer--I love the project and your Viget blog, which has helped me a number of times.

from gulp-rails-pipeline.

greypants avatar greypants commented on June 4, 2024

@davidham yep, that's the gist of it. Rails's rake assets:precompile command will still rev and compress anything in the pipeline. So like you said, if you =require the files into the pipeline, you can use the rails revisioned files (that include your gulp-processed files) instead.

from gulp-rails-pipeline.

davidham avatar davidham commented on June 4, 2024

@greypants Would your new webpack tasks from gulp-starter-2 work in gulp-rails-pipeline, like in place of browserify/watchify? I had been thinking of getting started with webpack because I can still use my AMD files. Thanks again!

from gulp-rails-pipeline.

greypants avatar greypants commented on June 4, 2024

The file and configuration structure has changed quite a bit, so just doing a drop in replacement might require some figuring out, but yeah, that could work. I'll try to get this thing up to date in the next week, once I get gulp-starter 2.0 merged into master... which will be this week!

from gulp-rails-pipeline.

davidham avatar davidham commented on June 4, 2024

Sounds awesome! I got gulp-starter-2 working with my Rails app, seems like it's pretty straightforward and mostly driven by the path settings in the config file. Nice work!

from gulp-rails-pipeline.

greypants avatar greypants commented on June 4, 2024

@davidham yesssssss! That is music to my ears. So good to hear.

from gulp-rails-pipeline.

Related Issues (20)

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.