Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should bin/shakapacker work without Ruby? #465

Open
justin808 opened this issue Apr 5, 2024 · 1 comment
Open

Should bin/shakapacker work without Ruby? #465

justin808 opened this issue Apr 5, 2024 · 1 comment

Comments

@justin808
Copy link
Member

Desired behavior:

If bin/shakapacker works without Ruby, then Docker Layer Caching (DLC) could fetch JS packages (yarn) and compile without the cache breaking due to Ruby changes. Currently, most will put the Ruby layers before the JS layers so that if the Ruby layers don't change, then the DLC will be used. But if any cache layers break due to Ruby changes, then bin/shakapacker has to run again.

One alternative is to cache the results of rake assets:precompile, as React on Rails Pro does.

Actual behavior:

Running bin/shakapacker requires all Ruby dependencies to be installed and be earlier layers of the DLC.

Setup environment:

N/A

@G-Rath
Copy link
Contributor

G-Rath commented Apr 6, 2024

I'm not sure it makes sense for Shakapacker to not use ruby for bin/shakapacker, because isn't that basically what jsbundling-rails is?

I think there are probably two areas worth looking into for Shakapacker:

  1. multistage builds: more specifically, figuring out what Ruby files are generally needed on average and encouraging those to be copied in a dedicated build, then have the output of that copied out into the main build
  2. caching the results of rake assets:precompile and/or webpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants