docsearch icon indicating copy to clipboard operation
docsearch copied to clipboard

Publish @docsearch/preact package alongside @docsearch/react

Open ElMassimo opened this issue 4 years ago • 5 comments
trafficstars

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 to replace react with preact.

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

ElMassimo avatar Oct 18 '21 15:10 ElMassimo

In the mean time, is there a reason you can't / don't want to use @docsearch/js?

Haroenv avatar Oct 19 '21 07:10 Haroenv

@Haroenv I was using @docsearch/js, but ergonomics are better if you can use the components directly.

It's a nice-to-have, but it seems reasonable 😃

ElMassimo avatar Oct 19 '21 07:10 ElMassimo

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

Easing the Vue integrations is the missing part of releasing the stable v3 IMO.

I was using @docsearch/js, but ergonomics are better if you can use the components directly.

Ideally, I think we would like provide a VDOM uncontrolled solution (like we did on Recommend for example), but your solution also seems like an easy step 🤔

shortcuts avatar Oct 19 '21 07:10 shortcuts

FYI @shortcuts Vite isn't exclusive to Vue, it can just as well be used in a Preact site, like done here

Haroenv avatar Oct 19 '21 07:10 Haroenv

FYI @shortcuts Vite isn't exclusive to Vue, it can just as well be used in a Preact site, like done here

Yes indeed, I was referring to Vue because it's the "harder to implement DocSearch with"

shortcuts avatar Oct 19 '21 07:10 shortcuts