Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@red-hat-developer-hub/backstage-plugin-app-defaults': minor
'@red-hat-developer-hub/backstage-plugin-app-react': major
---

Move `appDrawerExtension` and `appDrawerModule` from `app-react` to
`app-defaults`.

- `@red-hat-developer-hub/backstage-plugin-app-defaults` now exports
`appDrawerExtension` and `appDrawerModule` from its main entry point,
and adds a `./app-drawer-module` subpath that default-exports
`appDrawerModule` for Scalprum / module-federation dynamic loading.

- **BREAKING**: `@red-hat-developer-hub/backstage-plugin-app-react` no
longer exports `appDrawerExtension` or `appDrawerModule`. The
`./app-drawer-module` subpath has been removed. Update imports:

```diff
-import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-react';
+import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
```

`AppDrawerContentBlueprint`, `appDrawerContentDataRef`, `useAppDrawer`,
and all drawer types remain in `app-react`.
1 change: 1 addition & 0 deletions workspaces/app-defaults/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@mui/icons-material": "^5.18.0",
"@mui/material": "^5.18.0",
"@red-hat-developer-hub/backstage-plugin-app-auth": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-defaults": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-integrations": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-react": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-global-header": "^1.21.0",
Expand Down
6 changes: 2 additions & 4 deletions workspaces/app-defaults/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ import catalogPlugin from '@backstage/plugin-catalog/alpha';
import scaffolderPlugin from '@backstage/plugin-scaffolder/alpha';
import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth';
import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations';
import {
appDrawerModule,
templateCardModule,
} from '@red-hat-developer-hub/backstage-plugin-app-react';
import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
import { templateCardModule } from '@red-hat-developer-hub/backstage-plugin-app-react';
import {
globalHeaderModule,
globalHeaderTranslationsModule,
Expand Down
5 changes: 5 additions & 0 deletions workspaces/app-defaults/plugins/app-defaults/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"types": "src/index.ts",
"exports": {
".": "./src/index.ts",
"./app-drawer-module": "./src/appDrawerModuleExport.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"app-drawer-module": [
"src/appDrawerModuleExport.ts"
],
"package.json": [
"package.json"
]
Expand Down Expand Up @@ -44,6 +48,7 @@
},
"dependencies": {
"@backstage/frontend-plugin-api": "^0.17.2",
"@backstage/plugin-app-react": "^0.2.4",
"@red-hat-developer-hub/backstage-plugin-app-react": "workspace:^"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## API Report File for "@red-hat-developer-hub/backstage-plugin-app-react"
## API Report File for "@red-hat-developer-hub/backstage-plugin-app-defaults"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

Expand Down
36 changes: 36 additions & 0 deletions workspaces/app-defaults/plugins/app-defaults/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,46 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { AppDrawerContent } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionInput } from '@backstage/frontend-plugin-api';
import { FrontendModule } from '@backstage/frontend-plugin-api';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ReactNode } from 'react';

// @public
const appDefaultsModule: FrontendModule;
export { appDefaultsModule };
export default appDefaultsModule;

// @public
export const appDrawerExtension: OverridableExtensionDefinition<{
config: {};
configInput: {};
output: ExtensionDataRef<
(props: { children: ReactNode }) => JSX.Element | null,
'app.root.wrapper',
{}
>;
inputs: {
drawers: ExtensionInput<
ConfigurableExtensionDataRef<AppDrawerContent, 'app.drawer.content', {}>,
{
singleton: false;
optional: false;
internal: false;
}
>;
};
kind: 'app-root-wrapper';
name: 'drawer';
params: {
Component?: [error: 'Use the `component` parameter instead'];
component: (props: { children: ReactNode }) => JSX.Element | null;
};
}>;

// @public
export const appDrawerModule: FrontendModule;
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
*/

import { createFrontendModule } from '@backstage/frontend-plugin-api';
import {
appDrawerExtension,
templateCardExtension,
} from '@red-hat-developer-hub/backstage-plugin-app-react';
import { templateCardExtension } from '@red-hat-developer-hub/backstage-plugin-app-react';

import { appDrawerExtension } from './appDrawerModule';

/**
* RHDH app module for `pluginId: 'app'`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import {
createFrontendModule,
} from '@backstage/frontend-plugin-api';
import { AppRootWrapperBlueprint } from '@backstage/plugin-app-react';

import { ApplicationDrawer } from '../../legacy/ApplicationDrawer';
import { appDrawerContentDataRef } from './appDrawerContentDataRef';
import { appDrawerContentDataRef } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { ApplicationDrawer } from '@red-hat-developer-hub/backstage-plugin-app-react/legacy';

/**
* Wrapper extension that renders the ApplicationDrawer around the app content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export { appDrawerModule as default } from './drawer';
export { appDrawerModule as default } from './appDrawerModule';
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
*/

