[Pas2js] DataSet at the beginning

Michael Van Canneyt michael at freepascal.org
Mon Nov 12 11:59:22 CET 2018



On Sun, 11 Nov 2018, warleyalex via Pas2js wrote:

> While not being a direct answer to the question. These non visual components
> used in the application
>
>    Connection1: TConnection;
>    DataSet1: TDataSet;
>    DataSource1: TWDataSource; 
>
> has increased the JS output file size from 95KB to 260KB. The overhead of
> using such simple components, I don't know I've been thinking it's not a
> good idea to implement such components in pure "pascal" like TMS Web does. I
> ended up spending a decent amount of time trying different things to get
> this work.

TDataset is *not* a simple component. Far from it.

It is one of the most complex components available in Delphi.
That it adds quite some size to your application is therefor normal.

I just checked, the data directory of ExtJS - which provides more or less
the same functionality - is 700k. I suppose it can be reduced somewhat, but
it shows the overall size is of the same order.

You can of course throw together a simple store with very few lines of code,
but it will miss all the functionality of TDataset. Having TDataset available 
was (and IMO is) essential to the success of any component set.

If we can refactor the code so the optimizer can better reduce the program
size, I am all for it.

This does not mean no alternatives should be developed or offered. I'm open for
suggestions which existing javascript libraries to handle data should be made
available first...

Michael.


More information about the Pas2js mailing list