blacklight icon indicating copy to clipboard operation
blacklight copied to clipboard

Support the default javascript package management for the versions of rails we support

Open hackartisan opened this issue 2 years ago • 3 comments

  • [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:

  1. Importmaps (Skip this if a new rails app has sprockets)
  2. Sprockets
  3. Vite
  4. Propshaft

Some of this has happened already in quickstart.md: https://github.com/projectblacklight/blacklight/wiki/Quickstart/_compare/949552bb924574eb99d6756483d09173db5750a4...d7e891944246c6026cf3931918f5d3892d4f55ec

hackartisan avatar Apr 20 '22 18:04 hackartisan

I can't wait to see this, could be a great HOWTO or learning resource for many folks like myself!

epugh avatar Apr 20 '22 18:04 epugh

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.

jcoyne avatar Apr 20 '22 20:04 jcoyne

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)

adjam avatar Apr 21 '22 01:04 adjam