-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Comments
I saw this issue @jagthedrummer. FYI, that was a pain in my but as well but was too lazy to fix it. |
Approach
|
Thanks for taking a look at this. I just updated to
It looks like they're coming from here: https://github.com/avo-hq/avo/tree/main/app/assets/svgs/avo Should this issue be reopened, or should we make a new one? |
It looks like your solution with
Source https://github.com/rails/propshaft?tab=readme-ov-file#usage
Source https://github.com/rails/propshaft?tab=readme-ov-file#usage That said, we could configure this within Avo itself: # lib/avo/engine.rb
module Avo
class Engine < ::Rails::Engine
config.assets.excluded_paths << Avo::Engine.root.join("app", "assets", "svgs")
end
end However, we’re not entirely sure if users rely on those SVGs from Our recomendationFor now, we suggest you explicitly add the Additionally, when modifying Rails.application.config.assets.excluded_paths << [
Avo::Engine.root.join("app/assets/svgs"),
Cloudinary::Engine.root.join("vendor/assets/html"),
Cloudinary::Engine.root.join("vendor/assets/javascripts"),
Doorkeeper::Engine.root.join("vendor/assets/stylesheets"),
BulletTrain::Themes::Light::Engine.root.join("app/assets/config"),
BulletTrain::Themes::Light::Engine.root.join("app/assets/stylesheets"),
] Let us know if you have any concerns, Thank you! |
Hey @Paul-Bob, I guess I don't have any concerns so much as just a question: How are the svg assets that are still being precompiled different from the ones that were moved into Manually excluding them does work, so if that's the way we need to go that's fine. Might be nice to mention it in the installation docs so people are aware that it's something they may want to do. |
In contrast, the other SVG assets are custom Avo icons that we modify or add as needed. Extracting them into a separate gem would introduce unnecessary friction in development, as maintaining a separate package for every addition, deletion, or modification would be necessary.
I believe this is the best option for both of us at the moment, as it requires minimal effort on both your end and ours. We have some ideas to explore regarding the assets pipeline and may revisit this issue in the future.
Documenting it is a good idea, thank you for the suggestion. |
Closing this issue to maintain a tidy queue. Let’s keep the conversation going and reopen it if needed. |
Describe the bug
I'm working on switching the Bullet Train starter repo from
sprockets
topropshaft
and I've found that theavo
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
andtree pubic/assets/heroicons
.You'll see that there are a lot of
.svg
files in theavo
andheroicons
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:
Are you using Avo monkey patches, overriding views or view components?
Screenshots or screen recordings
Here's a link to a gist showing the differences in
public/assets
after precompiling betweensprockets
andpropshaft
: https://gist.github.com/jagthedrummer/f38a0c00879fe34c795e0ff3fd152734Additional context
I found that I can work around it by explicitly adding several
avo
directories to theassets.excluded_paths
config.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
Urgency
The text was updated successfully, but these errors were encountered: