projectblacklight / blacklight

Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
http://projectblacklight.org/
Other
760 stars 256 forks source link

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

Open hackartisan opened 2 years ago

hackartisan commented 2 years ago

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

epugh commented 2 years ago

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

jcoyne commented 2 years ago

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.

adjam commented 2 years ago

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)