Example of JavaScript source code

16 views
Skip to first unread message

rube...@yahoo.com

unread,
Dec 13, 2017, 1:22:24 AM12/13/17
to CodenameOne Discussions
Hi,

I am interested in passing several apps to JavaScript, but before launching myself to an investment of this type I would like to see what the source code generated in JavaScript is like. Could I have access to the code of any of the demos to make an evaluation?

Thanks

Shai Almog

unread,
Dec 14, 2017, 12:08:55 AM12/14/17
to CodenameOne Discussions
Hi,
pretty much all of our demos have a "javascript" link at the bottom where you can see the result and inspect the generated code/size.

Here's the kitchen sink: https://www.codenameone.com/demos/KitchenSink/

This is the code: https://www.codenameone.com/demos/KitchenSink/teavm/classes.js

Notice that the code file is gzipped when delivered to the browser/device and is around 600kb in real size.

There is also a 31kb (uncompressed) runtime file https://www.codenameone.com/demos/KitchenSink/teavm/runtime.js

The structure is maintained for the other demos but as you can see from the source it's not something you would normally "inspect". The build allows you to generate "pretty" code which would be more readable for debugging.
Reply all
Reply to author
Forward
0 new messages