typesense / typesense/typesense-website
Cannot get Typesense to work with VuePress 2.x
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 66
- Forks
- 201
- Avg merge
- 12d 17h
- Merged PRs (30d)
- 4
Description
Description
There is documentation on how to use your own Typesense server in Vuepress. This seems to be created for VuePress 1.x. I cannot get it to work on VuePress 2.x.
Broken component
The component TypesenseSearchBox.vue does not work out of the box anymore for multiple reasons.
- Components are not automatically registered anymore. You need to install the plugin
@vuepress/plugin-register-componentsand configure this. - It requires the docsearch dependency, but this is not included. You need to install the plugin
@vuepress/plugin-docsearchfor this. Couldn't get this to work, so I manually downloaded the docsearch javascript files and added this. - Options are not configurable anymore in themeConfig. This works differently. I don't know what would be the equivalent.
What I tried
I tried to configure the plugin @vuepress/plugin-docsearch. I think this is the way forward, but I could not make it work. The reason is that I cannot get a proper client to work. Maybe somebody with expertise can help me figure this out.
What I did:
- Create a new VuePress 2 project.
- Install the plugin
@vuepress/plugin-docsearch. - Created the file
src/.vuepress/client.tsand gave it the following content:
import {defineDocSearchConfig} from "@vuepress/plugin-docsearch/client";
defineDocSearchConfig({
// @ts-ignore
transformSearchClient: (searchClient) => {
return ??? // What to fill in here?
}
})
I think if I could make this transformSearchClient work, then it would be perfect. However, I don't know what to use. I tried to use typesense-docsearch, but this requires React, and that doesn't work. I hope that we can figure this out, and if we do, that we document it on the website as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review TypesenseSearchBox.vue and src/.vuepress/client.ts, starting by reproducing the reported VuePress 2 setup with the listed docsearch plugins. Done means a working VuePress 2 integration and website documentation covering component registration, dependencies, and option configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- documentation, web-dev
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100