typesense / typesense/typesense-website

Cannot get Typesense to work with VuePress 2.x

Open
#255 1 comment 0 reactions 0 assignees View on GitHub

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.

  1. Components are not automatically registered anymore. You need to install the plugin @vuepress/plugin-register-components and configure this.
  2. It requires the docsearch dependency, but this is not included. You need to install the plugin @vuepress/plugin-docsearch for this. Couldn't get this to work, so I manually downloaded the docsearch javascript files and added this.
  3. 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:

  1. Create a new VuePress 2 project.
  2. Install the plugin @vuepress/plugin-docsearch.
  3. Created the file src/.vuepress/client.ts and 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.