Skip to content

v9.1.0

Latest

Choose a tag to compare

@thatbudakguy thatbudakguy released this 04 Sep 19:50
· 4 commits to main since this release
d6b6183

Overview

This release adds light/dark color mode support, makes Devise optional by supporting Rails' built-in authentication generator, and raises the minimum Ruby, Rails, and ViewComponent versions. It also continues a substantial refactoring of SearchBuilder/SearchService intended to make non-Solr repository backends practical, which introduces a number of deprecations.

Key Changes

  • Dark mode. Blacklight now ships light/dark/auto color modes with a theme switcher in the header (#3877). This is controlled by a new configuration property, config.dark_mode_support, which defaults to true. Requires Bootstrap v5.3+.
  • Rails authentication. rails g blacklight:user --authentication now wires up Rails' built-in authentication generator instead of Devise, including guest-user bookmark/search transfer on sign-in (#3881). Devise remains available via --devise.
  • Ruby & Rails. Requires Ruby 3.3+ (#3835) and Rails 7.2+ (#3834). Now tested against Ruby 4.0 (#3778) and Rails 8.1 (#3872).
  • ViewComponent. Requires view_component 4; ViewComponent 3 is no longer supported (#3836).
  • Solr support. Adds configuration for Solr 10 and drops Solr 8 support (EOL 2024) (#3806). enableRemoteStreaming="true" has been removed from the generated solrconfig.xml (#3791), and both generated Solr configs have been reformatted for consistency (#3807).
  • Search builder refactoring. Repository- and Solr-specific behavior continues to move out of SearchService and into SearchBuilder, so that alternative repository backends become feasible. blacklight_config is now an argument to SearchBuilder and search_state is built lazily (#3851), pagination for previous/next documents moved into the builder (#3858), row limits are set through the builder (#3870), and the Solr {!terms} id filter is now encapsulated as Blacklight::Solr::Request#append_ids_filter (#3867). See the Upgrade Notes for the resulting deprecations.
  • Per-field layout components. Display fields accept a layout_component: option, so an individual field can use its own layout (#3808):
    config.add_show_field 'contents_display', label: 'Contents', layout_component: DisplayMoreFieldLayoutComponent
  • Bug fixes. Advanced search now returns results when the query fields are empty (#3810); attribute :foo, :json correctly parses JSON values (#3886); the facets.missing translations are strings rather than arrays (#3895); and the email and SMS forms have consistent field spacing (#3876).
  • Housekeeping. Bootstrap 5.3.8 is used when generating (#3862); generated importmaps use jsDelivr instead of skypack.dev (#3795); stylesheets use CSS logical properties (#3812); and .rubocop.yml has been updated with several rounds of autocorrection.

Upgrade Notes

  • Bootstrap 5.3+ is now effectively required. Blacklight's stylesheets and templates use 5.3-only classes and variables (bg-body-tertiary, --bs-tertiary-bg, --bs-secondary-color, --bs-emphasis-color-rgb). If your application is pinned below Bootstrap 5.3, upgrade before taking this release.
  • If you do not want the light/dark mode switcher, set config.dark_mode_support = false in your CatalogController.
  • app/assets/images/blacklight/logo.png has been replaced by logo.svg and logo-dark.svg. If you referenced or overrode the PNG, update your references.
  • Ruby 3.1/3.2, Rails 7.0/7.1, Solr 8, and ViewComponent 3 are no longer supported. Rails 7.2 is still permitted by the gemspec, but is no longer covered by CI now that it is EOL as of August 2026.
  • It may be useful to review the changes in the generated Solr config files (schema.xml & solrconfig.xml) and update your local configs accordingly, since these would only get updated for a newly-generated application.
  • The deprecation horizon has moved to Blacklight 10.0. Newly deprecated:
    • Blacklight::SearchService#user_params — use search_state.params.
    • Blacklight::SearchBuilder#blacklight_params — use search_state.params.
    • Blacklight::SearchService#previous_and_next_document_params — customize Blacklight::SearchBuilder#for_previous_and_next_documents instead.
    • Blacklight::SearchService#opensearch_response and #solr_opensearch_params — deprecated without replacement. OpenSearch suggestions now perform a regular search and render catalog/opensearch.json.jbuilder; if you overrode either method, move your customization to the template or search builder.
    • Passing :rows to SearchService#fetch_many — it will be ignored in Blacklight 10.
    • Repositories that do not implement #find_many — implement it, or you will fall back to #search with a deprecation warning.
  • Two signatures changed without a deprecation cycle. SearchService#previous_and_next_documents_for_search now takes extra_controller_params as keyword arguments rather than a positional hash, and SearchService#search_state_class has been removed. Update any local overrides or callers.
  • config.action_mapping entries are now Blacklight::Configuration::ActionConfigMapEntry objects rather than ViewConfig (#3740). top_level_config and parent_config have been renamed to blacklight_config_property and parent_action_key, but the old names remain as aliases, so existing configuration should keep working.
  • Blacklight::Solr::Response#force_to_utf8 has been removed (#3803). It had been a no-op for several years.

Full Changelog: v9.0.0...v9.1.0