Przeglądaj źródła

fix(admin-ui-plugin): Deprecate `compatibilityMode` option (#3953)

gabriellbui 2 miesięcy temu
rodzic
commit
e62fce2756

+ 1 - 1
docs/docs/guides/extending-the-admin-ui/getting-started/index.md

@@ -11,7 +11,7 @@ Until then, we will continue patching critical bugs and security issues. Communi
 
 **For new projects, use the [React Admin Dashboard](/guides/extending-the-dashboard/getting-started/) instead.**
 
-If you want to use the Admin UI and the Dashboard together please change the [compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) to true.
+If you want to use the Admin UI and the Dashboard together, both plugins can now be used simultaneously without any special configuration.
 :::
 
 When creating a plugin, you may wish to extend the Admin UI in order to expose a graphical interface to the plugin's functionality, or to add new functionality to the Admin UI itself. The UI can be extended with custom components written in [Angular](https://angular.io/) or [React](https://react.dev/).

+ 2 - 3
docs/docs/guides/extending-the-dashboard/deployment/index.md

@@ -51,11 +51,10 @@ export default defineConfig({
 
 ### 2. Add DashboardPlugin to Vendure Config
 
-:::warning Angular Admin UI compatibilityMode
-If you want to use the Admin UI and the Dashboard together please change the [compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) to true.
+:::info Angular Admin UI compatibility
+If you want to use the Angular Admin UI and the Dashboard together, both plugins can now be used simultaneously without any special configuration.
 :::
 
-
 Add the DashboardPlugin to your `vendure-config.ts`:
 
 ```typescript title="src/vendure-config.ts"

+ 2 - 14
docs/docs/guides/extending-the-dashboard/getting-started/index.md

@@ -188,19 +188,7 @@ npx vite
 
 To stop the running dashboard, type `q` and hit enter.
 
-:::warning Compatibility with the legacy Admin UI
+:::info Compatibility with the legacy Admin UI
 If you still need to run the legacy Angular-based Admin UI in parallel with the Dashboard,
-this is totally possible.
-
-You just need to make sure to set the [compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) setting in the
-AdminUiPlugin's init options.
-
-```ts
-AdminUiPlugin.init({
-  // ...
-  // highlight-next-line  
-  compatibilityMode: true,  
-})
-```
+this is totally possible. Both plugins can now be used simultaneously without any special configuration.
 :::
-

+ 2 - 9
docs/docs/guides/extending-the-dashboard/migration/index.md

@@ -18,15 +18,8 @@ Community contributions will always be merged and released.
 A recommended approach to migrating is to run both the Admin UI _and_ the new Dashboard in parallel. This allows you to start building
 new features right away with the new Dashboard while maintaining access to existing features that have not yet been migrated.
 
-To do so, follow the instructions to [set up the Dashboard](/guides/extending-the-dashboard/getting-started/#installation--setup),
-and then make sure you set the [AdminUiPlugin compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) option to `true`:
-
-```ts
-AdminUiPlugin.init({
-    // ... existing config
-    compatibilityMode: true,
-}),
-```
+To do so, follow the instructions to [set up the Dashboard](/guides/extending-the-dashboard/getting-started/#installation--setup).
+Both plugins can now be used simultaneously without any special configuration.
 
 ## AI-Assisted Migration
 

+ 5 - 4
docs/docs/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options.md

@@ -63,11 +63,12 @@ Allows the contents of the `vendure-ui-config.json` file to be set, e.g.
 for specifying the Vendure GraphQL API host, available UI languages, etc.
 ### compatibilityMode
 
-<MemberInfo kind="property" type={`boolean`}  since="3.4.0"  />
+<MemberInfo kind="property" type={`boolean`} since="3.4.0" />
 
-If you are running the AdminUiPlugin at the same time as the new `DashboardPlugin`, you should
-set this to `true` in order to avoid a conflict caused by both plugins defining the same
-schema extensions.
+:::warning Deprecated
+This option is deprecated and no longer has any effect.
 
+Previously used when running the AdminUiPlugin at the same time as the new `DashboardPlugin` to avoid conflicts, but this is no longer necessary as the schemas use different type names.
+:::
 
 </div>

+ 2 - 2
packages/admin-ui-plugin/src/api/api-extensions.ts

@@ -32,6 +32,6 @@ export const metricsApiExtensions = gql`
     }
 `;
 
-export function getApiExtensions(compatibilityMode: boolean) {
-    return compatibilityMode ? undefined : metricsApiExtensions;
+export function getApiExtensions() {
+    return metricsApiExtensions;
 }

+ 6 - 11
packages/admin-ui-plugin/src/plugin.ts

@@ -79,9 +79,10 @@ export interface AdminUiPluginOptions {
     adminUiConfig?: Partial<AdminUiConfig>;
     /**
      * @description
-     * If you are running the AdminUiPlugin at the same time as the new `DashboardPlugin`, you should
-     * set this to `true` in order to avoid a conflict caused by both plugins defining the same
-     * schema extensions.
+     * @deprecated This option no longer has any effect.
+     *
+     * Previously used when running the AdminUiPlugin at the same time as the new `DashboardPlugin`
+     * to avoid conflicts, but this is no longer necessary as the schemas use different type names.
      *
      * @since 3.4.0
      */
@@ -146,14 +147,8 @@ export interface AdminUiPluginOptions {
 @VendurePlugin({
     imports: [PluginCommonModule],
     adminApiExtensions: {
-        schema: () => {
-            const compatibilityMode = !!AdminUiPlugin.options?.compatibilityMode;
-            return getApiExtensions(compatibilityMode);
-        },
-        resolvers: () => {
-            const compatibilityMode = !!AdminUiPlugin.options?.compatibilityMode;
-            return compatibilityMode ? [] : [MetricsResolver];
-        },
+        schema: () => getApiExtensions(),
+        resolvers: () => [MetricsResolver],
     },
     providers: [MetricsService],
     compatibility: '^3.0.0',

+ 0 - 1
packages/dev-server/dev-config.ts

@@ -148,7 +148,6 @@ export const devConfig: VendureConfig = {
         AdminUiPlugin.init({
             route: 'admin',
             port: 5001,
-            compatibilityMode: true,
             adminUiConfig: {},
             // Un-comment to compile a custom admin ui
             // app: compileUiExtensions({

Plik diff jest za duży
+ 5 - 0
packages/dev-server/graphql/graphql-env.d.ts


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików