[Pas2js] Integrate the DFM2PAS serialization in pas2js compiler.

Michael Van Canneyt michael at freepascal.org
Tue Mar 6 13:52:57 CET 2018



On Tue, 6 Mar 2018, Tomislav Avramovic wrote:

> I think this future is best to be part of pas2js!
> WebApp<>BinApp
> Integrate lfm as resource as in Delphi/Lazarus is not necessary 
> complication and add too much code, just to create and initialize some 
> components/controls.
> TMS chose right path dfm2pas (keep it simple).
> If this future is missing in pas2js then we must create 
> precompiler/preprocessor to convert working pas source to build pas 
> source and then compile second build pas source with pas2js.

As I said: such things are the job of an IDE, not of the compiler.
The compiler must compile; no more, no less.

>
> Looking in the generated js code there is a lot of dead code.
> Is there any option or plan to optimize generated code to include only 
> used code?

If you use -O, then there should be no dead code.

The only exception is the rtl.js file, which is currently always included as a whole.

Michael.


More information about the Pas2js mailing list