Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x-license] Multiple version support #15998

Open
RahavLussato opened this issue Dec 25, 2024 · 10 comments
Open

[x-license] Multiple version support #15998

RahavLussato opened this issue Dec 25, 2024 · 10 comments
Labels
package: x-license Specific to @mui/x-license. support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ waiting for 👍 Waiting for upvotes

Comments

@RahavLussato
Copy link

RahavLussato commented Dec 25, 2024

The problem in depth

Hello, we renewed our license for MUI X, we got a new key “624ef......”, when I update our mui x data grid pro
we get a placeholder of “MUI X: License key expired” when we use the components.
previously we used @mui/[email protected] and I did an upgrade to "@mui/x-data-grid-pro": "^5.15.0".
when I upgrade to the latest I get "MUI X: Expired package version",
I've tried setting the license using "@mui/x-license" and also "@mui/x-license-pro" which did not work.

Your environment

No response

Search keywords: License key expired

Order ID: 103279

Context

https://mui.zendesk.com/agent/tickets/24626

@RahavLussato RahavLussato added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Dec 25, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Dec 25, 2024
@RahavLussato
Copy link
Author

RahavLussato commented Dec 25, 2024

When debugging the licenseInfo object you can see that although we set it with key "62...", when it tries to get the key for verification it gets a weird key of "65...."

@RahavLussato
Copy link
Author

RahavLussato commented Dec 25, 2024

Screenshot_2024-12-24_at_15_36_16 Screenshot_2024-12-24_at_15_36_57

@RahavLussato
Copy link
Author

for now rolling back to "@mui/x-data-grid-pro": "5.17.5" works.

@oliviertassinari oliviertassinari added package: x-license Specific to @mui/x-license. and removed component: data grid This is the name of the generic UI component, not the React module! labels Dec 25, 2024
@oliviertassinari oliviertassinari removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2024
@oliviertassinari oliviertassinari changed the title [question] Getting "MUI X: License key expired" while using a legit key [x-license] Getting "MUI X: License key expired" while using a legit key Dec 25, 2024
@oliviertassinari
Copy link
Member

Thanks for opening a Zendesk ticket, I propose we continue this thread there https://mui.zendesk.com/agent/tickets/24626, until we find if there is a root cause or not in the code. We will report the solution here for future developers, to continue to build up a knowledge base.


Off-topic. Fun observation on this:

This is bound to fail, one day or another. It won't work if a developer uses two versions of an MUI X component because he's migrating from one to another or adding a new one while not migrating an old one and we changed the way the license key structure (needed one day or another). We only have a few options:

  1. We don't allow progressive migration on the same page. This wouldn't be great. It pretty much feels like the current state of things. Progressively migration isn't truly supported.
  2. We make it so that license key logic is always backward compatible (it's impossible to guarantee to be always future-proof). We have done this so far. This would mean that someone could add a brand new component, by updating @mui/x-license. Now, the problem is that for this to work, we can't simply have this package as a dependency:

"@mui/x-license": "workspace:*",

Hence why we are on 1. Now, we could make changes to make it work is:

  • 2.a When using setLicenseKey() from the component npm package itself, it doesn't use any singleton, it scopes it to local values. If there is any kind of npm package duplication, it stops working. The use case can be micro-frontend or as an escape hatch.
  • 2.b When using setLicenseKey() from the @mui/x-license package, we have a global variable (like today)
  1. A variation of 2. where in 2.b instead of a single global variable, we store the license keys in the global variable based on releaseInfo. This way, we can set multiple of them, and components can retrieve the oldest most recent release info, relative to their own release info.
    This might be overkill. Maybe 1. is just fine, if not 2. 3. is kind of a last resort.

@flaviendelangle
Copy link
Member

We don't allow progressive migration on the same page. This wouldn't be great. It pretty much feels like the current state of things. Progressively migration isn't truly supported.

This is indeed the current state. We started with the grid and never trully removed the singleton.

@oliviertassinari oliviertassinari changed the title [x-license] Getting "MUI X: License key expired" while using a legit key [x-license] Multiple version support Dec 30, 2024
@oliviertassinari oliviertassinari added the waiting for 👍 Waiting for upvotes label Dec 30, 2024
@cherniavskii
Copy link
Member

I believe LicenseInfoProvider is the solution to the singleton issue:

<LicenseInfoProvider info={{ key }}>
<TestComponent />
</LicenseInfoProvider>,

Jan added it for Toolpad's needs, so we never documented it.

@oliviertassinari
Copy link
Member

It's a exposed as unstable. I'm not sure it would help here though. The React context is hosted in a separate package than the component. So people needs to install multiple versions of the license package, which seems hard to figure out which version to install.

@flaviendelangle
Copy link
Member

flaviendelangle commented Jan 1, 2025

The React context is hosted in a separate package than the component. So people needs to install multiple versions of the license package, which seems hard to figure out which version to install.

Or we would need to have all the package the person use be compatible with a shared version of the license package.

I have a side question that I think is related: how do we want to version the license package once we have a MUI X package (that will be in v9, v10 etc...) and a Base UI X package (that will be in v1, v2, etc... if I understand correctly).
Or do we plan to have 2 license packages? One for MUI X and one for Base UI X?

If we need to decouple the version of the license package with the version of the commercial product packages, then maybe we should just avoid BCs at all cost on it.
We would have a @new-company-name/license package that would be in v1 for several years, and the day we absolutely need to update to a v2, we would make sure this v2 is still compatible with as many previous major versions as possible to make sure everybody can always use a single version of the license package.

Not saying that it's ideal of course 😬

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 1, 2025

How do we want to version the license package once we have a MUI X package (that will be in v9, v10, etc...) and a Base UI X package

I think it should be a singular package, from the @newco/x-license npm org space. Separate versions relative to Base UI and MUI. It seemed that it would be the simplest. The rationale:

  • no duplication until we find a strong reason to, one of my general operating principles.
  • aligned with what people want: simplicity of the setup. I think it's almost guaranteed that developers will use Base UI and MUI in their codebase. Take a sample of 100 projects, and it should be already clear that 80%+ already do (though different project names).
  • aim for unified pricing, simpler, also reduce friction around churn (MUI > Base UI is the likely path as the user journey matures).

@flaviendelangle
Copy link
Member

I think it should be a singular package, from the @newco/x-license npm org space

I agree with you

In which case, this package won't automatically have its major version synchronized with the MUI X and Base UI X commercial packages.

This does not solve our pain point automatically of course. To do that we would need to make sure @newco/x-license have very little major and that our commercial packages are compatible with the old and the new major version of @newco/x-license for some time to allow for a smooth migration.

I'm not a fan of introducing a new version synchronization topic but I don't see how to avoid it 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: x-license Specific to @mui/x-license. support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

4 participants