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 totrue. Requires Bootstrap v5.3+. - Rails authentication.
rails g blacklight:user --authenticationnow 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 generatedsolrconfig.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
SearchServiceand intoSearchBuilder, so that alternative repository backends become feasible.blacklight_configis now an argument toSearchBuilderandsearch_stateis 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 asBlacklight::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, :jsoncorrectly parses JSON values (#3886); thefacets.missingtranslations 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.ymlhas 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 = falsein yourCatalogController. app/assets/images/blacklight/logo.pnghas been replaced bylogo.svgandlogo-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— usesearch_state.params.Blacklight::SearchBuilder#blacklight_params— usesearch_state.params.Blacklight::SearchService#previous_and_next_document_params— customizeBlacklight::SearchBuilder#for_previous_and_next_documentsinstead.Blacklight::SearchService#opensearch_responseand#solr_opensearch_params— deprecated without replacement. OpenSearch suggestions now perform a regular search and rendercatalog/opensearch.json.jbuilder; if you overrode either method, move your customization to the template or search builder.- Passing
:rowstoSearchService#fetch_many— it will be ignored in Blacklight 10. - Repositories that do not implement
#find_many— implement it, or you will fall back to#searchwith a deprecation warning.
- Two signatures changed without a deprecation cycle.
SearchService#previous_and_next_documents_for_searchnow takesextra_controller_paramsas keyword arguments rather than a positional hash, andSearchService#search_state_classhas been removed. Update any local overrides or callers. config.action_mappingentries are nowBlacklight::Configuration::ActionConfigMapEntryobjects rather thanViewConfig(#3740).top_level_configandparent_confighave been renamed toblacklight_config_propertyandparent_action_key, but the old names remain as aliases, so existing configuration should keep working.Blacklight::Solr::Response#force_to_utf8has been removed (#3803). It had been a no-op for several years.
Full Changelog: v9.0.0...v9.1.0