-
Notifications
You must be signed in to change notification settings - Fork 8
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 api #19
base: master
Are you sure you want to change the base?
Conversation
[@mel.get] external origin: t => string = "origin"; | ||
[@mel.get] external lastEventId: t => string = "lastEventId"; | ||
[@mel.get] external source: t => [@mel.unwrap] [ | `MessagePort(Dom.messagePort) | `ServiceWorker(Dom.serviceWorker) ] = "source"; | ||
[@mel.get] external ports: t => Js.Array.t(Dom.messagePort) = "ports"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use array
instead of Js.Array.t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but how is that different? I went to its definition and found out that 'a t = 'a array
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's equivalent indeed
|
||
include Webapi__Dom__Types; | ||
|
||
external window: Dom.window = "window"; | ||
external dedicatedWorkerGlobalScope: Dom.dedicatedWorkerGlobalScope = "self"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davesnx Is it better to have a globalThis
here? Like
external globalThis: 'a = "globalThis"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should add globalThis
@davesnx can you please re-run the job for me? The upstream PR is merged and I believed these runs can succeed now. |
Done |
This PR adds Web Worker DOM bindings.
This PR should be used with PR #1147 in melange.
Fix #18