WebIDL only describes web spec, what to do about JS builtins?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
In #12 I added some type tests. The biggest issue that they seem to reveal is that we don't see JS builtins. For example, suppose someone uses Object:
from js import Object
Object.fromEntries([("a", 1), ("b", 2)])
This sort of code is pretty common in practice and ideally we'd want to be able to typecheck this. Since it's not in the webidl we'd need to get the info from some other source. Unfortunately that seems like a lot of work...
Some thoughts:
- Maybe there are typescript type definitions that we can use?
- But then maybe those also cover everything in the webidl?
- So maybe what is actually needed is a tool for converting from typescript to mypy?
Contributor guide
No contributing guide indexed for this repository
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 the type tests added in issue #12 and the WebIDL-based definitions discussed here. Investigate how the js.Object example is represented, then review the TypeScript definitions and possible TypeScript-to-mypy approach raised in the issue. Done means there is a decided, tested way to typecheck JavaScript builtins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100