Skip to content

mod-flexsearch: default lazyLoad to true in a future major release #1934

@markdumay

Description

@markdumay

Problem or enhancement idea

mod-flexsearch v4's lazyLoad option (added in gethinode/mod-flexsearch@caaa1fb) defaults to false so that the introducing release is non-breaking. The performance win is significant — one ~542-page Hinode site went from a 6.45 MB core bundle to 149 KB — and the lazy path is the right default for most sites. A future major release should flip the default.

Proposed solution

In the next planned major release of mod-flexsearch:

  • Change the default in config.toml from lazyLoad = false to lazyLoad = true.
  • Document the CSP requirement and the layout-override note prominently in the release notes / CHANGELOG.
  • Consider removing the eager path entirely to reduce template complexity. (Alternatively, keep the toggle so sites can opt back to eager.)

Alternatives

Keep lazyLoad opt-in indefinitely and rely on each site to enable it. Loses the win for sites that never opt in.

Additional context

This is a breaking change:

  • A site with a strict hand-written Content Security Policy whose connect-src lacks 'self' will silently break — the index fetch is blocked and search input focuses but never loads results. (Sites using mod-csp are covered: mod-flexsearch ships a csp block that auto-merges connect-src 'self'.)
  • Sites that overrode flexsearch.index.js or the search-input layouts in their own theme will not get the new wiring and may silently lose search.
  • The empty flexsearch-index.json artifact already lands on every Hinode site as of 98160ea + c624d12 (registered output format + outputs entry).
  • Original lazy-load feature: gethinode/mod-flexsearch@caaa1fb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeIntroduces a breaking change that is not backwards compatibleenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions