Skip to content

Make format modules independently loadable to bundle only those used #1329

Description

@burdettejm

Currently all formats (jsonLogic, sql, mongodb, spel, elasticSearch, etc.) are statically re-exported from the top-level barrels (modules/export/index.js, modules/import/index.js, modules/utils/index.js), so every format, and its dependencies, ends up in the bundle regardless of which ones an app actually uses.

Most formats are lightweight but spel pulls in spel2js as a transitive dependency, which increases bundle weight for apps that never touch SpEL.

Our preference would be splitting formats into separate optional entry points/sub-packages, similar to how UI frameworks are already split. This would let consumers opt into only the formats they need, consistent with the existing per-framework packaging model, and avoid pulling in format-specific dependencies (like spel2js) they never use.

If interested, would using dynamic import() at the call sites instead make more sense to you, given the existing architecture?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions