Skip to content

Commit

Permalink
console log and dynamic import test
Browse files Browse the repository at this point in the history
  • Loading branch information
melissag-ensemble committed Jun 20, 2024
1 parent 69403e9 commit 7bccbd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-theme-aio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/gatsby-theme-aio",
"version": "4.11.16",
"version": "4.11.16-rc2",
"description": "The Adobe I/O theme for building markdown powered sites",
"main": "index.js",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const RedoclyAPIBlock = ({
hideTryItPanel = false,
jsonSampleExpandLevel = 2,
generateCodeSamples = 'languages: [], skipOptionalParameters: false,',
requestInterceptor = '',
requestInterceptorSrc = '',
}) => {
const [isRedoclyLoading, setIsRedoclyLoading] = useState(true);

Expand All @@ -39,6 +39,11 @@ const RedoclyAPIBlock = ({
input.spec = withPrefix(src);
}

console.log('~~ 1');
import(requestInterceptorSrc).then((mod) => {
console.log('~~ 2', mod);
});

useEffect(() => {
let script = document.createElement('script')
script.setAttribute('src', 'https://cdn.redoc.ly/reference-docs/latest/redocly-reference-docs.min.js');
Expand Down Expand Up @@ -70,7 +75,6 @@ const RedoclyAPIBlock = ({
hideTryItPanel: ${hideTryItPanel},
jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel},
${generateCodeSamples ? "generateCodeSamples: { " + generateCodeSamples + "}," : ''}
${requestInterceptor ? "requestInterceptor: " + requestInterceptor + "," : ''}
hideLoading: true,
theme: {
${typography ? "typography: { " + typography + "}," : ''}
Expand Down Expand Up @@ -102,7 +106,7 @@ RedoclyAPIBlock.propTypes = {
PropTypes.number,
]),
generateCodeSamples: PropTypes.string,
requestInterceptor: PropTypes.string,
requestInterceptorSrc: PropTypes.string,
};

export { RedoclyAPIBlock };

0 comments on commit 7bccbd3

Please sign in to comment.