export { appDefaultsModule } from './appDefaultsModule';
export { appDrawerExtension, appDrawerModule } from './appDrawerModule';

export { appDefaultsModule as default } from './appDefaultsModule';
4 changes: 0 additions & 4 deletions workspaces/app-defaults/plugins/app-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@
"exports": {
".": "./src/index.ts",
"./legacy": "./src/legacy/index.ts",
"./app-drawer-module": "./src/appDrawerModuleExport.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"legacy": [
"src/legacy/index.ts"
],
"app-drawer-module": [
"src/appDrawerModuleExport.ts"
],
"package.json": [
"package.json"
]
Expand Down
31 changes: 0 additions & 31 deletions workspaces/app-defaults/plugins/app-react/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionInput } from '@backstage/frontend-plugin-api';
import { FrontendModule } from '@backstage/frontend-plugin-api';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ReactNode } from 'react';
import { SwappableComponentRef } from '@backstage/frontend-plugin-api';

// @public
Expand Down Expand Up @@ -71,36 +70,6 @@ export const appDrawerContentDataRef: ConfigurableExtensionDataRef<
{}
>;

// @public
export const appDrawerExtension: OverridableExtensionDefinition<{
config: {};
configInput: {};
output: ExtensionDataRef<
(props: { children: ReactNode }) => JSX.Element | null,
'app.root.wrapper',
{}
>;
inputs: {
drawers: ExtensionInput<
ConfigurableExtensionDataRef<AppDrawerContent, 'app.drawer.content', {}>,
{
singleton: false;
optional: false;
internal: false;
}
>;
};
kind: 'app-root-wrapper';
name: 'drawer';
params: {
Component?: [error: 'Use the `component` parameter instead'];
component: (props: { children: ReactNode }) => JSX.Element | null;
};
}>;

// @public
export const appDrawerModule: FrontendModule;

// @public
export interface ApplicationDrawerProps {
children: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export { DrawerPanel } from '../legacy/DrawerPanel';

export { appDrawerContentDataRef } from './extensions/appDrawerContentDataRef';
export { AppDrawerContentBlueprint } from './extensions/AppDrawerContentBlueprint';
export {
appDrawerExtension,
appDrawerModule,
} from './extensions/appDrawerModule';

export type { ApplicationDrawerProps } from '../legacy/ApplicationDrawer';
export type { DrawerPanelProps } from '../legacy/DrawerPanel';
Expand Down
1 change: 0 additions & 1 deletion workspaces/app-defaults/plugins/app-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

export { AppDrawerContentBlueprint } from './drawer';
export { appDrawerContentDataRef } from './drawer';
export { appDrawerExtension, appDrawerModule } from './drawer';

export { useAppDrawer } from './drawer';
export type { AppDrawerContent, AppDrawerApi } from './drawer';
Expand Down
4 changes: 3 additions & 1 deletion workspaces/app-defaults/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9481,12 +9481,13 @@ __metadata:
languageName: unknown
linkType: soft

"@red-hat-developer-hub/backstage-plugin-app-defaults@workspace:plugins/app-defaults":
"@red-hat-developer-hub/backstage-plugin-app-defaults@workspace:^, @red-hat-developer-hub/backstage-plugin-app-defaults@workspace:plugins/app-defaults":
version: 0.0.0-use.local
resolution: "@red-hat-developer-hub/backstage-plugin-app-defaults@workspace:plugins/app-defaults"
dependencies:
"@backstage/cli": "npm:^0.36.3"
"@backstage/frontend-plugin-api": "npm:^0.17.2"
"@backstage/plugin-app-react": "npm:^0.2.4"
"@backstage/test-utils": "npm:^1.7.19"
"@red-hat-developer-hub/backstage-plugin-app-react": "workspace:^"
"@testing-library/jest-dom": "npm:^6.0.0"
Expand Down Expand Up @@ -14283,6 +14284,7 @@ __metadata:
"@mui/material": "npm:^5.18.0"
"@playwright/test": "npm:1.62.1"
"@red-hat-developer-hub/backstage-plugin-app-auth": "workspace:^"
"@red-hat-developer-hub/backstage-plugin-app-defaults": "workspace:^"
"@red-hat-developer-hub/backstage-plugin-app-integrations": "workspace:^"
"@red-hat-developer-hub/backstage-plugin-app-react": "workspace:^"
"@red-hat-developer-hub/backstage-plugin-global-header": "npm:^1.21.0"
Expand Down
Loading