docsearch
docsearch copied to clipboard
Publish @docsearch/preact package alongside @docsearch/react
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.
In the mean time, is there a reason you can't / don't want to use @docsearch/js?
@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 😃
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 🤔
FYI @shortcuts Vite isn't exclusive to Vue, it can just as well be used in a Preact site, like done here
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"