jekyll-client-search 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a81876e4d3baeeaee8d756c12a45f5d29e4200a4d79cd708245285e0628c2a5d
4
- data.tar.gz: f7c9dbb72a9e430b78d36f793050aae940f238d8f12327ba2418d5840904d608
3
+ metadata.gz: 2d41bdcd8b525ad91373a75a42687832d709313fb347c818cd4d2b0b729f17a0
4
+ data.tar.gz: aa8971a61b0eb2d38d98e47fa6fe93063f8a3558320fec433d7ea769bf741ced
5
5
  SHA512:
6
- metadata.gz: aded0fbf724d9b9c10762ade46f27a934e7988d824f30dc343aeba3b991d775cf447ad4a77e85ea841fe7f9edb4b5f9390008a3ad2cbad7e694b21dc8d2d7c8c
7
- data.tar.gz: b8236b45f613185adf35dffdf1c4f99e9e540b040ed97dac16c78fa9ff18cc0deda1bb385b38f3de9363dcc775644e5eaa01870d0122ca62b46de7c0c78a8a9d
6
+ metadata.gz: f8ae1fc4471054e91b1c67221b0dbe5c5b9939bb9fe9960b2cf993bdac5f39b08ff09325c553d5916a38bdbac91232d213416d3b42ae4cd8f5fb0dad30fc9815
7
+ data.tar.gz: 38677eba44dd93575c66c206d47fdd2dc0ae576f224079ccb135dc2a0d7b39f6a3ddc6c411d7fc552b7934b9d2b751ab5c12af0d7c6eeb72ccbd2713a641f75e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.2 — 2026-12-03
4
+
5
+ ### Changed
6
+
7
+ - `{% search_form %}` and `{% search_dropdown %}` now emit `<script defer>`
8
+ tags — runtime scripts no longer block HTML parsing. Deferred scripts
9
+ execute in document order after parsing, keeping the engine → runtime
10
+ config → shared → tag → adapter chain intact and guaranteeing the DOM is
11
+ ready when adapters self-invoke. `{% related_articles %}` scripts stay
12
+ synchronous so the documented inline `ClientSearchRelated.run({...})`
13
+ customization pattern keeps working.
14
+ - npm dev-deps: `markdownlint-cli2` 0.24.0 → 0.24.2, `eslint` ~10.14.0 →
15
+ ~10.15.0.
16
+ - `jsdom` test-environment bump ^30.1.3 → ^31.0.1 — v31 breaking areas
17
+ (napi-rs canvas backend, CSS engine rewrite, blocking-script parse
18
+ pauses, `load` now window-only, `document.open` listener clearing) are
19
+ unused by the suite; all 156 tests pass.
20
+ - Dev-tooling bumps: `ollama-ruby` 1.26.0 → 1.27.2, `rubocop` 1.92.2 →
21
+ 1.92.3 (plus transitive: `infobar` 0.17.0, `complex_config` 0.28.0,
22
+ `excon` 1.12.0, `kramdown` 2.6.1, `parser` 3.3.14.0, `prism` 2.1.0).
23
+ - Development Ruby pin bumped to 3.4.13 (CVE-2026-132825); `ruby/setup-ruby` bumped to v1.343.0.
24
+ - npm override: `cross-spawn` ^7.1.0 — fixes GHSA-ghv9-86vm-4v8m
25
+ (critical, Windows command injection), a transitive eslint dep pinned to
26
+ ^7.0.6.
27
+
3
28
  ## 0.5.1 — 2026-11-10
4
29
 
5
30
  ### Changed
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # jekyll-client-search
1
+ # jekyll-client-search <a href="https://gundestrup.github.io/flow/"><img align="right" src="https://gundestrup.github.io/flow/assets/badges/part-of-flow.svg?v=2" alt="Part of Flow software" height="40"></a>
2
2
 
