quickwit-oss / quickwit-oss/quickwit
Publish JS client as NPM package
Nobody has claimed this yet.
- 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.tsandurls.tsfiles. - I recommend switching from
yarntopnpm, which also supports workspaces, but is faster thanyarnand provides better dev UX, in my opinion - I recommend switching from
react-app-rewiredtovite. It's very fast, provides good dev UX and supports typescript out of the box. - Currently, many types use
nullto 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 toundefinedby using the question mark syntax in interfaces. E.g.:indexId: string | nulltoindexId?: string - The
searchmethod (andSearchResponse) should probably take a generic param so the results can be typed., signature becomesasync 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
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
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