matthewmueller/joy

Handwrite DOM API

Open

#81 创建于 2017年12月19日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)Go (34 fork)github user discovery
domhelp wantedimportant

仓库指标

Star
 (1,317 star)
PR 合并指标
 (PR 指标待抓取)

描述

Unfortunately, all the DOM's I've generated thus far (via https://github.com/matthewmueller/joy/blob/master/internal/_dom/main.go) all kind of suck. That's not to say it's impossible to generate a good DOM, just quite difficult.

The problem is that they're way too verbose and the files are huge. I think the solution is to handwrite the DOM, copy and pasting most of the logic from the generated output and just making modifications to improve the API and clean stuff up. For what should be included in this DOM, you can refer to this: https://developer.mozilla.org/en-US/docs/Web/Reference/API

I'd like to have as little cognitive overhead as possible going from the JS DOM API to the Go DOM API, so hopefully we can make it look like this: document.Body.QuerySelector(".test")

You'll also have to be aware of this Go bug: https://github.com/golang/go/issues/22866, so for the circular interfaces, it's a good idea to expand all the interfaces manually until this is fixed.

贡献者指南