feat(algolia)!: migrate to algoliasearch v5 for CF Workers compat#69
Merged
Conversation
v4 of the SDK + every `@algolia/*` sub-package imports either
`node:http` (`@algolia/requester-node-http`) or `crypto`
(`@algolia/client-search`) at module load time, which crashes on
Cloudflare Workers before any request is made. Passing
`createFetchRequester()` doesn't help because the import side-effect
fires first.
v5 uses the global `fetch` and Web Crypto APIs only — runs on
Workers, Bun, Deno, modern Node — so this also unblocks
granadobr-tanstack ProductShelves on the deployed worker.
BREAKING: sites consuming `@decocms/apps/algolia` must update their
loaders from the v4 `client.search([{ indexName, query, params:
{...} }])` shape to v5 `client.search({ requests: [{ indexName,
query, ...flatParams }] })`. Granadobr-tanstack will land the loader
update alongside the version bump.
Test mock updated to mirror v5's named export shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
JonasJesus42
added a commit
that referenced
this pull request
Jun 3, 2026
PR #69 migrated algoliasearch to v5 but the squash commit's leading "!" made semantic-release's angular preset skip the release. This empty commit re-triggers the version bump so 2.8.0 lands on npm. BREAKING CHANGE: client.search() signature changed from v4 array to v5 { requests: [...] }. See PR #69 for full migration notes.
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v4 imports node:http and crypto at module load — crashes on CF Workers. v5 uses fetch + Web Crypto globally — runs everywhere. Breaks v4 call shape; granadobr-tanstack landing the loader updates alongside the bump.
Summary by cubic
Upgrade
@decocms/apps/algoliatoalgoliasearchv5 to fix Cloudflare Workers crashes and run on runtimes that provide global fetch/Web Crypto. Removes the custom requester and introduces a breaking change toclient.search.Dependencies
algoliasearchto^5.53.0.@algolia/requester-fetch; peer dep nowalgoliasearch@^5.Migration
client.search([{ indexName, query, params: {...} }])➜ v5client.search({ requests: [{ indexName, query, ...flatParams }] }).import { algoliasearch } from "algoliasearch"(no default export).requester: createFetchRequester(); v5 uses globalfetchby default.Written for commit 39fd8c9. Summary will update on new commits.