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

Add JSBridgedType and JSBridgedClass #26

Merged
merged 26 commits into from
Sep 18, 2020
Merged

Add JSBridgedType and JSBridgedClass #26

merged 26 commits into from
Sep 18, 2020

Conversation

j-f1
Copy link
Member

@j-f1 j-f1 commented Aug 2, 2020

Ref #21.

This allows DOMKit to build, and implements JSBridgedClass on JSError and JSDate.

@j-f1 j-f1 marked this pull request as draft August 2, 2020 21:33
@j-f1 j-f1 force-pushed the webidl branch 2 times, most recently from 8b8ef8f to f08c56c Compare August 3, 2020 19:20
This was referenced Aug 4, 2020
@j-f1 j-f1 force-pushed the webidl branch 2 times, most recently from ab414d7 to 000fe5b Compare August 4, 2020 18:06
@j-f1 j-f1 mentioned this pull request Aug 15, 2020
@j-f1 j-f1 changed the title WebIDL support Add JSBridgedType & JSBridgedClass Sep 15, 2020
@j-f1 j-f1 marked this pull request as ready for review September 15, 2020 14:45
@j-f1 j-f1 changed the title Add JSBridgedType & JSBridgedClass Add JSBridgedType and JSBridgedClass Sep 15, 2020
Sources/JavaScriptKit/JSBridgedType.swift Outdated Show resolved Hide resolved
Sources/JavaScriptKit/Support.swift Outdated Show resolved Hide resolved
Copy link
Member

@kateinoigakukun kateinoigakukun 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 but I added some comments. And please add test cases 🙏

Sources/JavaScriptKit/Support.swift Outdated Show resolved Hide resolved
Sources/JavaScriptKit/JSValueConvertible.swift Outdated Show resolved Hide resolved
Sources/JavaScriptKit/JSValueConvertible.swift Outdated Show resolved Hide resolved
Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift Outdated Show resolved Hide resolved
j-f1 and others added 4 commits September 16, 2020 10:11
Co-Authored-By: Yuta Saito <11702759+kateinoigakukun@users.noreply.github.com>
It’s better to use guard/if-let instead.
@kateinoigakukun
Copy link
Member

Please let me know when it's ready for review again 👍

@@ -0,0 +1,41 @@
/// Use this protocol when your type has no single JavaScript class.
/// For example, a union type of multiple classes or primitive values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this comment give an example of such type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Would it be OK to link to DOMKit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please do 👍

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Fantastic 👏

Just a minor indentation issue, but otherwise LGTM 👍

@j-f1 j-f1 merged commit 702dd89 into swiftwasm:master Sep 18, 2020
@j-f1 j-f1 deleted the webidl branch September 18, 2020 03:17
MaxDesiatov added a commit to Apodini/webidl2swift that referenced this pull request Dec 26, 2020
Pending the merger of swiftwasm/JavaScriptKit#26, everything needed for the output of `webidl2swift` to work will be included in the shipping version of JavaScriptKit! I made several changes to align the APIs and fixed a bug where callback protocols could not be passed as a function.

* Mostly working, except for when it doesn’t

(enums containing objects and primitives)

JavaScriptKit a87af4e

* More changes to get it finished!

* Correctly set the ancestor for callback interfaces

* It works!

* Updates to match latest JSKit

* Fix lint errors

* Last updates for compatibility

* Remove unnecessary fatalError in failable initializer

* Record the file name tokenization errors occurred in

* Address spec update that replaces void with undefined

* Update Parser.swift

* Fixes to asynciterable

* Update Parser.swift

* Update Parser.swift

* Update IntermediateRepresentation.swift

* Sort list of undefined types so it’s stable

* Throw a fatalError when a member type is unimplemented

* Add updates from review

* void → undefined

* Also update the other webidl files

* Re-add void support

* Update Sources/WebIDL/IntermediateRepresentation/Member Nodes/MethodNode.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

Co-authored-by: Max Desiatov <max@desiatov.com>
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.

4 participants