Repository navigation
Update the Asset Pipeline guide - #47012
matuszewskijan wants to merge 1 commit into
Conversation
|
This is awesome. When you are happy with it, could you squash down to a single commit please. |
There was a problem hiding this comment.
I think for a first time user this is probably a bit technical, it's talking about concepts they may have never come across or don't care about.
For someone coming from a package.json world it's great, but I don't know if it needs to be the first thing you see here.
There was a problem hiding this comment.
I've updated this part to show import maps more like an "alias" for the library source address, as it's the simplest definition of an import map I could think of. What do you think about the newer version?
There was a problem hiding this comment.
| Webpacker has been the default JavaScript pre-processor and bundler for Rails 5 and 6. `Webpacker` successor is now [`shakapacker`](https://github.com/shakacode/shakapacker) and it's advised to use it. | |
| Webpacker was the default JavaScript pre-processor and bundler for Rails 5 and 6. It has now been retired. A successor called [`shakapacker`](https://github.com/shakacode/shakapacker) exists, but is not maintained by the Rails team or project. |
There was a problem hiding this comment.
The first line of README in Shakapacker repo goes like this:
Official, actively maintained successor to rails/webpacker.
If it's not maintained by Rails team then maybe they shouldn't use the official word, but anyway I like the rewording there and going to commit it.
There was a problem hiding this comment.
I'm not sure what official means in that context. It was added in shakacode/shakapacker#14
I suggested that wording because it's not part of the rails/ github org so isn't owned by the same core team.
cc @justin808 you may have some thoughts on this (or on this PR in general).
There was a problem hiding this comment.
It's official in the sense that @dhh recommends it as the successor, and he came up with the name "shakapacker."
|
I think the only other notable thing missing from this guide is https://github.com/rails/propshaft |
I asked a few questions on Rails Discord before posting this PR, and one of them was about Propshaft. DHH answered that it's a Rails 8 thing so I believe we could skip it for now. https://discord.com/channels/849034466856665118/987190327616090182/1061971064449675264
I will squash it all, let's wait a few more days as I posted it on weekend so maybe there will be more feedback and more commits to come. |
b048935 to
43b7419
Compare
Done. |
|
Awesome! |
|
An error occurred when trying to build this locally, can you take a look? I will try to debug it during my day tomorrow if not: You should be able to reproduce it by running |
Ah sorry there was one conflict I resolved in the wrong way, it should be fixed now. |
45118f3 to
be69bb1
Compare
|
@hachi8833 thank you for the review, I've fixed all of your points, and I've also found a few small typos and fixed them too. I've squashed all of the commits and rebased them with
According to this one, this branch is having conflicts with |
|
Thank you very much for the fixing! I appreciate for your works❤️ @matuszewskijan I think rebasing the branch to |
be69bb1 to
abd3508
Compare
4997ab6 to
acde79e
Compare
Done, I've rebased this branch with |
|
@matuszewskijan @hachi8833 I think what we want to do is get this merged to |
|
@zzak yes, I should've explained more... |
Add back Sprockets guide(with remarks) to Asset Pipeline guide Describe Import Maps in asset pipeline guide Small rewording to first chapters of Asset Pipeline guide Remove Sass and CoffeScript from Codin Links to Assets section Remove Preprocessing section from Asset Pipeline guide Mention dartsass-rails and rewrite beginning Asset Pipeline guide Add more details on `rails-importmaps` in Asset Pipeline guide Add alternative libraries section Align Asset Pipeline guide Sprockets section for Sprockets V4 Improve the introduction to Asset Pipeline guide Fix formatting in Importmap-rails section of Asset Pipeline guide Reword, fix typos and add more context to the Asset Pipeline guide Style, formatting and cleanup changes for asset pipeline guide Minor style/typo fixes to Asset Pipeline guide Remove sections dobuled by mistake from asset pipeline guide Co-authored-by: Alex Ghiculescu <alex@tanda.co> Co-authored-by: Breno Gazzola <breno.gazzola@gmail.com> Co-authored-by: Shozo Hatta <hachi8833@gmail.com>
acde79e to
56969df
Compare
No worries, it was actually my misunderstanding, I've changed the base branch to be again |
|
Thank you for the changing branch! |
|
Was able to get this to build locally with matuszewskijan#1, for anyone else interested in reviewing, I think this screenshot of the intro and chapter guide is a nice start: It does feel like Sprockets could be it's own guide at this point though 🤔 |
Hey Zak, thanks for checking the branch, this section you deleted was supposed to be deleted, but I was rebasing the whole stuff many times and it seems that it sneaked back in the process. Thanks for fixing it! Definitely, Sprockets could have its own guide. But maybe some of the basics are still useful there, still, a lot of stuff in the default setup is dependent on Sprockets. |
Yeah, this is the Sprockets guide, you're 💯 right. I'm not sure what was going through my head at the time 😂. Are you able to update your branch so that the guide builds here? I'd love to get this reviewed and merged. 🙏 |
|
@rafaelfranca it seems the PR is ready to merge. I hope you'd check this 🙏, apart from creating a new Sprockets guide. |
|
This needs a rebase, I'm happy to pitch in and help if that would move things along faster. Just want to make sure! |
|
Since I don't have edit access to @matuszewskijan's fork, I opened #47899 and merged. Thanks everyone for pitching in here! |
Thank you @zzak, I am so happy to see my first contribution merged! Thanks everyone! |


Motivation / Background
This Pull Request has been created because the actual asset pipeline guide were outdated in many ways:
importmaps-railsas the default solution for JavaScriptSprockets 4.0so it never mentioned themanifest.jsfile and some parts were not relevant anymorejsbundling-rails,cssbundling-rails,dartsass-railsandtailwindcss-railsgems weren't mentioned at allDetail
This Pull Request changes the Asset Pipeline guide to reflect the Rails 7 asset pipeline configuration.
Additional information
I've started my work by taking the #45400 draft PR. But in fact it wasn't too helpful and in the end, I've rewritten almost everything by myself.
For the Importmap section, I've mostly copied the Readme from the
importmap-railsgem.Sprockets section changes:
dartsass-railsinstead of the unmaintainedsassc-railsgemCoffeeScriptmentionsAbout the last
Alternative Librariessection: I've tried to only give a clue for the readers to show that there are other resources that might be useful for them. Isn't it too short?First time contributing so I'd highly appreciate any feedback!
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]