3
3
  [![codecov](https://codecov.io/gh/gundestrup/jekyll-client-search/branch/main/graph/badge.svg)](https://codecov.io/gh/gundestrup/jekyll-client-search)
4
4
 
@@ -10,7 +10,7 @@
10
10
  [![Ruby](https://img.shields.io/badge/ruby-%E2%89%A5%203.3-red.svg)](https://www.ruby-lang.org/)
11
11
  [![Jekyll](https://img.shields.io/badge/jekyll-4.x-blue.svg)](https://jekyllrb.com/)
12
12
  [![License: AGPL v3](https://img.shields.io/badge/license-AGPL--3.0--or--later-blue.svg)](LICENSE)
13
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/gundestrup/jekyll-client-search)
13
+ [<img src="https://devin.ai/assets/askdeepwiki.png" alt="Ask DeepWiki" height="20"/>](https://deepwiki.com/gundestrup/jekyll-client-search)
14
14
  [![Coverage](https://img.shields.io/badge/coverage-100%25%20branches-brightgreen.svg)](#testing-strategy)
15
15
  [![Semgrep](https://img.shields.io/badge/semgrep-scanning-brightgreen.svg)](https://semgrep.dev)
16
16
  [![CodeFactor](https://www.codefactor.io/repository/github/gundestrup/jekyll-client-search/badge)](https://www.codefactor.io/repository/github/gundestrup/jekyll-client-search)
@@ -1075,10 +1075,10 @@ The sections below show the manual `<script>` setup for each engine.
1075
1075
  <div id="search-status" aria-live="polite"></div>
1076
1076
  <div id="search-results"></div>
1077
1077
  <script src="https://cdn.jsdelivr.net/npm/minisearch@7.2.0/dist/umd/index.min.js"
1078
- crossorigin="anonymous"></script>
1079
- <script src="/assets/search-runtime-config.js"></script>
1080
- <script src="/assets/client-search-base.js"></script>
1081
- <script src="/assets/adapters/minisearch.js"></script>
1078
+ crossorigin="anonymous" defer></script>
1079
+ <script src="/assets/search-runtime-config.js" defer></script>
1080
+ <script src="/assets/client-search-base.js" defer></script>
1081
+ <script src="/assets/adapters/minisearch.js" defer></script>
1082
1082
  ```
1083
1083
 
1084
1084
  ### ElasticLunr
@@ -1091,10 +1091,10 @@ The sections below show the manual `<script>` setup for each engine.
1091
1091
  <div id="search-status" aria-live="polite"></div>
1092
1092
  <div id="search-results"></div>
1093
1093
  <script src="https://cdn.jsdelivr.net/npm/elasticlunr@0.9.5/elasticlunr.min.js"
1094
- crossorigin="anonymous"></script>
1095
- <script src="/assets/search-runtime-config.js"></script>
1096
- <script src="/assets/client-search-base.js"></script>
1097
- <script src="/assets/adapters/elasticlunr.js"></script>
1094
+ crossorigin="anonymous" defer></script>
1095
+ <script src="/assets/search-runtime-config.js" defer></script>
1096
+ <script src="/assets/client-search-base.js" defer></script>
1097
+ <script src="/assets/adapters/elasticlunr.js" defer></script>
1098
1098
  ```
1099
1099
 
1100
1100
  ### Semantic
@@ -1105,11 +1105,11 @@ only while Jekyll builds the document vectors. The first query downloads the
1105
1105
  q8 browser model (about 325 MB for EmbeddingGemma); the browser caches it.
1106
1106
 
1107
1107
  ```html
1108
- <script src="/assets/search-runtime-config.js"></script>
1109
- <script src="/assets/search-embedder-config.js"></script>
1110
- <script src="/assets/query-embedders/transformers.js"></script>
1111
- <script src="/assets/client-search-base.js"></script>
1112
- <script src="/assets/adapters/semantic.js"></script>
1108
+ <script src="/assets/search-runtime-config.js" defer></script>
1109
+ <script src="/assets/search-embedder-config.js" defer></script>
1110
+ <script src="/assets/query-embedders/transformers.js" defer></script>
1111
+ <script src="/assets/client-search-base.js" defer></script>
1112
+ <script src="/assets/adapters/semantic.js" defer></script>
1113
1113
  ```
1114
1114
 
1115
1115
  The default library is loaded from jsDelivr and the model from Hugging Face.
@@ -82,6 +82,10 @@ module Jekyll
82
82
  baseurl.empty? ? "" : "/#{baseurl}"
83
83
  end
84
84
 
85
+ # Unlike ScriptTags consumers, these stay synchronous on purpose: the
86
+ # documented customization pattern is an inline
87
+ # `ClientSearchRelated.run({...})` call right after the script tags,
88
+ # which would run before a deferred client-search-related.js.
85
89
  def build_scripts(prefix)
86
90
  return "" unless @include_scripts
87
91
 
@@ -9,15 +9,19 @@ module Jekyll
9
9
  module ScriptTags
10
10
  private
11
11
 
12
+ # Script order matters (engine -> runtime config -> shared -> tag ->
13
+ # adapter), so `defer` is used rather than `async`: deferred scripts
14
+ # execute in document order after parsing, keeping the chain intact
15
+ # without blocking rendering.
12
16
  def script_tags(configuration, prefix, tag_asset, extra: [])
13
17
  scripts = []
14
18
  engine = engine_script(configuration)
15
19
  scripts << engine if engine
16
- scripts << "<script src=\"#{prefix}/assets/search-runtime-config.js\"></script>"
20
+ scripts << "<script src=\"#{prefix}/assets/search-runtime-config.js\" defer></script>"
17
21
  scripts.concat(extra)
18
- scripts << "<script src=\"#{prefix}/assets/client-search-shared.js\"></script>"
19
- scripts << "<script src=\"#{prefix}/assets/#{tag_asset}\"></script>"
20
- scripts << "<script src=\"#{prefix}/assets/adapters/#{configuration.engine}.js\"></script>"
22
+ scripts << "<script src=\"#{prefix}/assets/client-search-shared.js\" defer></script>"
23
+ scripts << "<script src=\"#{prefix}/assets/#{tag_asset}\" defer></script>"
24
+ scripts << "<script src=\"#{prefix}/assets/adapters/#{configuration.engine}.js\" defer></script>"
21
25
  scripts.map { |script| " #{script}" }.join("\n")
22
26
  end
23
27
 
@@ -25,7 +29,7 @@ module Jekyll
25
29
  url = configuration.engine_url
26
30
  return nil unless url
27
31
 
28
- attrs = ["src=\"#{CGI.escapeHTML(url)}\""]
32
+ attrs = ["src=\"#{CGI.escapeHTML(url)}\"", "defer"]
29
33
  if configuration.engine_crossorigin
30
34
  crossorigin = CGI.escapeHTML(configuration.engine_crossorigin)
31
35
  attrs << "crossorigin=\"#{crossorigin}\""
@@ -80,14 +80,14 @@ module Jekyll
80
80
  def embedder_scripts(configuration, prefix)
81
81
  return [] unless semantic_with_embedder?(configuration)
82
82
 
83
- scripts = ["<script src=\"#{prefix}/assets/search-embedder-config.js\"></script>"]
83
+ scripts = ["<script src=\"#{prefix}/assets/search-embedder-config.js\" defer></script>"]
84
84
  embedder_asset = configuration.query_embedder_asset
85
85
  # simplecov:disable branch
86
86
  # Defensive guard: semantic_with_embedder? already excludes the "none"
87
87
  # type, and both "transformers" and "ollama_api" always return an asset.
88
88
  # This branch is unreachable with current embedder types but protects
89
89
  # against future types that may have no script asset.
90
- scripts << "<script src=\"#{prefix}/#{embedder_asset}\"></script>" if embedder_asset
90
+ scripts << "<script src=\"#{prefix}/#{embedder_asset}\" defer></script>" if embedder_asset
91
91
  # simplecov:enable branch
92
92
  scripts
93
93
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module ClientSearch
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-client-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svend Gundestrup