sql-js / sql-js/sql.js

missing docs: web worker

Open
#595 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

The README says

If you don't want to run CPU-intensive SQL queries in your main application thread, you can use the more limited WebWorker API.

It gives a couple examples and caveats, but I need a lot more information to use the feature. I need a list of messages I can pass, what the worker will pass back, and a description of what the limitations are. There's no page on the website or GitHub wiki about this.

Other issues:

  • The docs say to get the file from the releases page, but I'd rather get them from node_modules/sql.js/dist so they get version updates. But someone in this issue said that won't work. This is something that should be covered in a full explanation of how to use web workers.
  • @types/sql.js is missing types for the web worker API.
  • Existing issue caused by these missing docs: https://github.com/sql-js/sql.js/issues/490

Because of these missing docs, for my app I'm going to write my own custom web worker using the normal SQL.js API.

I'll also highlight the proposal to remove the whole web worker API, which would be a way to avoid this whole issue (though you'd still want the docs to have some hints about how/why to write a custom web worker): https://github.com/sql-js/sql.js/issues/377

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 the WebWorker section in README and review the existing worker examples and caveats. Document the messages the worker accepts and returns, its limitations, and whether files from node_modules/sql.js/dist can be used; also cover the missing @types/sql.js worker definitions. Done means users have a complete WebWorker usage explanation on the website or GitHub wiki.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.