@backstage/frontend-defaults 0.4.1-next.0 → 0.5.0-next.1
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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @backstage/frontend-defaults
|
|
2
2
|
|
|
3
|
+
## 0.5.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 92af1ae: **BREAKING**: Removed the `allowUnknownExtensionConfig` option from `createApp`. This flag had no effect and was a no-op, so no behavioral changes are expected.
|
|
8
|
+
- 33de79d: **BREAKING**: Removed the deprecated `createPublicSignInApp` function. Use `createApp` from `@backstage/frontend-defaults` with `appModulePublicSignIn` from `@backstage/plugin-app/alpha` instead.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/frontend-plugin-api@0.15.0-next.1
|
|
14
|
+
- @backstage/frontend-app-api@0.16.0-next.1
|
|
15
|
+
- @backstage/core-components@0.18.8-next.1
|
|
16
|
+
- @backstage/plugin-app@0.4.1-next.2
|
|
17
|
+
|
|
3
18
|
## 0.4.1-next.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -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
|
|
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 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 ExtensionFactoryMiddleware,\n FrontendPluginInfoResolver,\n} from '@backstage/frontend-app-api';\nimport appPlugin from '@backstage/plugin-app';\nimport { discoverAvailableFeatures } from './discovery';\nimport { resolveAsyncFeatures } from './resolution';\nimport { maybeCreateErrorPage } from './maybeCreateErrorPage';\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 * 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 errorPage = maybeCreateErrorPage(app);\n if (errorPage) {\n return { default: () => errorPage };\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":";;;;;;;;;;;;;AAmGO,SAAS,UAAU,OAAA,EAExB;AACA,EAAA,IA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AAA;AAE9B,EAAA,OAAO;AAAA,IACL,UAAA,GAAa;AACX,MAAA,2BACG,QAAA,EAAA,EAAS,QAAA,EAAU,gBAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,WAAQ,CAAA,EACX,CAAA;AAAA,IAEJ;AAAA,GACF;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
1
|
import { ReactNode, JSX } from 'react';
|
|
3
|
-
import { FrontendFeature, FrontendFeatureLoader, ConfigApi
|
|
4
|
-
import { CreateAppRouteBinder, FrontendPluginInfoResolver, AppError, AppErrorTypes } from '@backstage/frontend-app-api';
|
|
2
|
+
import { FrontendFeature, FrontendFeatureLoader, ConfigApi } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { CreateAppRouteBinder, ExtensionFactoryMiddleware, FrontendPluginInfoResolver, AppError, AppErrorTypes } from '@backstage/frontend-app-api';
|
|
5
4
|
import { Config } from '@backstage/config';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -24,16 +23,6 @@ interface CreateAppOptions {
|
|
|
24
23
|
* Advanced, more rarely used options.
|
|
25
24
|
*/
|
|
26
25
|
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
|
-
*/
|
|
36
|
-
allowUnknownExtensionConfig?: boolean;
|
|
37
26
|
/**
|
|
38
27
|
* Sets a custom config loader, replacing the builtin one.
|
|
39
28
|
*
|
|
@@ -73,14 +62,6 @@ declare function createApp(options?: CreateAppOptions): {
|
|
|
73
62
|
createRoot(): JSX.Element;
|
|
74
63
|
};
|
|
75
64
|
|
|
76
|
-
/**
|
|
77
|
-
* @public
|
|
78
|
-
* @deprecated Use {@link @backstage/plugin-app/alpha#appModulePublicSignIn} instead.
|
|
79
|
-
*/
|
|
80
|
-
declare function createPublicSignInApp(options?: CreateAppOptions): {
|
|
81
|
-
createRoot(): react.JSX.Element;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
65
|
/**
|
|
85
66
|
* @public
|
|
86
67
|
*/
|
|
@@ -108,5 +89,5 @@ declare function maybeCreateErrorPage(app: {
|
|
|
108
89
|
warningCodes?: Array<keyof AppErrorTypes>;
|
|
109
90
|
}): JSX.Element | undefined;
|
|
110
91
|
|
|
111
|
-
export { createApp,
|
|
92
|
+
export { createApp, discoverAvailableFeatures, maybeCreateErrorPage, resolveAsyncFeatures };
|
|
112
93
|
export type { CreateAppOptions };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { createApp } from './createApp.esm.js';
|
|
2
|
-
export { createPublicSignInApp } from './createPublicSignInApp.esm.js';
|
|
3
2
|
export { discoverAvailableFeatures } from './discovery.esm.js';
|
|
4
3
|
export { resolveAsyncFeatures } from './resolution.esm.js';
|
|
5
4
|
export { maybeCreateErrorPage } from './maybeCreateErrorPage.esm.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/frontend-defaults",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-next.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@backstage/config": "1.3.6",
|
|
35
|
-
"@backstage/core-components": "0.18.8-next.
|
|
35
|
+
"@backstage/core-components": "0.18.8-next.1",
|
|
36
36
|
"@backstage/errors": "1.2.7",
|
|
37
|
-
"@backstage/frontend-app-api": "0.
|
|
38
|
-
"@backstage/frontend-plugin-api": "0.
|
|
39
|
-
"@backstage/plugin-app": "0.4.1-next.
|
|
37
|
+
"@backstage/frontend-app-api": "0.16.0-next.1",
|
|
38
|
+
"@backstage/frontend-plugin-api": "0.15.0-next.1",
|
|
39
|
+
"@backstage/plugin-app": "0.4.1-next.2",
|
|
40
40
|
"@react-hookz/web": "^24.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@backstage/cli": "0.
|
|
44
|
-
"@backstage/core-plugin-api": "1.12.4-next.
|
|
45
|
-
"@backstage/plugin-app-react": "0.2.1-next.
|
|
43
|
+
"@backstage/cli": "0.36.0-next.2",
|
|
44
|
+
"@backstage/core-plugin-api": "1.12.4-next.1",
|
|
45
|
+
"@backstage/plugin-app-react": "0.2.1-next.1",
|
|
46
46
|
"@backstage/test-utils": "1.7.16-next.0",
|
|
47
47
|
"@testing-library/jest-dom": "^6.0.0",
|
|
48
48
|
"@testing-library/react": "^16.0.0",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { appModulePublicSignIn } from '@backstage/plugin-app/alpha';
|
|
2
|
-
import { createApp } from './createApp.esm.js';
|
|
3
|
-
|
|
4
|
-
function createPublicSignInApp(options) {
|
|
5
|
-
return createApp({
|
|
6
|
-
...options,
|
|
7
|
-
features: [...options?.features ?? [], appModulePublicSignIn]
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { createPublicSignInApp };
|
|
12
|
-
//# sourceMappingURL=createPublicSignInApp.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createPublicSignInApp.esm.js","sources":["../src/createPublicSignInApp.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 { appModulePublicSignIn } from '@backstage/plugin-app/alpha';\nimport { CreateAppOptions, createApp } from './createApp';\n\n/**\n * @public\n * @deprecated Use {@link @backstage/plugin-app/alpha#appModulePublicSignIn} instead.\n */\nexport function createPublicSignInApp(options?: CreateAppOptions) {\n return createApp({\n ...options,\n features: [...(options?.features ?? []), appModulePublicSignIn],\n });\n}\n"],"names":[],"mappings":";;;AAuBO,SAAS,sBAAsB,OAAA,EAA4B;AAChE,EAAA,OAAO,SAAA,CAAU;AAAA,IACf,GAAG,OAAA;AAAA,IACH,UAAU,CAAC,GAAI,SAAS,QAAA,IAAY,IAAK,qBAAqB;AAAA,GAC/D,CAAA;AACH;;;;"}
|