MichaelKim / ag-grid-svelte

A Svelte wrapper for ag-grid
https://ag-grid-svelte.michael.kim/guide
MIT License
54 stars 15 forks source link

Ag-Grid Enterprise - Compress #13

Open jorgelaranjo opened 1 year ago

jorgelaranjo commented 1 year ago

How can one use this approach ( https://blog.ag-grid.com/minimising-bundle-size/#how-to-minimise-your-bundle-size ) with ag-grid-svelte to minize the size used with ag-grid lib as it may go to 2.6MB which is excessive most times, if we don't use all features.

using

<script context="module">
    import { LicenseManager } from '@ag-grid-enterprise/core';
    import { ModuleRegistry } from '@ag-grid-community/core';
    import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';

    ModuleRegistry.registerModules([ServerSideRowModelModule]);
</script>

still results on

AG Grid: unable to use rowModelType = 'serverSide' as the ServerSideRowModelModule is not registered. Check if you have registered the module:

    import { ModuleRegistry } from '@ag-grid-community/core';
    import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';

    ModuleRegistry.registerModules([ ServerSideRowModelModule ]);

For more info see: https://www.ag-grid.com/javascript-grid/modules/

The saving were also not very large, 500KB at best I reckon.