@backstage/frontend-defaults 0.3.0-next.2 → 0.3.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/createApp.esm.js +7 -8
- package/dist/createApp.esm.js.map +1 -1
- package/dist/discovery.esm.js +4 -9
- package/dist/discovery.esm.js.map +1 -1
- package/dist/index.d.ts +45 -11
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @backstage/frontend-defaults
|
|
2
2
|
|
|
3
|
+
## 0.3.0-next.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5e12252: **BREAKING**: Restructured some of option fields of `createApp` and `createSpecializedApp`.
|
|
8
|
+
|
|
9
|
+
- For `createApp`, all option fields _except_ `features` and `bindRoutes` have been moved into a new `advanced` object field.
|
|
10
|
+
- For `createSpecializedApp`, all option fields _except_ `features`, `config`, and `bindRoutes` have been moved into a new `advanced` object field.
|
|
11
|
+
|
|
12
|
+
This helps highlight that some options are meant to rarely be needed or used, and simplifies the usage of those options that are almost always required.
|
|
13
|
+
|
|
14
|
+
As an example, if you used to supply a custom config loader, you would update your code as follows:
|
|
15
|
+
|
|
16
|
+
```diff
|
|
17
|
+
createApp({
|
|
18
|
+
features: [...],
|
|
19
|
+
- configLoader: new MyCustomLoader(),
|
|
20
|
+
+ advanced: {
|
|
21
|
+
+ configLoader: new MyCustomLoader(),
|
|
22
|
+
+ },
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 8b1bf6e: Deprecated new frontend system config setting `app.experimental.packages` to just `app.packages`. The old config will continue working for the time being, but may be removed in a future release.
|
|
29
|
+
- e5a0a99: **BREAKING**: The `loadingComponent` option has been renamed to `loadingElement`, which is now found under `advanced.loadingElement`. The default loading element has also been switched to `<Progress />` from `@backstage/core-components`. This is of course an improvement over the previous `"Loading..."` text, but also helps prevent flicker when the app loading is fast.
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
- @backstage/plugin-app@0.2.0-next.2
|
|
32
|
+
- @backstage/frontend-plugin-api@0.11.0-next.2
|
|
33
|
+
- @backstage/frontend-app-api@0.12.0-next.3
|
|
34
|
+
- @backstage/core-components@0.17.5-next.2
|
|
35
|
+
|
|
3
36
|
## 0.3.0-next.2
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
package/dist/createApp.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { lazy, Suspense } from 'react';
|
|
3
3
|
import { coreExtensionData } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { Progress } from '@backstage/core-components';
|
|
4
5
|
import { defaultConfigLoaderSync } from './core-app-api/src/app/defaultConfigLoader.esm.js';
|
|
5
6
|
import { overrideBaseUrlConfigs } from './core-app-api/src/app/overrideBaseUrlConfigs.esm.js';
|
|
6
7
|
import { ConfigReader } from '@backstage/config';
|
|
@@ -10,12 +11,12 @@ import { discoverAvailableFeatures } from './discovery.esm.js';
|
|
|
10
11
|
import { resolveAsyncFeatures } from './resolution.esm.js';
|
|
11
12
|
|
|
12
13
|
function createApp(options) {
|
|
13
|
-
let suspenseFallback = options?.
|
|
14
|
+
let suspenseFallback = options?.advanced?.loadingElement;
|
|
14
15
|
if (suspenseFallback === void 0) {
|
|
15
|
-
suspenseFallback =
|
|
16
|
+
suspenseFallback = /* @__PURE__ */ jsx(Progress, {});
|
|
16
17
|
}
|
|
17
18
|
async function appLoader() {
|
|
18
|
-
const config = await options?.configLoader?.().then((c) => c.config) ?? ConfigReader.fromConfigs(
|
|
19
|
+
const config = await options?.advanced?.configLoader?.().then((c) => c.config) ?? ConfigReader.fromConfigs(
|
|
19
20
|
overrideBaseUrlConfigs(defaultConfigLoaderSync())
|
|
20
21
|
);
|
|
21
22
|
const { features: discoveredFeaturesAndLoaders } = discoverAvailableFeatures(config);
|
|
@@ -24,21 +25,19 @@ function createApp(options) {
|
|
|
24
25
|
features: [...discoveredFeaturesAndLoaders, ...options?.features ?? []]
|
|
25
26
|
});
|
|
26
27
|
const app = createSpecializedApp({
|
|
27
|
-
config,
|
|
28
28
|
features: [appPlugin, ...loadedFeatures],
|
|
29
|
+
config,
|
|
29
30
|
bindRoutes: options?.bindRoutes,
|
|
30
|
-
|
|
31
|
-
pluginInfoResolver: options?.pluginInfoResolver,
|
|
32
|
-
flags: options?.flags
|
|
31
|
+
advanced: options?.advanced
|
|
33
32
|
});
|
|
34
33
|
const rootEl = app.tree.root.instance.getData(
|
|
35
34
|
coreExtensionData.reactElement
|
|
36
35
|
);
|
|
37
36
|
return { default: () => rootEl };
|
|
38
37
|
}
|
|
38
|
+
const LazyApp = lazy(appLoader);
|
|
39
39
|
return {
|
|
40
40
|
createRoot() {
|
|
41
|
-
const LazyApp = lazy(appLoader);
|
|
42
41
|
return /* @__PURE__ */ jsx(Suspense, { fallback: suspenseFallback, children: /* @__PURE__ */ jsx(LazyApp, {}) });
|
|
43
42
|
}
|
|
44
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.esm.js","sources":["../src/createApp.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JSX, lazy, ReactNode, Suspense } from 'react';\nimport {\n ConfigApi,\n coreExtensionData,\n ExtensionFactoryMiddleware,\n FrontendFeature,\n FrontendFeatureLoader,\n} from '@backstage/frontend-plugin-api';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { defaultConfigLoaderSync } from '../../core-app-api/src/app/defaultConfigLoader';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { overrideBaseUrlConfigs } from '../../core-app-api/src/app/overrideBaseUrlConfigs';\nimport { ConfigReader } from '@backstage/config';\nimport {\n CreateAppRouteBinder,\n createSpecializedApp,\n FrontendPluginInfoResolver,\n} from '@backstage/frontend-app-api';\nimport appPlugin from '@backstage/plugin-app';\nimport { discoverAvailableFeatures } from './discovery';\nimport { resolveAsyncFeatures } from './resolution';\n\n/**\n * Options for {@link createApp}.\n *\n * @public\n */\nexport interface CreateAppOptions {\n features?: (FrontendFeature | FrontendFeatureLoader)[];\n
|
|
1
|
+
{"version":3,"file":"createApp.esm.js","sources":["../src/createApp.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JSX, lazy, ReactNode, Suspense } from 'react';\nimport {\n ConfigApi,\n coreExtensionData,\n ExtensionFactoryMiddleware,\n FrontendFeature,\n FrontendFeatureLoader,\n} from '@backstage/frontend-plugin-api';\nimport { Progress } from '@backstage/core-components';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { defaultConfigLoaderSync } from '../../core-app-api/src/app/defaultConfigLoader';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { overrideBaseUrlConfigs } from '../../core-app-api/src/app/overrideBaseUrlConfigs';\nimport { ConfigReader } from '@backstage/config';\nimport {\n CreateAppRouteBinder,\n createSpecializedApp,\n FrontendPluginInfoResolver,\n} from '@backstage/frontend-app-api';\nimport appPlugin from '@backstage/plugin-app';\nimport { discoverAvailableFeatures } from './discovery';\nimport { resolveAsyncFeatures } from './resolution';\n\n/**\n * Options for {@link createApp}.\n *\n * @public\n */\nexport interface CreateAppOptions {\n /**\n * The list of features to load.\n */\n features?: (FrontendFeature | FrontendFeatureLoader)[];\n\n /**\n * Allows for the binding of plugins' external route refs within the app.\n */\n bindRoutes?(context: { bind: CreateAppRouteBinder }): void;\n\n /**\n * Advanced, more rarely used options.\n */\n advanced?: {\n /**\n * If set to true, the system will silently accept and move on if\n * encountering config for extensions that do not exist. The default is to\n * reject such config to help catch simple mistakes.\n *\n * This flag can be useful in some scenarios where you have a dynamic set of\n * extensions enabled at different times, but also increases the risk of\n * accidentally missing e.g. simple typos in your config.\n */\n allowUnknownExtensionConfig?: boolean;\n\n /**\n * Sets a custom config loader, replacing the builtin one.\n *\n * This can be used e.g. if you have the need to source config out of custom\n * storages.\n */\n configLoader?: () => Promise<{ config: ConfigApi }>;\n\n /**\n * Applies one or more middleware on every extension, as they are added to\n * the application.\n *\n * This is an advanced use case for modifying extension data on the fly as\n * it gets emitted by extensions being instantiated.\n */\n extensionFactoryMiddleware?:\n | ExtensionFactoryMiddleware\n | ExtensionFactoryMiddleware[];\n\n /**\n * The element to render while loading the app (waiting for config, features, etc).\n *\n * This is the `<Progress />` component from `@backstage/core-components` by default.\n * If set to `null` then no loading fallback element is rendered at all.\n */\n loadingElement?: ReactNode;\n\n /**\n * Allows for customizing how plugin info is retrieved.\n */\n pluginInfoResolver?: FrontendPluginInfoResolver;\n };\n}\n\n/**\n * Creates a new Backstage frontend app instance. See https://backstage.io/docs/frontend-system/building-apps/index\n *\n * @public\n */\nexport function createApp(options?: CreateAppOptions): {\n createRoot(): JSX.Element;\n} {\n let suspenseFallback = options?.advanced?.loadingElement;\n if (suspenseFallback === undefined) {\n suspenseFallback = <Progress />;\n }\n\n async function appLoader() {\n const config =\n (await options?.advanced?.configLoader?.().then(c => c.config)) ??\n ConfigReader.fromConfigs(\n overrideBaseUrlConfigs(defaultConfigLoaderSync()),\n );\n\n const { features: discoveredFeaturesAndLoaders } =\n discoverAvailableFeatures(config);\n const { features: loadedFeatures } = await resolveAsyncFeatures({\n config,\n features: [...discoveredFeaturesAndLoaders, ...(options?.features ?? [])],\n });\n\n const app = createSpecializedApp({\n features: [appPlugin, ...loadedFeatures],\n config,\n bindRoutes: options?.bindRoutes,\n advanced: options?.advanced,\n });\n\n const rootEl = app.tree.root.instance!.getData(\n coreExtensionData.reactElement,\n );\n\n return { default: () => rootEl };\n }\n\n const LazyApp = lazy(appLoader);\n\n return {\n createRoot() {\n return (\n <Suspense fallback={suspenseFallback}>\n <LazyApp />\n </Suspense>\n );\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AA6GO,SAAS,UAAU,OAExB,EAAA;AACA,EAAI,IAAA,gBAAA,GAAmB,SAAS,QAAU,EAAA,cAAA;AAC1C,EAAA,IAAI,qBAAqB,KAAW,CAAA,EAAA;AAClC,IAAA,gBAAA,uBAAoB,QAAS,EAAA,EAAA,CAAA;AAAA;AAG/B,EAAA,eAAe,SAAY,GAAA;AACzB,IAAM,MAAA,MAAA,GACH,MAAM,OAAA,EAAS,QAAU,EAAA,YAAA,IAAiB,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,MAAM,CAAA,IAC7D,YAAa,CAAA,WAAA;AAAA,MACX,sBAAA,CAAuB,yBAAyB;AAAA,KAClD;AAEF,IAAA,MAAM,EAAE,QAAA,EAAU,4BAA6B,EAAA,GAC7C,0BAA0B,MAAM,CAAA;AAClC,IAAA,MAAM,EAAE,QAAA,EAAU,cAAe,EAAA,GAAI,MAAM,oBAAqB,CAAA;AAAA,MAC9D,MAAA;AAAA,MACA,QAAA,EAAU,CAAC,GAAG,4BAAA,EAA8B,GAAI,OAAS,EAAA,QAAA,IAAY,EAAG;AAAA,KACzE,CAAA;AAED,IAAA,MAAM,MAAM,oBAAqB,CAAA;AAAA,MAC/B,QAAU,EAAA,CAAC,SAAW,EAAA,GAAG,cAAc,CAAA;AAAA,MACvC,MAAA;AAAA,MACA,YAAY,OAAS,EAAA,UAAA;AAAA,MACrB,UAAU,OAAS,EAAA;AAAA,KACpB,CAAA;AAED,IAAA,MAAM,MAAS,GAAA,GAAA,CAAI,IAAK,CAAA,IAAA,CAAK,QAAU,CAAA,OAAA;AAAA,MACrC,iBAAkB,CAAA;AAAA,KACpB;AAEA,IAAO,OAAA,EAAE,OAAS,EAAA,MAAM,MAAO,EAAA;AAAA;AAGjC,EAAM,MAAA,OAAA,GAAU,KAAK,SAAS,CAAA;AAE9B,EAAO,OAAA;AAAA,IACL,UAAa,GAAA;AACX,MAAA,2BACG,QAAS,EAAA,EAAA,QAAA,EAAU,gBAClB,EAAA,QAAA,kBAAA,GAAA,CAAC,WAAQ,CACX,EAAA,CAAA;AAAA;AAEJ,GACF;AACF;;;;"}
|
package/dist/discovery.esm.js
CHANGED
|
@@ -2,27 +2,22 @@ import { ConfigReader } from '@backstage/config';
|
|
|
2
2
|
import { isBackstageFeatureLoader } from './resolution.esm.js';
|
|
3
3
|
|
|
4
4
|
function readPackageDetectionConfig(config) {
|
|
5
|
-
const packages = config.getOptional("app.experimental.packages");
|
|
5
|
+
const packages = config.getOptional("app.packages") ?? config.getOptional("app.experimental.packages");
|
|
6
6
|
if (packages === void 0 || packages === null) {
|
|
7
7
|
return void 0;
|
|
8
8
|
}
|
|
9
9
|
if (typeof packages === "string") {
|
|
10
10
|
if (packages !== "all") {
|
|
11
11
|
throw new Error(
|
|
12
|
-
`Invalid app.
|
|
12
|
+
`Invalid app.packages mode, got '${packages}', expected 'all'`
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
return {};
|
|
16
16
|
}
|
|
17
17
|
if (typeof packages !== "object" || Array.isArray(packages)) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
"Invalid config at 'app.experimental.packages', expected object"
|
|
20
|
-
);
|
|
18
|
+
throw new Error("Invalid config at 'app.packages', expected object");
|
|
21
19
|
}
|
|
22
|
-
const packagesConfig = new ConfigReader(
|
|
23
|
-
packages,
|
|
24
|
-
"app.experimental.packages"
|
|
25
|
-
);
|
|
20
|
+
const packagesConfig = new ConfigReader(packages, "app.packages");
|
|
26
21
|
return {
|
|
27
22
|
include: packagesConfig.getOptionalStringArray("include"),
|
|
28
23
|
exclude: packagesConfig.getOptionalStringArray("exclude")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.esm.js","sources":["../src/discovery.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config, ConfigReader } from '@backstage/config';\nimport {\n FrontendFeature,\n FrontendFeatureLoader,\n} from '@backstage/frontend-plugin-api';\nimport { isBackstageFeatureLoader } from './resolution';\n\ninterface DiscoveryGlobal {\n modules: Array<{ name: string; export?: string; default: unknown }>;\n}\n\nfunction readPackageDetectionConfig(config: Config) {\n const packages
|
|
1
|
+
{"version":3,"file":"discovery.esm.js","sources":["../src/discovery.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config, ConfigReader } from '@backstage/config';\nimport {\n FrontendFeature,\n FrontendFeatureLoader,\n} from '@backstage/frontend-plugin-api';\nimport { isBackstageFeatureLoader } from './resolution';\n\ninterface DiscoveryGlobal {\n modules: Array<{ name: string; export?: string; default: unknown }>;\n}\n\nfunction readPackageDetectionConfig(config: Config) {\n // The experimental key is deprecated, but supported still for backwards compatibility\n const packages =\n config.getOptional('app.packages') ??\n config.getOptional('app.experimental.packages');\n if (packages === undefined || packages === null) {\n return undefined;\n }\n\n if (typeof packages === 'string') {\n if (packages !== 'all') {\n throw new Error(\n `Invalid app.packages mode, got '${packages}', expected 'all'`,\n );\n }\n return {};\n }\n\n if (typeof packages !== 'object' || Array.isArray(packages)) {\n throw new Error(\"Invalid config at 'app.packages', expected object\");\n }\n const packagesConfig = new ConfigReader(packages, 'app.packages');\n\n return {\n include: packagesConfig.getOptionalStringArray('include'),\n exclude: packagesConfig.getOptionalStringArray('exclude'),\n };\n}\n\n/**\n * @public\n */\nexport function discoverAvailableFeatures(config: Config): {\n features: (FrontendFeature | FrontendFeatureLoader)[];\n} {\n const discovered = (\n window as { '__@backstage/discovered__'?: DiscoveryGlobal }\n )['__@backstage/discovered__'];\n\n const detection = readPackageDetectionConfig(config);\n if (!detection) {\n return { features: [] };\n }\n\n return {\n features:\n discovered?.modules\n .filter(({ name }) => {\n if (detection.exclude?.includes(name)) {\n return false;\n }\n if (detection.include && !detection.include.includes(name)) {\n return false;\n }\n return true;\n })\n .map(m => m.default)\n .filter(isFeatureOrLoader) ?? [],\n };\n}\n\nfunction isBackstageFeature(obj: unknown): obj is FrontendFeature {\n if (obj !== null && typeof obj === 'object' && '$$type' in obj) {\n return (\n obj.$$type === '@backstage/FrontendPlugin' ||\n obj.$$type === '@backstage/FrontendModule'\n );\n }\n return false;\n}\n\nfunction isFeatureOrLoader(\n obj: unknown,\n): obj is FrontendFeature | FrontendFeatureLoader {\n return isBackstageFeature(obj) || isBackstageFeatureLoader(obj);\n}\n"],"names":[],"mappings":";;;AA2BA,SAAS,2BAA2B,MAAgB,EAAA;AAElD,EAAA,MAAM,WACJ,MAAO,CAAA,WAAA,CAAY,cAAc,CACjC,IAAA,MAAA,CAAO,YAAY,2BAA2B,CAAA;AAChD,EAAI,IAAA,QAAA,KAAa,KAAa,CAAA,IAAA,QAAA,KAAa,IAAM,EAAA;AAC/C,IAAO,OAAA,KAAA,CAAA;AAAA;AAGT,EAAI,IAAA,OAAO,aAAa,QAAU,EAAA;AAChC,IAAA,IAAI,aAAa,KAAO,EAAA;AACtB,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,mCAAmC,QAAQ,CAAA,iBAAA;AAAA,OAC7C;AAAA;AAEF,IAAA,OAAO,EAAC;AAAA;AAGV,EAAA,IAAI,OAAO,QAAa,KAAA,QAAA,IAAY,KAAM,CAAA,OAAA,CAAQ,QAAQ,CAAG,EAAA;AAC3D,IAAM,MAAA,IAAI,MAAM,mDAAmD,CAAA;AAAA;AAErE,EAAA,MAAM,cAAiB,GAAA,IAAI,YAAa,CAAA,QAAA,EAAU,cAAc,CAAA;AAEhE,EAAO,OAAA;AAAA,IACL,OAAA,EAAS,cAAe,CAAA,sBAAA,CAAuB,SAAS,CAAA;AAAA,IACxD,OAAA,EAAS,cAAe,CAAA,sBAAA,CAAuB,SAAS;AAAA,GAC1D;AACF;AAKO,SAAS,0BAA0B,MAExC,EAAA;AACA,EAAM,MAAA,UAAA,GACJ,OACA,2BAA2B,CAAA;AAE7B,EAAM,MAAA,SAAA,GAAY,2BAA2B,MAAM,CAAA;AACnD,EAAA,IAAI,CAAC,SAAW,EAAA;AACd,IAAO,OAAA,EAAE,QAAU,EAAA,EAAG,EAAA;AAAA;AAGxB,EAAO,OAAA;AAAA,IACL,UACE,UAAY,EAAA,OAAA,CACT,OAAO,CAAC,EAAE,MAAW,KAAA;AACpB,MAAA,IAAI,SAAU,CAAA,OAAA,EAAS,QAAS,CAAA,IAAI,CAAG,EAAA;AACrC,QAAO,OAAA,KAAA;AAAA;AAET,MAAA,IAAI,UAAU,OAAW,IAAA,CAAC,UAAU,OAAQ,CAAA,QAAA,CAAS,IAAI,CAAG,EAAA;AAC1D,QAAO,OAAA,KAAA;AAAA;AAET,MAAO,OAAA,IAAA;AAAA,KACR,CACA,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,OAAO,CAClB,CAAA,MAAA,CAAO,iBAAiB,CAAA,IAAK;AAAC,GACrC;AACF;AAEA,SAAS,mBAAmB,GAAsC,EAAA;AAChE,EAAA,IAAI,QAAQ,IAAQ,IAAA,OAAO,GAAQ,KAAA,QAAA,IAAY,YAAY,GAAK,EAAA;AAC9D,IAAA,OACE,GAAI,CAAA,MAAA,KAAW,2BACf,IAAA,GAAA,CAAI,MAAW,KAAA,2BAAA;AAAA;AAGnB,EAAO,OAAA,KAAA;AACT;AAEA,SAAS,kBACP,GACgD,EAAA;AAChD,EAAA,OAAO,kBAAmB,CAAA,GAAG,CAAK,IAAA,wBAAA,CAAyB,GAAG,CAAA;AAChE;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,24 +10,58 @@ import { Config } from '@backstage/config';
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
interface CreateAppOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The list of features to load.
|
|
15
|
+
*/
|
|
13
16
|
features?: (FrontendFeature | FrontendFeatureLoader)[];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Allows for the binding of plugins' external route refs within the app.
|
|
19
|
+
*/
|
|
17
20
|
bindRoutes?(context: {
|
|
18
21
|
bind: CreateAppRouteBinder;
|
|
19
22
|
}): void;
|
|
20
23
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Is the text "Loading..." by default.
|
|
24
|
-
* If set to "null" then no loading fallback component is rendered. *
|
|
24
|
+
* Advanced, more rarely used options.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
advanced?: {
|
|
27
|
+
/**
|
|
28
|
+
* If set to true, the system will silently accept and move on if
|
|
29
|
+
* encountering config for extensions that do not exist. The default is to
|
|
30
|
+
* reject such config to help catch simple mistakes.
|
|
31
|
+
*
|
|
32
|
+
* This flag can be useful in some scenarios where you have a dynamic set of
|
|
33
|
+
* extensions enabled at different times, but also increases the risk of
|
|
34
|
+
* accidentally missing e.g. simple typos in your config.
|
|
35
|
+
*/
|
|
30
36
|
allowUnknownExtensionConfig?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Sets a custom config loader, replacing the builtin one.
|
|
39
|
+
*
|
|
40
|
+
* This can be used e.g. if you have the need to source config out of custom
|
|
41
|
+
* storages.
|
|
42
|
+
*/
|
|
43
|
+
configLoader?: () => Promise<{
|
|
44
|
+
config: ConfigApi;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Applies one or more middleware on every extension, as they are added to
|
|
48
|
+
* the application.
|
|
49
|
+
*
|
|
50
|
+
* This is an advanced use case for modifying extension data on the fly as
|
|
51
|
+
* it gets emitted by extensions being instantiated.
|
|
52
|
+
*/
|
|
53
|
+
extensionFactoryMiddleware?: ExtensionFactoryMiddleware | ExtensionFactoryMiddleware[];
|
|
54
|
+
/**
|
|
55
|
+
* The element to render while loading the app (waiting for config, features, etc).
|
|
56
|
+
*
|
|
57
|
+
* This is the `<Progress />` component from `@backstage/core-components` by default.
|
|
58
|
+
* If set to `null` then no loading fallback element is rendered at all.
|
|
59
|
+
*/
|
|
60
|
+
loadingElement?: ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Allows for customizing how plugin info is retrieved.
|
|
63
|
+
*/
|
|
64
|
+
pluginInfoResolver?: FrontendPluginInfoResolver;
|
|
31
65
|
};
|
|
32
66
|
}
|
|
33
67
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/frontend-defaults",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.3",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -32,14 +32,15 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@backstage/config": "1.3.3",
|
|
35
|
+
"@backstage/core-components": "0.17.5-next.2",
|
|
35
36
|
"@backstage/errors": "1.2.7",
|
|
36
|
-
"@backstage/frontend-app-api": "0.12.0-next.
|
|
37
|
-
"@backstage/frontend-plugin-api": "0.11.0-next.
|
|
38
|
-
"@backstage/plugin-app": "0.2.0-next.
|
|
37
|
+
"@backstage/frontend-app-api": "0.12.0-next.3",
|
|
38
|
+
"@backstage/frontend-plugin-api": "0.11.0-next.2",
|
|
39
|
+
"@backstage/plugin-app": "0.2.0-next.2",
|
|
39
40
|
"@react-hookz/web": "^24.0.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@backstage/cli": "0.34.0-next.
|
|
43
|
+
"@backstage/cli": "0.34.0-next.2",
|
|
43
44
|
"@backstage/core-plugin-api": "1.10.9",
|
|
44
45
|
"@backstage/test-utils": "1.7.11-next.0",
|
|
45
46
|
"@testing-library/jest-dom": "^6.0.0",
|