[Pas2js] LFM-to-PAS on-the-fly

warleyalex warleyalex at yahoo.com.br
Tue Apr 10 00:45:55 CEST 2018


I've watched a TMS Web Core video on youtube, when you compile a
WebApplication, actually you can see an Delphi executable but that
executable is actually do nothing else then something that jumps starts the
browser on the right place.

...desperately, trying to mimic that example, but now using the Lazarus IDE,
I create a video:

https://youtu.be/1Y6JoWUFEXw
-------------------------------

The serialization mechanism (LFM-TO-PAS) comes from the TCompWriterPas
classes, however, before hand, I have to register all forms classes manually
to serialize the .LFM forms (since we have to pass a form instance to
TStreamAsPasForm to create and initialize the components).

The horrible mecanism is not straightforward. There are 2 build modes
(pas2js and win32). The later do nothing else then something like a
precompiler that generates the LFM-2-PAS .inc files definitions.

...just a single little change at the "form" I have to recompile (at win32
mode) the project to convert the LFM-to-PAS, then I have to switch to
(Pas2JS build mode) to generate the app.  :(

to overcome the obstacles, I think then we must create some kinda
precompiler to convert working LFM to build PAS source and then compile
second build PAS source with pas2js in one go. I believe the mecanism to
integrate LFM resource {$R *.lfm} maybe is not a good idea since can add
some overhead in the JS.





--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list