quickwit-oss / quickwit-oss/quickwit

Publish JS client as NPM package

Open
#3,069 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
11.7k
Forks
598
Avg merge
2d 22h
Merged PRs (30d)
37

Description

I'd like to build a UI for QuickWit, in my case in Svelte. I can either read the docs and build a JS client myself, or... Perhaps re-use the client.ts from QuickWit.

I think having an official NPM package helps to attract users and prevent issues. API changes in the REST API or query syntax might be abstracted away in a JS API. Building more complex queries might become easier using type-safe objects instead of manually building a query string.

Some thoughts on doing this:

  • Splitting up the JS codebase means this will become a project with multiple packages. This means you'll want to use workspaces.
  • I think the package will need to have the models.ts, client.ts and urls.ts files.
  • I recommend switching from yarn to pnpm, which also supports workspaces, but is faster than yarn and provides better dev UX, in my opinion
  • I recommend switching from react-app-rewired to vite. It's very fast, provides good dev UX and supports typescript out of the box.
  • Currently, many types use null to indicate optional fields. This leads to very verbose API usage, as every optional field now needs to be explicitly passed in order for the typecheck to succeed. I suggest changing this to undefined by using the question mark syntax in interfaces. E.g.: indexId: string | null to indexId?: string
  • The search method (and SearchResponse) should probably take a generic param so the results can be typed., signature becomes async search<ResultType>(: SearchRequest): Promise<SearchResponse<ResultType>>
  • Having a builder for queries would be helpful, these can then escape special characters in keys and such.

Contributor guide

Open the contributing guide

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

Start with quickwit-ui/src/services/client.ts and the related models.ts and urls.ts files mentioned in the issue, then inspect how the current UI JavaScript project is organized. Done would mean an agreed, maintainable official NPM package with a defined package structure and API scope; the issue leaves the workspace, build, optional-field, generic-search, and query-builder changes open.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.