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

With propshaft this gem creates a lot of assets during precompile #3657

Open
4 of 11 tasks
jagthedrummer opened this issue Feb 11, 2025 · 1 comment
Open
4 of 11 tasks

Comments

@jagthedrummer
Copy link

jagthedrummer commented Feb 11, 2025

Describe the bug

I'm working on switching the Bullet Train starter repo from sprockets to propshaft and I've found that the avo gem produces a lot of assets during precompilation.

Reproduction repository for the bug

The branch I'm working on: https://github.com/bullet-train-co/bullet_train/tree/jeremy/propshaft

The PR for that branch: bullet-train-co/bullet_train#1910

Steps to use in the reproduction repository

Remove or comment out these lines: https://github.com/bullet-train-co/bullet_train/blob/011a9e6327b4de8efbe5eb1d46a1e6c9c6ccb730/config/initializers/assets.rb#L8-L11

Run rails assets:precompile.

Then run tree public/assets/avo and tree pubic/assets/heroicons.

You'll see that there are a lot of .svg files in the avo and heroicons directories.

Expected behavior & Actual behavior

I would expect those files not to be there.

System configuration

Avo version: 3.17.2

Rails version: 8.0.1

Ruby version: 3.4.1

License type:

  • Community
  • Pro
  • Advanced

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Screenshots or screen recordings

Here's a link to a gist showing the differences in public/assets after precompiling between sprockets and propshaft: https://gist.github.com/jagthedrummer/f38a0c00879fe34c795e0ff3fd152734

Additional context

I found that I can work around it by explicitly adding several avo directories to the assets.excluded_paths config.

Rails.application.config.assets.excluded_paths = [
  Avo::Engine.root.join("app/assets/builds"),
  Avo::Engine.root.join("app/assets/config"),
  Avo::Engine.root.join("app/assets/stylesheets"),
  Avo::Engine.root.join("app/assets/svgs")
]

I've done a little bit of testing after excluding these paths and things seem to be working as expected. It seems like avo is including a ton of .svg files that aren't actually used for anything.

Impact

  • High impact (It makes my app un-usable.)
  • Medium impact (I'm annoyed, but I'll live.)
  • Low impact (It's really a tiny thing that I could live with.)

Urgency

  • High urgency (I can't continue development without it.)
  • Medium urgency (I found a workaround, but I'd love to have it fixed.)
  • Low urgency (It can wait. I just wanted you to know about it.)
@adrianthedev
Copy link
Collaborator

I saw this issue @jagthedrummer.
We'll work on a fix for it this week 🙌

FYI, that was a pain in my but as well but was too lazy to fix it.

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

No branches or pull requests

2 participants