algolia / algolia/docsearch

Publish @docsearch/preact package alongside @docsearch/react

Open
#1,063 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.4k
Forks
439
Avg merge
14h 32m
Merged PRs (30d)
19

Description

## Describe the problem

Using docsearch directly with Preact currently requires manual configuration.

For example, using `@docsearch/react` in Vite.js projects requires manual fiddling to replace `require("react")` with `require("preact/compat")`.

## Describe the solution

Publish a `@docsearch/preact` package that uses [the same setup as `@docsearch/js`](https://github.com/algolia/docsearch/blob/next/packages/docsearch-js/babel.config.js#L25-L32) to replace react with preact.

`@docsearch/js` could depend on `@docsearch/preact` directly instead.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing @docsearch/react package with the @docsearch/js Babel setup linked in the issue, then trace how packages are published and how @docsearch/js declares dependencies. The work is done when a published @docsearch/preact package supports the described Vite.js setup without manual React-to-Preact configuration and the dependency arrangement matches the issue proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.