-
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
Update to JavaScriptKit 0.9, add Global
helpers
#3
Conversation
return jsObject.text!().fromJSValue()! | ||
} | ||
|
||
public func arrayBuffer() -> Promise<ArrayBuffer> { | ||
public func arrayBuffer() -> JSPromise<ArrayBuffer, JSError> { |
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.
Can you make this change in webidl2swift
and re-run it to regenerate these files?
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.
Can fix this in webidl2swift
, but I'm not sure if we can rely on it long-term. It's great to provide initial scaffolding, but there's also some generated junk to clean up and manual handling of JSClosure
is still required. I've done some of that manual work in #4.
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.
webidl2swift
changes are now available for review in Apodini/webidl2swift#10.
public extension Document { | ||
var body: HTMLElement { | ||
.init(unsafelyWrapping: jsObject.body.object!) | ||
} | ||
} |
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.
This is defined as a property on the Document
object by the spec (https://html.spec.whatwg.org/#the-document-object:dom-document-body) but the dom.webidl
doesn’t reference it so it isn’t properly generated. I mentioned parsing the HTML spec as a stumbling block earlier but may give it a go.
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.
# Conflicts: # Tests/DOMKitTests/DOMKitTests.swift
Updates JavaScriptKit dependency to upstream 0.9 instead of using a fork as previously. I've updated a few helpers to use non-deprecated names and also added
Global
type andpublic let global = Global()
with a few extensions on DOM types which for some reason don't seem to be declared in WebIDL.Additional
DOMKitDemo
target and product are set up for easy manual test.