Hi there. I’ve run into quite a roadblock with vendored assets, and I’d like to propose more facilities for handling them than is present in this PR. That PR directly addresses vendor assets in a single app, but what about assets that need to be shared across multiple apps?
> tree -L 1 apps/
apps/
├── admin
├── auth
└── web
3 directories, 0 files
In this situation, I want to be able to use the Argon Bootstrap theme in each of those apps. I know that I can build a gem like @davydovanton’s hanami-bootstrap but I believe I should also be able to “plop” these files somewhere in my repo and include them while using the stylesheet and javascript helpers (I still want to take advantage of fingerprinting, CDN mode and integrity checking.)
Short of just putting these on a my own CDN, I’m curious what the community thinks about:
adding a lib/assets/ folder that stylesheet and javascript would respect
changing stylesheet and javascript such that if the path starts with a / then it translates to the root of public/. This would escape the app trap I’ve been running into.
Thoughts? I’m not necessarily proposing all of those points, just enumerating what’s in my head.
In one of the issues on Github, I saw that @jodosha will modify paths in vendor assets, but IMO, as soon as you do that, it’s no longer a truly “vendored” asset, as I’ve taken on the burden to maintain those modifications when upgrading to new versions.
@jc00ke Hi. Given https://github.com/hanami/assets/pull/88 was merged and it will be included in hanamiv1.3.0.beta1 (out in a few days). At that point the assets will preserve the vendored structure.
Did you try to add a vendor/assets/argon directory and then add it as a source for the assets:
I believe it was apps/web/assets/argon/... but I’ve since moved on to putting it all on my own CDN
I still think it’s worth having a special vendor directory for assets though. I’d suggest it punts on fingerprinting and instead we document the asset’s directory should contain a version number.
I propose we add a shared vendor directory that is available across all apps that does not fingerprint the assets. Vendored assets should be versioned already.
Right now, I have 4 apps, and they all use the same UI theme
Right now, I don’t have a place to put the vendored files except onto a CDN. It’d be much nicer to have a lib/vendor/assets that only get served and don’t get copied to public/.
My short-term fix was to move all of these assets to a CDN on CloudFront. Now I just have javascript and stylesheet links in my different layout files.