Skip to content

Update dependency highlight-words-core to v2 - #574

Merged
davidjgoss merged 1 commit into
mainfrom
renovate/highlight-words-core-2.x
Oct 20, 2026
Merged

davidjgoss merged 1 commit into
mainfrom
renovate/highlight-words-core-2.x

Conversation

@renovate

@renovate renovate Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
highlight-words-core 1.2.3 → 2.0.0 age confidence

Release Notes

bvaughn/highlight-words-core (highlight-words-core)

v2.0.0

Compare Source

Breaking changes
  • String search words are matched literally by default (autoEscape now defaults to true). To match patterns, pass RegExp search words, or set autoEscape: false for trusted input only.
  • findChunks and combineChunks no longer include a highlight property in the chunks they return; findAll and fillInChunks (which return the final chunks) still do. Custom findChunks functions return { start, end, searchIndex }.
  • Custom findChunks functions must include a searchIndex (the index within searchWords of the search word that matched) in each chunk they return.
  • Custom findChunks functions receive searchWords as a ReadonlyArray; TypeScript functions that declare it as a mutable array (e.g. string[]) must update their parameter type.
  • Chunk is now a union of HighlightedChunk (highlight: true, with a required searchIndex) and NonHighlightedChunk (highlight: false, with no searchIndex). TypeScript code must check chunk.highlight before reading chunk.searchIndex, and code that builds chunks with a highlight value typed as boolean must use a literal true or false instead.
  • combineChunks no longer sorts the array passed to it in place, and always returns new chunk objects.
  • The published code uses modern JavaScript syntax (ES2020, e.g. ?? and object spread) instead of being compiled to ES5. Older environments and bundlers that can't parse it (e.g. webpack 4) need to transpile the package.
  • The package is now written in TypeScript and ships TypeScript declarations; Flow types are no longer included.
  • The package now ships CommonJS and ES module builds and defines exports, so only the package root (highlight-words-core) can be imported. Deep imports (e.g. highlight-words-core/dist/index.js) and the previously published src/*.js files are no longer available.
  • When autoEscape is false, string search words that aren't valid regular expressions (e.g. "(a") are matched literally instead of throwing an error.
  • When a sanitize function changes the text, it is applied to each character separately (so that matches can be mapped back to the original text). Sanitizers that depend on context will give different results; for example, toLowerCase() turns a final "Σ" into "ς" when applied to a whole word, but into "σ" when applied to the character alone.
New features
  • searchWords can include RegExp objects, which are used as-is (with their own flags).
  • searchWords can be a readonly array (e.g. ["a", "b"] as const).
  • Highlighted chunks include a searchIndex property: the index (within searchWords) of the search word that matched.
  • The HighlightedChunk and NonHighlightedChunk types are exported.
Bug fixes
  • Matches map back to the original text when the sanitize function changes its length (e.g. latinize("Æ") is "AE").
  • Surrogate pairs (e.g. emoji) are no longer split between chunks.
  • Chunks from a custom findChunks that extend outside of the text (or whose end is before their start) no longer produce invalid or overlapping chunks.
  • A missing (null or undefined) textToHighlight is no longer searched as e.g. the string "undefined".
  • Missing (null or undefined) searchWords no longer throw an error; nothing is highlighted.
  • Non-string search words from untyped callers (e.g. the number 0) are matched as strings, rather than being skipped if falsy.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying react-components with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ac4bc0
Status: ✅  Deploy successful!
Preview URL: https://0d19db50.react-components-9pg.pages.dev
Branch Preview URL: https://renovate-highlight-words-cor.react-components-9pg.pages.dev

View logs

@renovate
renovate Bot force-pushed the renovate/highlight-words-core-2.x branch 7 times, most recently from 7b65d89 to ca254b3 Compare October 18, 2026 18:35
@renovate
renovate Bot force-pushed the renovate/highlight-words-core-2.x branch from ca254b3 to 9ac4bc0 Compare October 19, 2026 07:29
@davidjgoss
davidjgoss merged commit 35bb395 into main Oct 20, 2026
6 checks passed
@davidjgoss
davidjgoss deleted the renovate/highlight-words-core-2.x branch October 20, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant