Migrating from JSOs to JsInterop

195 views
Skip to first unread message

confile

unread,
Feb 3, 2016, 6:46:57 AM2/3/16
to GWT Contributors
The JsInterop 1.0 document (https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit#heading=h.8hrzc0yupqa5) does not contain an example of how to migrating from JSOs to JsInterop. Could you please give such an example?

Jens

unread,
Feb 3, 2016, 8:05:31 AM2/3/16
to GWT Contributors
Do you have any specific issues by following whats said in the document:

"You can mark each method in a JSO with @JsOverlay (that’s actually what they are) and replace the JSNI by following the instructions above."

So basically JSNI methods will become JsInterop native methods if they directly map to the underlying native JS type (typically these are the one-line JSNI methods). If JSNI methods have some more logic you would convert it to a Java method and mark it with @JsOverlay.

-- J.

confile

unread,
Feb 3, 2016, 8:31:31 AM2/3/16
to GWT Contributors
Hi Jens, 

does the class still have to extend JavaScriptObject?

Jens

unread,
Feb 3, 2016, 9:01:00 AM2/3/16
to GWT Contributors

does the class still have to extend JavaScriptObject?

No. 
Reply all
Reply to author
Forward
0 new messages