#1 2014-09-26 09:09:08

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Generating JavaScript Client?

Hi Arnaud,

Let's say we have some interface-based services, what would be the best way to wrap them into several JavaScript classes which can be run in the web browsers? From your blog post I see you can generate clients for SmartMobileStuidio using the Mustache template engine, is it possible (or how hard) to do that also for JS?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2014-09-26 09:43:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Generating JavaScript Client?

Yes it would be possible.
But we would need a little help here, perhaps starting from existing shared JavaScript library, as available in this forum.
To support all data types and possibilities of the client, it may be some huge amount of work.

Another option may be to use the free command line compiler of SMS, which generated optimized JavaScript.

Offline

#3 2014-09-27 14:54:16

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Generating JavaScript Client?

Not sure the readibility of the js code generated yb SMS's compiler, but that seems interesting.

If I'd ever done any research/works into this field, I'll share it in the forum.

Last edited by edwinsn (2014-09-27 14:54:30)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2014-09-28 01:07:29

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Generating JavaScript Client?

I created a small Banking account test application and I use Smart command line compiler to generate JS code. Take a look at http://forums.smartmobilestudio.com/ind … -compiler/
I pretty sure you can use the mORMOt wrapper to generate smartmobilestudio classes and then use smsc to generate pure javascript code.

Offline

#5 2014-09-28 10:21:02

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Generating JavaScript Client?

Thanks for the info warleyalex.

I did a look at SmartMobileStudio.pas.mustache, looks like it can also generate SMS code for interface-based services, right? Anybody can confirm?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB