Skip to content

Conversation

@ncamera
Copy link
Collaborator

@ncamera ncamera commented Dec 9, 2024

Changes we propose in this PR:

  • Refactor package distribution to improve code splitting.

    • Some files have been splitted into multiple files to reduce the bundle size when individual library functions. In other words, each feature can now be imported specifically by its path:

      import { getBundles } from "@genexus/mercury/dist/bundles";
      import { getImagePathCallbackDefinitions } from "@genexus/mercury/dist/assets-manager";

      There are still some changes to simplify import paths.

    • This also fixes a side effect where the MERCURY_ASSETS definition could be duplicated in some projects using multiple library functions.

  • Added ESBuild to reduce the size of the JS files.

Breaking changes

  • Mercury assets must now be explicitly set, using the following:

    import { registerMercury } from "@genexus/mercury/dist/register-mercury";
    registerMercury();

    Previously, registration was done as a side effect when importing some library functionality.

@ncamera ncamera added fix Bug fix pull request dependencies Pull requests that update a dependency file mercury Changes related to Mercury design system breaking changes labels Dec 9, 2024
@ncamera ncamera changed the title [mercury] Refactor package distribution to improve code splitting [mercury] Refactor package distribution to improve code splitting and remove code duplication Dec 9, 2024
@ncamera ncamera merged commit 819dda4 into main Dec 9, 2024
3 checks passed
@ncamera ncamera deleted the fix/code-duplication branch December 9, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes dependencies Pull requests that update a dependency file fix Bug fix pull request mercury Changes related to Mercury design system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants