Skip to content

Commit e62fce2

Browse files
authored
fix(admin-ui-plugin): Deprecate compatibilityMode option (#3953)
1 parent e31e4cb commit e62fce2

File tree

9 files changed

+28
-48
lines changed

9 files changed

+28
-48
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Until then, we will continue patching critical bugs and security issues. Communi
1111

1212
**For new projects, use the [React Admin Dashboard](/guides/extending-the-dashboard/getting-started/) instead.**
1313

14-
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.
14+
If you want to use the Admin UI and the Dashboard together, both plugins can now be used simultaneously without any special configuration.
1515
:::
1616

1717
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/).

docs/docs/guides/extending-the-dashboard/deployment/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ export default defineConfig({
5151

5252
### 2. Add DashboardPlugin to Vendure Config
5353

54-
:::warning Angular Admin UI compatibilityMode
55-
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.
54+
:::info Angular Admin UI compatibility
55+
If you want to use the Angular Admin UI and the Dashboard together, both plugins can now be used simultaneously without any special configuration.
5656
:::
5757

58-
5958
Add the DashboardPlugin to your `vendure-config.ts`:
6059

6160
```typescript title="src/vendure-config.ts"

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,7 @@ npx vite
188188

189189
To stop the running dashboard, type `q` and hit enter.
190190

191-
:::warning Compatibility with the legacy Admin UI
191+
:::info Compatibility with the legacy Admin UI
192192
If you still need to run the legacy Angular-based Admin UI in parallel with the Dashboard,
193-
this is totally possible.
194-
195-
You just need to make sure to set the [compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) setting in the
196-
AdminUiPlugin's init options.
197-
198-
```ts
199-
AdminUiPlugin.init({
200-
// ...
201-
// highlight-next-line
202-
compatibilityMode: true,
203-
})
204-
```
193+
this is totally possible. Both plugins can now be used simultaneously without any special configuration.
205194
:::
206-

docs/docs/guides/extending-the-dashboard/migration/index.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@ Community contributions will always be merged and released.
1818
A recommended approach to migrating is to run both the Admin UI _and_ the new Dashboard in parallel. This allows you to start building
1919
new features right away with the new Dashboard while maintaining access to existing features that have not yet been migrated.
2020

21-
To do so, follow the instructions to [set up the Dashboard](/guides/extending-the-dashboard/getting-started/#installation--setup),
22-
and then make sure you set the [AdminUiPlugin compatibilityMode](/reference/core-plugins/admin-ui-plugin/admin-ui-plugin-options#compatibilitymode) option to `true`:
23-
24-
```ts
25-
AdminUiPlugin.init({
26-
// ... existing config
27-
compatibilityMode: true,
28-
}),
29-
```
21+
To do so, follow the instructions to [set up the Dashboard](/guides/extending-the-dashboard/getting-started/#installation--setup).
22+
Both plugins can now be used simultaneously without any special configuration.
3023

3124
## AI-Assisted Migration
3225

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ Allows the contents of the `vendure-ui-config.json` file to be set, e.g.
6363
for specifying the Vendure GraphQL API host, available UI languages, etc.
6464
### compatibilityMode
6565

66-
<MemberInfo kind="property" type={`boolean`} since="3.4.0" />
66+
<MemberInfo kind="property" type={`boolean`} since="3.4.0" />
6767

68-
If you are running the AdminUiPlugin at the same time as the new `DashboardPlugin`, you should
69-
set this to `true` in order to avoid a conflict caused by both plugins defining the same
70-
schema extensions.
68+
:::warning Deprecated
69+
This option is deprecated and no longer has any effect.
7170

71+
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.
72+
:::
7273

7374
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ export const metricsApiExtensions = gql`
3232
}
3333
`;
3434

35-
export function getApiExtensions(compatibilityMode: boolean) {
36-
return compatibilityMode ? undefined : metricsApiExtensions;
35+
export function getApiExtensions() {
36+
return metricsApiExtensions;
3737
}

packages/admin-ui-plugin/src/plugin.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ export interface AdminUiPluginOptions {
7979
adminUiConfig?: Partial<AdminUiConfig>;
8080
/**
8181
* @description
82-
* If you are running the AdminUiPlugin at the same time as the new `DashboardPlugin`, you should
83-
* set this to `true` in order to avoid a conflict caused by both plugins defining the same
84-
* schema extensions.
82+
* @deprecated This option no longer has any effect.
83+
*
84+
* Previously used when running the AdminUiPlugin at the same time as the new `DashboardPlugin`
85+
* to avoid conflicts, but this is no longer necessary as the schemas use different type names.
8586
*
8687
* @since 3.4.0
8788
*/
@@ -146,14 +147,8 @@ export interface AdminUiPluginOptions {
146147
@VendurePlugin({
147148
imports: [PluginCommonModule],
148149
adminApiExtensions: {
149-
schema: () => {
150-
const compatibilityMode = !!AdminUiPlugin.options?.compatibilityMode;
151-
return getApiExtensions(compatibilityMode);
152-
},
153-
resolvers: () => {
154-
const compatibilityMode = !!AdminUiPlugin.options?.compatibilityMode;
155-
return compatibilityMode ? [] : [MetricsResolver];
156-
},
150+
schema: () => getApiExtensions(),
151+
resolvers: () => [MetricsResolver],
157152
},
158153
providers: [MetricsService],
159154
compatibility: '^3.0.0',

packages/dev-server/dev-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export const devConfig: VendureConfig = {
148148
AdminUiPlugin.init({
149149
route: 'admin',
150150
port: 5001,
151-
compatibilityMode: true,
152151
adminUiConfig: {},
153152
// Un-comment to compile a custom admin ui
154153
// app: compileUiExtensions({

packages/dev-server/graphql/graphql-env.d.ts

Lines changed: 8 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)