Skip to content

[x-license] Improve license key organization logic #9346

@oliviertassinari

Description

@oliviertassinari

Summary 💡

@mui/x-license-pro includes the generate license logic, and exposes it https://bundlephobia.com/package/@mui/x-license-pro. This is hosted here: https://github.com/mui/mui-x/tree/master/packages/x-license-pro/src/generateLicense. It could be nice to isolate it for the sake of optimizing the bundle size. It's less tree shaking work for the bundler to do, and a smaller bundle in dev mode. To note that we depend on it in https://github.com/mui/mui-private/blob/a23043d680d5e0d884fb78af74b653c1ca89071d/tools-private/toolpad/components/licenseGenerator.tsx#L4.

To consider if there is value at hiding the license key generator from a sales perspective but I don't buy it. We target enterprises, they won't take this type of legal risk.

As a side note, working on this would also be a great opportunity to remove the logic duplication with: https://github.com/mui/mui-private/blob/a23043d680d5e0d884fb78af74b653c1ca89071d/tools-private/toolpad/components/licenseDecoder.tsx.

The solution might be as simple as keeping the logic in the npm package but to isolate it into its own non exposed subfolder. Otherwise, a different npm package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: x-licenseChanges related to @mui/x-license.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions