[Pas2js] Integrate the DFM2PAS serialization in pas2js compiler.

Michael Van Canneyt michael at freepascal.org
Mon Mar 5 23:56:39 CET 2018



On Mon, 5 Mar 2018, warleyalex via Pas2js wrote:

> LFM/DFM-serialization mechanism which Lazarus/Delphi ships with may be pretty
> useful. 
> Let's start from the simple example. 
> As you can see LFM-format is pretty straightforward.
> ----------------------------------------------------------
[snip]
> --------------

It is the same as Delphi.

> I think we have to modify the pascalstream example to include the
> BeginUpdade..EndUpdate block and we serialise the above form into Pascal: 
[snip]
> end;
> ----------------------------------------------------------
> I think the best solution is to integrate this pascalstream/DFM2PAS
> serialization in the pas2js compiler.

I don't think so. This should be part of the IDE. Lazarus already had
exactly such a mechanism in the time of *.lrs files. It should be easy 
enough to resurrect the support for this in the IDE.

But I am planning support for resources, though.

> Each time the project is recompiled, all form units are automatically
> generated. We can just add a directive at the LoadDFMValue method for
> instance:
>
> procedure TForm1.LoadDFMValues;
> begin
>  inherited;
>  {$I 'Form1:impl'}
>
> end;

Agreed that this is one mechanism, but, I think it should be done by the IDE.

Michael.


More information about the Pas2js mailing list