changesets: updated changesets to use withDefaults
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/dev-utils': patch
|
||||
---
|
||||
|
||||
Migrated to explicit passing of components to `createApp`.
|
||||
Migrated to using `withDefaults` to pass defaults to `createApp`.
|
||||
|
||||
@@ -2,32 +2,21 @@
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Migrated the app template to pass on explicit `components` to the `createApp` options, as not doing this has been deprecated and will need to be done in the future.
|
||||
Migrated the app template use the new `withDefaults` to construct the `createApp` options, as not doing this has been deprecated and will need to be done in the future.
|
||||
|
||||
To migrate an existing application, make the following change to `packages/app/src/App.tsx`:
|
||||
|
||||
```diff
|
||||
+import { defaultAppComponents } from '@backstage/core-components';
|
||||
+import { withDefaults } from '@backstage/core-components';
|
||||
|
||||
// ...
|
||||
|
||||
const app = createApp({
|
||||
-const app = createApp({
|
||||
+const app = createApp(withDefaults({
|
||||
apis,
|
||||
+ components: defaultAppComponents(),
|
||||
bindRoutes({ bind }) {
|
||||
```
|
||||
|
||||
If you already supply custom app components, you can use the following:
|
||||
|
||||
```diff
|
||||
|
||||
// ...
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
+ components: {
|
||||
...defaultAppComponents(),
|
||||
+ Progress: MyCustomProgressComponent,
|
||||
...
|
||||
},
|
||||
bindRoutes({ bind }) {
|
||||
-});
|
||||
+}));
|
||||
```
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Added a new `defaultAppComponents` method that creates a minimal set of components to pass on to `createApp` from `@backstage/core-app-api`.
|
||||
Added a new `withDefaults` method that accepts a set of `AppOptions` and add the default components, themes and icons. It is intended to be used together with `createApp` from `@backstage/core-app-api` like this: `createApp(withDefaults({ ... }))`.
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
'@backstage/core-app-api': patch
|
||||
---
|
||||
|
||||
Deprecated the defaulting of the `components` options of `createApp`, meaning it will become required in the future. When not passing the required components options a deprecation warning is currently logged, and it will become required in a future release.
|
||||
Deprecated the defaulting of the `components`, `icons` and `themes` options of `createApp`, meaning it will become required in the future. When not passing the required options a deprecation warning is currently logged, and they will become required in a future release.
|
||||
|
||||
The keep the existing components intact, migrate to using `defaultAppComponents` from `@backstage/core-components`:
|
||||
The keep using the default set of options, migrate to using `withDefaults` from `@backstage/core-components`:
|
||||
|
||||
```ts
|
||||
const app = createApp({
|
||||
components: {
|
||||
...defaultAppComponents(),
|
||||
// Place any custom components here
|
||||
},
|
||||
});
|
||||
const app = createApp(
|
||||
withDefaults({
|
||||
// ...
|
||||
}),
|
||||
);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user