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

feat: add worker related doms #1147

Merged
merged 4 commits into from
Aug 11, 2024
Merged

feat: add worker related doms #1147

merged 4 commits into from
Aug 11, 2024

Conversation

tonyfettes
Copy link

This PR add type definition needed for web worker.

Issue in melange-webapi

Related PR in melange-webapi

@@ -203,6 +209,7 @@ type _htmlVideoElement
type htmlVideoElement = _htmlVideoElement htmlElement_like
type location
type window
type windowProxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need windowProxy? According to MDN it's only available in a "browsing context"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reading the MDN page of MessageEvent.source, and it seems that the source can be one of a WindowProxy, MessagePort or a ServiceWorker, so I added it.

After reading the page you linked above, I think it might be totally fine if we use window for all windowproxy...

Copy link
Member

@anmonteiro anmonteiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just have one question

@tonyfettes tonyfettes marked this pull request as ready for review August 5, 2024 16:38
Comment on lines 23 to 31
type 'a _workerGlobalScope
type 'a workerGlobalScope_like = 'a _workerGlobalScope eventTarget_like
type workerGlobalScope = _baseClass workerGlobalScope_like
type _dedicatedWorkerGlobalScope
type dedicatedWorkerGlobalScope = _dedicatedWorkerGlobalScope workerGlobalScope_like
type _serviceWorkerGlobalScope
type serviceWorkerGlobalScope = _serviceWorkerGlobalScope workerGlobalScope_like
type _sharedWorkerGlobalScope
type sharedWorkerGlobalScope = _sharedWorkerGlobalScope workerGlobalScope_like
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anmonteiro Hi, I add these types since your last review. Could you please take a look at it?

@tonyfettes tonyfettes requested a review from anmonteiro August 5, 2024 16:45
jscomp/others/dom.ml Outdated Show resolved Hide resolved
@anmonteiro anmonteiro merged commit 76faea7 into melange-re:main Aug 11, 2024
0 of 5 checks passed
anmonteiro added a commit that referenced this pull request Aug 11, 2024
anmonteiro added a commit that referenced this pull request Aug 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants