@backstage/plugin-techdocs 1.18.1 → 1.18.2
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,11 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 1.18.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f712f71: Fixed TechDocs addons silently not rendering in apps using the new frontend system, on both the standalone documentation reader page and the entity documentation tab.
|
|
8
|
+
|
|
3
9
|
## 1.18.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -5,8 +5,8 @@ import { attachTechDocsAddonComponentData } from '@backstage/plugin-techdocs-rea
|
|
|
5
5
|
import { TechDocsReaderRouter, EmbeddedDocsRouter } from '../../Router.esm.js';
|
|
6
6
|
import { TechDocsReaderLayout } from './TechDocsReaderLayout.esm.js';
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */ jsx(TechDocsAddons, { children:
|
|
8
|
+
function renderAddons(addonOptions) {
|
|
9
|
+
return /* @__PURE__ */ jsx(TechDocsAddons, { children: addonOptions.map((options) => {
|
|
10
10
|
const Addon = options.component;
|
|
11
11
|
attachTechDocsAddonComponentData(Addon, options);
|
|
12
12
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Addon, {}) }, options.name);
|
|
@@ -21,11 +21,11 @@ function TechDocsReaderPage(props) {
|
|
|
21
21
|
withHeader: props.withHeader
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
|
-
|
|
24
|
+
renderAddons(props.addonOptions)
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
27
27
|
function TechDocsEntityContent(props) {
|
|
28
|
-
return /* @__PURE__ */ jsx(EmbeddedDocsRouter, { emptyState: props.emptyState, children:
|
|
28
|
+
return /* @__PURE__ */ jsx(EmbeddedDocsRouter, { emptyState: props.emptyState, children: renderAddons(props.addonOptions) });
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { TechDocsEntityContent, TechDocsReaderPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsReaderPage.esm.js","sources":["../../../src/alpha/components/TechDocsReaderPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactElement, Suspense } from 'react';\nimport {\n TechDocsAddons,\n type TechDocsAddonOptions,\n} from '@backstage/plugin-techdocs-react';\nimport { attachTechDocsAddonComponentData } from '@backstage/plugin-techdocs-react/alpha';\nimport { EmbeddedDocsRouter, TechDocsReaderRouter } from '../../Router';\nimport { TechDocsReaderLayout } from './TechDocsReaderLayout';\n\
|
|
1
|
+
{"version":3,"file":"TechDocsReaderPage.esm.js","sources":["../../../src/alpha/components/TechDocsReaderPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactElement, Suspense } from 'react';\nimport {\n TechDocsAddons,\n type TechDocsAddonOptions,\n} from '@backstage/plugin-techdocs-react';\nimport { attachTechDocsAddonComponentData } from '@backstage/plugin-techdocs-react/alpha';\nimport { EmbeddedDocsRouter, TechDocsReaderRouter } from '../../Router';\nimport { TechDocsReaderLayout } from './TechDocsReaderLayout';\n\n// Deliberately a function call rather than a component. Addons are discovered\n// by walking the router outlet as an element tree: the walk only follows\n// `props.children` and never invokes a component, and this is also the only\n// place the addon component data is attached. A component wrapper breaks both,\n// because its children are built by a render that the walk never performs.\nfunction renderAddons(addonOptions: TechDocsAddonOptions[]) {\n return (\n <TechDocsAddons>\n {addonOptions.map(options => {\n const Addon = options.component;\n attachTechDocsAddonComponentData(Addon, options);\n return (\n <Suspense key={options.name} fallback={null}>\n <Addon />\n </Suspense>\n );\n })}\n </TechDocsAddons>\n );\n}\n\nexport function TechDocsReaderPage(props: {\n addonOptions: TechDocsAddonOptions[];\n withSearch: boolean;\n withHeader: boolean;\n}) {\n return (\n <TechDocsReaderRouter>\n <TechDocsReaderLayout\n withSearch={props.withSearch}\n withHeader={props.withHeader}\n />\n {renderAddons(props.addonOptions)}\n </TechDocsReaderRouter>\n );\n}\n\nexport function TechDocsEntityContent(props: {\n addonOptions: TechDocsAddonOptions[];\n emptyState?: ReactElement;\n}) {\n return (\n <EmbeddedDocsRouter emptyState={props.emptyState}>\n {renderAddons(props.addonOptions)}\n </EmbeddedDocsRouter>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BA,SAAS,aAAa,YAAA,EAAsC;AAC1D,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EACE,QAAA,EAAA,YAAA,CAAa,GAAA,CAAI,CAAA,OAAA,KAAW;AAC3B,IAAA,MAAM,QAAQ,OAAA,CAAQ,SAAA;AACtB,IAAA,gCAAA,CAAiC,OAAO,OAAO,CAAA;AAC/C,IAAA,uBACE,GAAA,CAAC,YAA4B,QAAA,EAAU,IAAA,EACrC,8BAAC,KAAA,EAAA,EAAM,CAAA,EAAA,EADM,QAAQ,IAEvB,CAAA;AAAA,EAEJ,CAAC,CAAA,EACH,CAAA;AAEJ;AAEO,SAAS,mBAAmB,KAAA,EAIhC;AACD,EAAA,4BACG,oBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,YAAY,KAAA,CAAM,UAAA;AAAA,QAClB,YAAY,KAAA,CAAM;AAAA;AAAA,KACpB;AAAA,IACC,YAAA,CAAa,MAAM,YAAY;AAAA,GAAA,EAClC,CAAA;AAEJ;AAEO,SAAS,sBAAsB,KAAA,EAGnC;AACD,EAAA,uBACE,GAAA,CAAC,sBAAmB,UAAA,EAAY,KAAA,CAAM,YACnC,QAAA,EAAA,YAAA,CAAa,KAAA,CAAM,YAAY,CAAA,EAClC,CAAA;AAEJ;;;;"}
|