Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 feature: in workers?? #5

Open
domenic opened this issue Apr 10, 2019 · 1 comment
Open

v2 feature: in workers?? #5

domenic opened this issue Apr 10, 2019 · 1 comment

Comments

@domenic
Copy link

domenic commented Apr 10, 2019

It's worth thinking a bit about how we could extend the JS APIs in the future to work in workers. Obviously they don't work as-is because we don't have Node and friends.

What would be ideal here is convincing ourselves either that:

  • The current API is basically compatible with being put in workers, if we solve the underlying issues around DOM trees. (For example, if we had an opaque WorkerNode type which could only be used via a worker version of DOMWritable.)

  • A worker-based API is so different that it doesn't impact this API much at all. For example, it would be primarily string-based.

I'm not sure how much closure we'll get here, but it's worth considering and giving a good think.

@jakearchibald
Copy link
Owner

We could replace Node with { tagName: string, attrs: Map }. The tricky bit is how to reference nodes which appear in the stream twice. One way would be to make the object ===, but you'd lose that if you transfer the stream, which might be a gotcha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants