It would be really convenient to have a code converter that can convert Objective-C / Java code to TypeScript (using the NativeScript's paradigms).
Converting manually larger chunks of Objective-C / Java code is not fun.
That's not really possible or convenient imho. Also why would you rewrite (assuming working) code?
Also, why would you ask this project? Ask the TypeScript people to do this.
For native Java/Objective C calls within NativeScript. Not really connected with TypeScript as a language.
This idea can be further extended by doing a Chrome extension for instance which would allow directly copying NativeScript code from Android/iOS documentation code examples. That would be really convenient.
We discussed this within the team and agreed this is not immediate, not even a long-term priority. Closing for now.
+1 This would be helpful for growing the community that can build NativeScript wrappers around popular iOS/Android libraries.
@toddanglin Why? A code converter doesn't seem necessary given how simple it is to create plugins that wrap Obj-c / Java exposing the same apis to the nativescript runtime.
Well...I don't think it's intuitive to everyone (at least, not without some practice) how you "convert" the ObjC/Java syntax in to the appropriate JavaScript for NativeScript. A converter would be both a helper for that process AND an educational tool to help people learn by example how you map ObjC/Java to {N} JavaScript.
So... 5 years later, trying to do my own plugin. Even got an Egghead subscription for a course on building plugins and I still have no idea how to write this into typescript: https://www.twilio.com/docs/chat/tutorials/chat-application-ios-obj-c
Seems to be a case-by-case basis, watched the course twice, but TwilioChat code seems to have a lot more stuff than the course presents.
Lost days on this and it still feels like I haven't spent one minute on it.
An automated tool that turned Java and Objective-C and/or Swift into TypeScript for a plugin would have been really useful, even if not perfect.
I guess writing plugins is only for those that also know Objective C and Java. Although, one of the main advantages of NativeScript should be to not have to learn that, and to simply use TypeScript/JavaScript.
This would be really helpful. I am stuck for one week now to translate a CoreNFC Objective C code to TypeScript. Do you think that the effort isn't worth it?
Most helpful comment
Well...I don't think it's intuitive to everyone (at least, not without some practice) how you "convert" the ObjC/Java syntax in to the appropriate JavaScript for NativeScript. A converter would be both a helper for that process AND an educational tool to help people learn by example how you map ObjC/Java to {N} JavaScript.