You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-07-30 08:43:13 +03:00
Bump @matrix-org/react-sdk-module-api from 1.0.0 to 2.0.0 (#25986)
This commit is contained in:
@ -185,9 +185,20 @@ function getModuleApiVersionFor(moduleName: string): string {
|
||||
return findDepVersionInPackageJson(moduleApiDepName, pkgJsonStr);
|
||||
}
|
||||
|
||||
// A list of Module API versions that are supported in addition to the currently installed one
|
||||
// defined in the package.json. This is necessary because semantic versioning is applied to both
|
||||
// the Module-side surface of the API and the Client-side surface of the API. So breaking changes
|
||||
// in the Client-side surface lead to a major bump even though the Module-side surface stays
|
||||
// compatible. We aim to not break the Module-side surface so we maintain a list of compatible
|
||||
// older versions.
|
||||
const backwardsCompatibleMajorVersions = ["1.0.0"];
|
||||
|
||||
function isModuleVersionCompatible(ourApiVersion: string, moduleApiVersion: string): boolean {
|
||||
if (!moduleApiVersion) return false;
|
||||
return semver.satisfies(ourApiVersion, moduleApiVersion);
|
||||
return (
|
||||
semver.satisfies(ourApiVersion, moduleApiVersion) ||
|
||||
backwardsCompatibleMajorVersions.some((version) => semver.satisfies(version, moduleApiVersion))
|
||||
);
|
||||
}
|
||||
|
||||
function writeModulesTs(content: string): void {
|
||||
|
Reference in New Issue
Block a user