ampproject / ampproject/worker-dom

FR: Type checking for DOM methods

Open
#370 2 comments 0 reactions 1 assignee Claimed by @kristoferbaxter View on GitHub
API
Dominant language
TypeScript
Stars
3.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Calling something like `el.appendChild('hello')` is invalid and normally throws

```Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.```

In WorkerDOM, however, the error is a lot more ambiguous:

```Uncaught TypeError: t.remove is not a function```

While this is a developer error, it took me a while to figure out what's wrong. I think stronger type checking would help with the developer experience here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.