pyscript / pyscript/docs

webworkers - initial startup helper

Open
#207 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17
Forks
20
PR merge metrics
No merged PRs in 30d

Description

New docs are looking great. 👍
Was looking through webworkers and thought you might want to add a starter function which might be used when the page starts up to pre-initialise the workers so they are ready sooner.

I took this from a prior code version so it probably needs some refining, updating to 2026.1.1, and to be in a function
but something like this could be useful to add

# start workers but no handles to use and have to wait - so use ltk.schedule instead
for el in window.document.querySelectorAll("[type='py'][worker][name]"):
    print("found",el, el.id)
    print(workers, workers.id, workers.name)
    el.onload(ltk.proxy(lambda e: print("loaded",e)))
    print(dir(el))
    await workers[el.getAttribute('name')]

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 by locating the webworkers documentation entry point and comparing the current 2026.1.1 API with the older snippet in this issue. Determine whether a startup helper belongs in the docs and verify that the documented example matches the current worker-loading behavior; done means the intended pre-initialization guidance is current and usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.