blacklight
blacklight copied to clipboard
Support the default javascript package management for the versions of rails we support
- [x] Ship blacklight javascript and css as an npm package
- [ ] Provide and support documentation for how to use this in webpacker and importmap
- [ ] It might also be nice to document some kind of jsbundling-rails solution.
- [ ] When a new blacklight app is generated, lean on the version of rails in use
- [ ] Rails 6, generate webpacker functionality
- [ ] Rails 7 generate importmap functionality
Acceptance Criteria
Document generating a new blacklight application using the following javascript frameworks:
- Importmaps (Skip this if a new rails app has sprockets)
- Sprockets
- Vite
- Propshaft
Some of this has happened already in quickstart.md: https://github.com/projectblacklight/blacklight/wiki/Quickstart/_compare/949552bb924574eb99d6756483d09173db5750a4...d7e891944246c6026cf3931918f5d3892d4f55ec
I can't wait to see this, could be a great HOWTO or learning resource for many folks like myself!
I believe " Ship blacklight javascript and css as an npm package" is already done. See https://www.npmjs.com/package/blacklight-frontend Directions for publishing are https://github.com/projectblacklight/blacklight#building-the-javascript
Webpacker directions are here: https://github.com/projectblacklight/blacklight/wiki/Using-Webpacker-to-compile-javascript-assets
Importmap generates importmap for Rails 7 already: https://github.com/projectblacklight/blacklight/blob/fbd80201a373bfa3a554a016ce9717785909dbc2/lib/generators/blacklight/assets_generator.rb#L32-L38
So it seems to me we only have to ditch the sprockets stuff https://github.com/projectblacklight/blacklight/blob/fbd80201a373bfa3a554a016ce9717785909dbc2/lib/generators/blacklight/assets_generator.rb#L52-L62 and support webpacker.
Is it entirely necessary to drop support for sprockets to support webpacker and importmap? Some of us are migrating Rails 5 applications developed with sprockets.
(objection reduced if this is targeted for blacklight 8)