1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/website/package.json

88 lines
2.5 KiB
JSON
Raw Normal View History

{
"name": "websitev-2",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=16.14"
},
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
2022-09-20 12:43:39 +02:00
"build": "yarn generate && docusaurus build",
"swizzle": "docusaurus swizzle",
2022-09-20 12:43:39 +02:00
"generate": "docusaurus gen-api-docs all && node clean-generated-docs.js",
"deploy": "yarn generate && docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
2022-02-17 12:30:49 +01:00
"write-heading-ids": "docusaurus write-heading-ids",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"dependencies": {
chore: fix broken docs build / remove unused tag files (#2402) ## Issue So, we've got an issue with our docs build not working. When building for production, we get an error that looks a little bit like this: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 40.85s TypeError: source_default(...).bold is not a function TypeError: source_default(...).bold is not a function [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` Which isn't very helpful at all. If you go into `/node_modules/@docusaurus/core/lib/client/serverEntry.js` and modify the `render` function to log the actual error and remove anything chalk-related, you get this instead: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 44.62s Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38139:1593) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38513:1469) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Error: Unexpected: cant find current sidebar in context Error: Unexpected: cant find current sidebar in context [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` That's better, but it's still not very clear. ## Getting more info We've had problems with a similar error message before. Last time it was caused by an empty file that docusaurus couldn't process. A similar issue has also been described in [ this docusaurus GitHub issue ](https://github.com/facebook/docusaurus/issues/7686). That's also what gave me the idea of changing the logging in the dependency. I'm currently unsure whether this is caused by the openapi docs or something else. I've been in touch with the [openapi plugin maintainer](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323) and he has been able to see the same error when building for prod locally, but it was due to some old generated files. Worth noting: this only seems to affect the prod build. Building for dev (`yarn docusaurus start`) works just fine. It also fails locally **and** in CI, so it _is_ an issue. ## Updating the logging To get better logging, you can go into the `/node_modules/@docusaurus/core/lib/client/serverEntry.js` file and update the `render` function from ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { // We are not using logger in this file, because it seems to fail with some // compilers / some polyfill methods. This is very likely a bug, but in the // long term, when we output native ES modules in SSR, the bug will be gone. // prettier-ignore console.error(chalk.red(`${chalk.bold('[ERROR]')} Docusaurus server-side rendering could not render static page with path ${chalk.cyan.underline(locals.path)}.`)); const isNotDefinedErrorRegex = /(?:window|document|localStorage|navigator|alert|location|buffer|self) is not defined/i; if (isNotDefinedErrorRegex.test(err.message)) { // prettier-ignore console.info(`${chalk.cyan.bold('[INFO]')} It looks like you are using code that should run on the client-side only. To get around it, try using ${chalk.cyan('`<BrowserOnly>`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#browseronly')}) or ${chalk.cyan('`ExecutionEnvironment`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#executionenvironment')}). It might also require to wrap your client code in ${chalk.cyan('`useEffect`')} hook and/or import a third-party library dynamically (if any).`); } throw err; } } ``` to ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { console.error(err) throw err; } } ``` That'll yield the errors about the current sidebar in context. ## Root cause Found the issue! 🙋🏼 It's explained in [this comment on the openapi docs integration](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323#issuecomment-1311549864) for now, but in short: we have tags defined that we don't use. They're being picked up by docusaurus, but don't have the proper context. That's causing this. The previously mentioned comment is included here for easy finding in the future: ### Root cause explanation The OpenAPI spec we use to generate the docs has a number of tags listed at the root level. This is necessary for this plugin to pick up tag categories and is, as far as I can tell, also how it _should_ be done. However, not all of those tags are in use. Specifically, there's 2 tags that are not. When the plugin generates docs from the spec, it generates pages for all endpoints and all tags and groups them by tag. However, it seems likely that if a tag doesn't have any associated endpoints, then it won't get added to the sidebar because there's no endpoint that references it. But the doc files for these tags do end up lying around in the directory regardless, and when docusaurus tries to pick up the files in the generated directory, it also tries to pick up the unused tag files. But because they're not part of a sidebar, they end up throwing errors because they can't find the sidebar context. ### How I found it The fact that I got more instances of the error message without the sidebar ref than with it made me pay more attention to the number of errors. I decided to check how many files were in the generated directory and how many files were referenced from the generated sidebar. Turns out the difference there was **2**: there were two generated files in the directory that the sidebar didn't reference. At this point, it was easy enough to try and delete those files before rebuilding, and wouldn't you know: it worked! ### Our use case Now, why do we have tags that are unused in the root spec? Can't we just remove them? That's a good question with a bit of a complicated answer. Unleash uses an open core model and the OpenAPI integration is part of that open core. The closed-source parts of Unleash are located in another repo and extend the open-source distribution. Because the OpenAPI spec is configured in the open-source part, enterprise-only tags etc also need to be configured there. Then, when the changes are absorbed into enterprise, we can use the tags there. It gets more complicated because we use an enterprise instance to generate the docs (because we want enterprise-endpoints to be listed too). The instance uses the latest released instance of Unleash to have the docs most accurately reflect the current state of things. So, in this case, the tags have been added, but not yet used by any endpoints, which suddenly causes this build failure. We can add the tags to the enterprise-version, but the spec wouldn't be updated before the next release regardless, which will probably be in a week or so. This isn't an ideal setup, but .. it is what it is. ## Solutions and workarounds As mentioned in the previous section, the reason the build was failing was that there were unused tag files that docusaurus tried to include in the build. Because they don't belong to a sidebar, the compilation failed. I've reported the issue to the openapi plugin maintainers and am waiting for a response. However, it seems that having unused root tags declared is invalid according to the spec, so it's something we should look into fixing in the future. ### Current workaround: cleaning script The current workaround is to extend the api cleaning script to manually remove the unused tag files. ### Ideal solution: filter root-level tags Ideally, we shouldn't list unused OpenAPI tags on the root level at all. However, because of the way we add root-level tags (as a predefined, static lists, refer to `src/lib/openapi/index.ts`) and endpoints (dynamically added at runtime) today, we don't really have a clear way to filter the list of tags. This gets even more complicated when taking the enterprise functionality and the potential extra tags they must have. This is, however, something that should definitely be looked into. Working with OpenAPI across multipile repos is already troublesome, so this is just yet another thing to look into.
2022-11-11 14:01:54 +01:00
"@docusaurus/core": "2.2.0",
"@docusaurus/plugin-client-redirects": "2.2.0",
"@docusaurus/plugin-google-analytics": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/remark-plugin-npm2yarn": "2.2.0",
"@mdx-js/react": "1.6.22",
"@svgr/webpack": "6.5.1",
chore: fix broken docs build / remove unused tag files (#2402) ## Issue So, we've got an issue with our docs build not working. When building for production, we get an error that looks a little bit like this: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 40.85s TypeError: source_default(...).bold is not a function TypeError: source_default(...).bold is not a function [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` Which isn't very helpful at all. If you go into `/node_modules/@docusaurus/core/lib/client/serverEntry.js` and modify the `render` function to log the actual error and remove anything chalk-related, you get this instead: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 44.62s Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38139:1593) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38513:1469) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Error: Unexpected: cant find current sidebar in context Error: Unexpected: cant find current sidebar in context [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` That's better, but it's still not very clear. ## Getting more info We've had problems with a similar error message before. Last time it was caused by an empty file that docusaurus couldn't process. A similar issue has also been described in [ this docusaurus GitHub issue ](https://github.com/facebook/docusaurus/issues/7686). That's also what gave me the idea of changing the logging in the dependency. I'm currently unsure whether this is caused by the openapi docs or something else. I've been in touch with the [openapi plugin maintainer](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323) and he has been able to see the same error when building for prod locally, but it was due to some old generated files. Worth noting: this only seems to affect the prod build. Building for dev (`yarn docusaurus start`) works just fine. It also fails locally **and** in CI, so it _is_ an issue. ## Updating the logging To get better logging, you can go into the `/node_modules/@docusaurus/core/lib/client/serverEntry.js` file and update the `render` function from ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { // We are not using logger in this file, because it seems to fail with some // compilers / some polyfill methods. This is very likely a bug, but in the // long term, when we output native ES modules in SSR, the bug will be gone. // prettier-ignore console.error(chalk.red(`${chalk.bold('[ERROR]')} Docusaurus server-side rendering could not render static page with path ${chalk.cyan.underline(locals.path)}.`)); const isNotDefinedErrorRegex = /(?:window|document|localStorage|navigator|alert|location|buffer|self) is not defined/i; if (isNotDefinedErrorRegex.test(err.message)) { // prettier-ignore console.info(`${chalk.cyan.bold('[INFO]')} It looks like you are using code that should run on the client-side only. To get around it, try using ${chalk.cyan('`<BrowserOnly>`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#browseronly')}) or ${chalk.cyan('`ExecutionEnvironment`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#executionenvironment')}). It might also require to wrap your client code in ${chalk.cyan('`useEffect`')} hook and/or import a third-party library dynamically (if any).`); } throw err; } } ``` to ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { console.error(err) throw err; } } ``` That'll yield the errors about the current sidebar in context. ## Root cause Found the issue! 🙋🏼 It's explained in [this comment on the openapi docs integration](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323#issuecomment-1311549864) for now, but in short: we have tags defined that we don't use. They're being picked up by docusaurus, but don't have the proper context. That's causing this. The previously mentioned comment is included here for easy finding in the future: ### Root cause explanation The OpenAPI spec we use to generate the docs has a number of tags listed at the root level. This is necessary for this plugin to pick up tag categories and is, as far as I can tell, also how it _should_ be done. However, not all of those tags are in use. Specifically, there's 2 tags that are not. When the plugin generates docs from the spec, it generates pages for all endpoints and all tags and groups them by tag. However, it seems likely that if a tag doesn't have any associated endpoints, then it won't get added to the sidebar because there's no endpoint that references it. But the doc files for these tags do end up lying around in the directory regardless, and when docusaurus tries to pick up the files in the generated directory, it also tries to pick up the unused tag files. But because they're not part of a sidebar, they end up throwing errors because they can't find the sidebar context. ### How I found it The fact that I got more instances of the error message without the sidebar ref than with it made me pay more attention to the number of errors. I decided to check how many files were in the generated directory and how many files were referenced from the generated sidebar. Turns out the difference there was **2**: there were two generated files in the directory that the sidebar didn't reference. At this point, it was easy enough to try and delete those files before rebuilding, and wouldn't you know: it worked! ### Our use case Now, why do we have tags that are unused in the root spec? Can't we just remove them? That's a good question with a bit of a complicated answer. Unleash uses an open core model and the OpenAPI integration is part of that open core. The closed-source parts of Unleash are located in another repo and extend the open-source distribution. Because the OpenAPI spec is configured in the open-source part, enterprise-only tags etc also need to be configured there. Then, when the changes are absorbed into enterprise, we can use the tags there. It gets more complicated because we use an enterprise instance to generate the docs (because we want enterprise-endpoints to be listed too). The instance uses the latest released instance of Unleash to have the docs most accurately reflect the current state of things. So, in this case, the tags have been added, but not yet used by any endpoints, which suddenly causes this build failure. We can add the tags to the enterprise-version, but the spec wouldn't be updated before the next release regardless, which will probably be in a week or so. This isn't an ideal setup, but .. it is what it is. ## Solutions and workarounds As mentioned in the previous section, the reason the build was failing was that there were unused tag files that docusaurus tried to include in the build. Because they don't belong to a sidebar, the compilation failed. I've reported the issue to the openapi plugin maintainers and am waiting for a response. However, it seems that having unused root tags declared is invalid according to the spec, so it's something we should look into fixing in the future. ### Current workaround: cleaning script The current workaround is to extend the api cleaning script to manually remove the unused tag files. ### Ideal solution: filter root-level tags Ideally, we shouldn't list unused OpenAPI tags on the root level at all. However, because of the way we add root-level tags (as a predefined, static lists, refer to `src/lib/openapi/index.ts`) and endpoints (dynamically added at runtime) today, we don't really have a clear way to filter the list of tags. This gets even more complicated when taking the enterprise functionality and the potential extra tags they must have. This is, however, something that should definitely be looked into. Working with OpenAPI across multipile repos is already troublesome, so this is just yet another thing to look into.
2022-11-11 14:01:54 +01:00
"browserslist": "^4.16.5",
"clsx": "1.2.1",
fix(deps): update dependency docusaurus-plugin-openapi-docs to v1.5.0 (#2763) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [docusaurus-plugin-openapi-docs](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs) | [`1.4.7` -> `1.5.0`](https://renovatebot.com/diffs/npm/docusaurus-plugin-openapi-docs/1.4.7/1.5.0) | [![age](https://badges.renovateapi.com/packages/npm/docusaurus-plugin-openapi-docs/1.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/docusaurus-plugin-openapi-docs/1.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/docusaurus-plugin-openapi-docs/1.5.0/compatibility-slim/1.4.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/docusaurus-plugin-openapi-docs/1.5.0/confidence-slim/1.4.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>PaloAltoNetworks/docusaurus-openapi-docs</summary> ### [`v1.5.0`](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/blob/HEAD/CHANGELOG.md#&#8203;150-Dec-16-2022) [Compare Source](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/compare/v1.4.7...v1.5.0) High level enhancements - Introduced proxy support - Added support for rendering deprecated schema items/properties Other enhancements and bug fixes - Only create list of 2xx content types for request samples ([#&#8203;365](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/365)) - \[Enhancement] Add deprecated support to schema items ([#&#8203;367](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/367)) - \[Enhancement] Add proxy support ([#&#8203;366](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/366)) - kebab case fix for info pages ([#&#8203;363](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/363)) - Hide edit URL by default ([#&#8203;364](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/364)) - Update index.ts ([#&#8203;361](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/361)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-29 01:04:18 +01:00
"docusaurus-plugin-openapi-docs": "1.5.0",
docs: Use Go readme (#2816) # PR 1: add remote content plugin and rust readme ## What This PR does a few connected things: 1. It adds the ["docusaurus-plugin-remote-content" package](https://github.com/rdilweb/docusaurus-plugin-remote-content). 2. It adds configuration to make it work with Readmes found on GitHub. 3. It adds the Rust SDK's readme (replacing the link we used to have) as a proof of concept on how to do it. ## Why With documentation split between GitHub readmes and the official docs, it's hard to keep everything up to date and in sync. It's also quite confusing that some information is only available in some places, but not in others. We've talked about auto-including readmes from GitHub for a while, so here's a proof of concept (finally) 🥳 The intention is to get this merged and then to migrate the other SDK docs one by one, ensuring that everything in the documentation is also in the readme (so that no info is lost). ## Discussion points ### Generation directory The current generation method generates the files into `/reference/sdks/<sdk name>`. I think this works for now, but it means it adds auto-generated files into a directory that you can't ignore (at least not yet). We could instead generate them into `/generated/sdks` and update the slugs so that they still match the expected pattern. However, this would make the sidebar a little harder to work with (for now). That said, there may be ways around it. It's worth exploring. ### Generation method By default, this plugin will generate files whenever you build. That (probably) means that you need an internet connection _and_ that you'll end up with a bunch of untracked files. An option is to only generate the files "manually" and commit them to the repo. That would allow you to build the project without an internet connection and would also remove the need for ignoring the files. We could automate the generation if we wanted to. ## Preview / Screenies Visit [/reference/sdks/rust](https://unleash-docs-git-docs-include-sdk-readmes-unleash-team.vercel.app/reference/sdks/rust) in the preview to see what it looks like live. ![image](https://user-images.githubusercontent.com/17786332/210373446-784b7e69-0f36-4e9e-874a-2b06b863b603.png) # PR 2: add go readme This PR changes the docs generation to use the Go SDK's GitHub readme for the SDK docs instead of a separate document. ## What The changes in this PR are: - Delete the existing Go SDK documentation. All the content in this guide already exists in the Go readme. - Add the Go SDK to the list of auto-generated readme docs - Move the readme-related code into a separate module, `readme-fns.js` (I'm not bullish about the file name: we can change it if you have suggestions) - Add a note to the top of all generated readmes saying you'll need an API url and an API token. The note also links you to the relevant reference and how-to docs. ## Why Having two different bits of documentation for the same SDK is troublesome. By only having the data in one place, we can avoid it going out of sync and getting stale.
2023-01-05 10:47:49 +01:00
"docusaurus-plugin-remote-content": "^3.1.0",
fix(deps): update dependency docusaurus-theme-openapi-docs to v1.5.0 (#2764) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [docusaurus-theme-openapi-docs](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs) | [`1.4.7` -> `1.5.0`](https://renovatebot.com/diffs/npm/docusaurus-theme-openapi-docs/1.4.7/1.5.0) | [![age](https://badges.renovateapi.com/packages/npm/docusaurus-theme-openapi-docs/1.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/docusaurus-theme-openapi-docs/1.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/docusaurus-theme-openapi-docs/1.5.0/compatibility-slim/1.4.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/docusaurus-theme-openapi-docs/1.5.0/confidence-slim/1.4.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>PaloAltoNetworks/docusaurus-openapi-docs</summary> ### [`v1.5.0`](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/blob/HEAD/CHANGELOG.md#&#8203;150-Dec-16-2022) [Compare Source](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/compare/v1.4.7...v1.5.0) High level enhancements - Introduced proxy support - Added support for rendering deprecated schema items/properties Other enhancements and bug fixes - Only create list of 2xx content types for request samples ([#&#8203;365](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/365)) - \[Enhancement] Add deprecated support to schema items ([#&#8203;367](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/367)) - \[Enhancement] Add proxy support ([#&#8203;366](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/366)) - kebab case fix for info pages ([#&#8203;363](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/363)) - Hide edit URL by default ([#&#8203;364](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/364)) - Update index.ts ([#&#8203;361](https://togithub.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/361)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-28 19:56:33 +01:00
"docusaurus-theme-openapi-docs": "1.5.0",
"file-loader": "6.2.0",
chore: fix broken docs build / remove unused tag files (#2402) ## Issue So, we've got an issue with our docs build not working. When building for production, we get an error that looks a little bit like this: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 40.85s TypeError: source_default(...).bold is not a function TypeError: source_default(...).bold is not a function [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` Which isn't very helpful at all. If you go into `/node_modules/@docusaurus/core/lib/client/serverEntry.js` and modify the `render` function to log the actual error and remove anything chalk-related, you get this instead: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 44.62s Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38139:1593) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38513:1469) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Error: Unexpected: cant find current sidebar in context Error: Unexpected: cant find current sidebar in context [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` That's better, but it's still not very clear. ## Getting more info We've had problems with a similar error message before. Last time it was caused by an empty file that docusaurus couldn't process. A similar issue has also been described in [ this docusaurus GitHub issue ](https://github.com/facebook/docusaurus/issues/7686). That's also what gave me the idea of changing the logging in the dependency. I'm currently unsure whether this is caused by the openapi docs or something else. I've been in touch with the [openapi plugin maintainer](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323) and he has been able to see the same error when building for prod locally, but it was due to some old generated files. Worth noting: this only seems to affect the prod build. Building for dev (`yarn docusaurus start`) works just fine. It also fails locally **and** in CI, so it _is_ an issue. ## Updating the logging To get better logging, you can go into the `/node_modules/@docusaurus/core/lib/client/serverEntry.js` file and update the `render` function from ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { // We are not using logger in this file, because it seems to fail with some // compilers / some polyfill methods. This is very likely a bug, but in the // long term, when we output native ES modules in SSR, the bug will be gone. // prettier-ignore console.error(chalk.red(`${chalk.bold('[ERROR]')} Docusaurus server-side rendering could not render static page with path ${chalk.cyan.underline(locals.path)}.`)); const isNotDefinedErrorRegex = /(?:window|document|localStorage|navigator|alert|location|buffer|self) is not defined/i; if (isNotDefinedErrorRegex.test(err.message)) { // prettier-ignore console.info(`${chalk.cyan.bold('[INFO]')} It looks like you are using code that should run on the client-side only. To get around it, try using ${chalk.cyan('`<BrowserOnly>`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#browseronly')}) or ${chalk.cyan('`ExecutionEnvironment`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#executionenvironment')}). It might also require to wrap your client code in ${chalk.cyan('`useEffect`')} hook and/or import a third-party library dynamically (if any).`); } throw err; } } ``` to ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { console.error(err) throw err; } } ``` That'll yield the errors about the current sidebar in context. ## Root cause Found the issue! 🙋🏼 It's explained in [this comment on the openapi docs integration](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323#issuecomment-1311549864) for now, but in short: we have tags defined that we don't use. They're being picked up by docusaurus, but don't have the proper context. That's causing this. The previously mentioned comment is included here for easy finding in the future: ### Root cause explanation The OpenAPI spec we use to generate the docs has a number of tags listed at the root level. This is necessary for this plugin to pick up tag categories and is, as far as I can tell, also how it _should_ be done. However, not all of those tags are in use. Specifically, there's 2 tags that are not. When the plugin generates docs from the spec, it generates pages for all endpoints and all tags and groups them by tag. However, it seems likely that if a tag doesn't have any associated endpoints, then it won't get added to the sidebar because there's no endpoint that references it. But the doc files for these tags do end up lying around in the directory regardless, and when docusaurus tries to pick up the files in the generated directory, it also tries to pick up the unused tag files. But because they're not part of a sidebar, they end up throwing errors because they can't find the sidebar context. ### How I found it The fact that I got more instances of the error message without the sidebar ref than with it made me pay more attention to the number of errors. I decided to check how many files were in the generated directory and how many files were referenced from the generated sidebar. Turns out the difference there was **2**: there were two generated files in the directory that the sidebar didn't reference. At this point, it was easy enough to try and delete those files before rebuilding, and wouldn't you know: it worked! ### Our use case Now, why do we have tags that are unused in the root spec? Can't we just remove them? That's a good question with a bit of a complicated answer. Unleash uses an open core model and the OpenAPI integration is part of that open core. The closed-source parts of Unleash are located in another repo and extend the open-source distribution. Because the OpenAPI spec is configured in the open-source part, enterprise-only tags etc also need to be configured there. Then, when the changes are absorbed into enterprise, we can use the tags there. It gets more complicated because we use an enterprise instance to generate the docs (because we want enterprise-endpoints to be listed too). The instance uses the latest released instance of Unleash to have the docs most accurately reflect the current state of things. So, in this case, the tags have been added, but not yet used by any endpoints, which suddenly causes this build failure. We can add the tags to the enterprise-version, but the spec wouldn't be updated before the next release regardless, which will probably be in a week or so. This isn't an ideal setup, but .. it is what it is. ## Solutions and workarounds As mentioned in the previous section, the reason the build was failing was that there were unused tag files that docusaurus tried to include in the build. Because they don't belong to a sidebar, the compilation failed. I've reported the issue to the openapi plugin maintainers and am waiting for a response. However, it seems that having unused root tags declared is invalid according to the spec, so it's something we should look into fixing in the future. ### Current workaround: cleaning script The current workaround is to extend the api cleaning script to manually remove the unused tag files. ### Ideal solution: filter root-level tags Ideally, we shouldn't list unused OpenAPI tags on the root level at all. However, because of the way we add root-level tags (as a predefined, static lists, refer to `src/lib/openapi/index.ts`) and endpoints (dynamically added at runtime) today, we don't really have a clear way to filter the list of tags. This gets even more complicated when taking the enterprise functionality and the potential extra tags they must have. This is, however, something that should definitely be looked into. Working with OpenAPI across multipile repos is already troublesome, so this is just yet another thing to look into.
2022-11-11 14:01:54 +01:00
"immer": "^9.0.6",
"react": "18.2.0",
"react-dom": "18.2.0",
fix(deps): update dependency unleash-proxy-client to v2.4.0 (#2766) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [unleash-proxy-client](https://togithub.com/unleash/unleash-proxy-client-js) | [`2.3.0` -> `2.4.0`](https://renovatebot.com/diffs/npm/unleash-proxy-client/2.3.0/2.4.0) | [![age](https://badges.renovateapi.com/packages/npm/unleash-proxy-client/2.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/unleash-proxy-client/2.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/unleash-proxy-client/2.4.0/compatibility-slim/2.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/unleash-proxy-client/2.4.0/confidence-slim/2.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>unleash/unleash-proxy-client-js</summary> ### [`v2.4.0`](https://togithub.com/Unleash/unleash-proxy-client-js/releases/tag/v2.4.0) [Compare Source](https://togithub.com/unleash/unleash-proxy-client-js/compare/v2.3.0...v2.4.0) - [`dd59036`](http://github.com/Unleash/unleash-proxy-client-js/commit/dd59036a3e34ea35eb3fd651793f85777646f407) - fix: Include impression data status when not enabled ([#&#8203;122](https://togithub.com/unleash/unleash-proxy-client-js/issues/122)) - [`766b697`](http://github.com/Unleash/unleash-proxy-client-js/commit/766b697fbe63df7347ee54a6646c728f1d483791) - Feat/post fetching ([#&#8203;125](https://togithub.com/unleash/unleash-proxy-client-js/issues/125)) - [`815ac4b`](http://github.com/Unleash/unleash-proxy-client-js/commit/815ac4b3b8d07db8f26f7dfbe64fa204976f66ef) - 2.4.0-beta.0 - [`f0d5397`](http://github.com/Unleash/unleash-proxy-client-js/commit/f0d5397b6344622c573e859cd59e36670123e64f) - bundle rollup for browser ([#&#8203;129](https://togithub.com/unleash/unleash-proxy-client-js/issues/129)) - [`477a529`](http://github.com/Unleash/unleash-proxy-client-js/commit/477a5290616da4a07ead50b576cc9185c8cd0855) - 2.4.0-beta.1 - [`6c7a458`](http://github.com/Unleash/unleash-proxy-client-js/commit/6c7a458a53279eb112469ed49e681dcc57dca5a3) - 2.4.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-28 10:55:46 +01:00
"unleash-proxy-client": "2.4.0",
"url-loader": "4.1.1"
},
"resolutions": {
2022-08-26 10:27:30 +02:00
"async": "^3.2.4",
"trim": "^1.0.0",
"got": "^11.8.5",
"glob-parent": "^6.0.0",
2021-09-20 12:37:53 +02:00
"browserslist": "^4.16.5",
"set-value": "^4.0.1",
2021-09-27 13:26:18 +02:00
"immer": "^9.0.6",
"ansi-regex": "^5.0.1",
2022-08-26 10:27:30 +02:00
"nth-check": "^2.0.1",
"shelljs": "^0.8.5",
2022-11-03 14:43:36 +01:00
"trim-newlines": "^4.0.0",
"minimatch": "^5.0.0",
chore(deps): update dependency decode-uri-component to ^0.4.0 (#2754) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [decode-uri-component](https://togithub.com/SamVerschueren/decode-uri-component) | [`^0.2.1` -> `^0.4.0`](https://renovatebot.com/diffs/npm/decode-uri-component/0.2.2/0.4.1) | [![age](https://badges.renovateapi.com/packages/npm/decode-uri-component/0.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/decode-uri-component/0.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/decode-uri-component/0.4.1/compatibility-slim/0.2.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/decode-uri-component/0.4.1/confidence-slim/0.2.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SamVerschueren/decode-uri-component</summary> ### [`v0.4.1`](https://togithub.com/SamVerschueren/decode-uri-component/releases/tag/v0.4.1) [Compare Source](https://togithub.com/SamVerschueren/decode-uri-component/compare/v0.4.0...v0.4.1) - Add TypeScript type definitions [`c345b4c`](https://togithub.com/SamVerschueren/decode-uri-component/commit/c345b4c) ### [`v0.4.0`](https://togithub.com/SamVerschueren/decode-uri-component/releases/tag/v0.4.0) [Compare Source](https://togithub.com/SamVerschueren/decode-uri-component/compare/v0.3.0...v0.4.0) - Require Node.js 14 and move to ESM ([#&#8203;11](https://togithub.com/SamVerschueren/decode-uri-component/issues/11)) [`b09e39d`](https://togithub.com/SamVerschueren/decode-uri-component/commit/b09e39d) ### [`v0.3.0`](https://togithub.com/SamVerschueren/decode-uri-component/releases/tag/v0.3.0) [Compare Source](https://togithub.com/SamVerschueren/decode-uri-component/compare/v0.2.2...v0.3.0) - Do not decode + to a space - fixes [#&#8203;3](https://togithub.com/SamVerschueren/decode-uri-component/issues/3) [`3bbc879`](https://togithub.com/SamVerschueren/decode-uri-component/commit/3bbc879) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43My4zIiwidXBkYXRlZEluVmVyIjoiMzQuNzMuMyJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-28 02:40:24 +01:00
"decode-uri-component": "^0.4.0",
2022-12-08 11:32:22 +01:00
"qs": "^6.9.7"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
2022-02-17 12:30:49 +01:00
},
"devDependencies": {
chore(deps): update dependency @babel/core to v7.20.12 (#2825) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@babel/core](https://babel.dev/docs/en/next/babel-core) ([source](https://togithub.com/babel/babel)) | [`7.20.7` -> `7.20.12`](https://renovatebot.com/diffs/npm/@babel%2fcore/7.20.7/7.20.12) | [![age](https://badges.renovateapi.com/packages/npm/@babel%2fcore/7.20.12/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@babel%2fcore/7.20.12/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@babel%2fcore/7.20.12/compatibility-slim/7.20.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@babel%2fcore/7.20.12/confidence-slim/7.20.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>babel/babel</summary> ### [`v7.20.12`](https://togithub.com/babel/babel/blob/HEAD/CHANGELOG.md#v72012-2023-01-04) [Compare Source](https://togithub.com/babel/babel/compare/v7.20.7...v7.20.12) ##### :bug: Bug Fix - `babel-traverse` - [#&#8203;15224](https://togithub.com/babel/babel/pull/15224) Fix `TaggedTemplateLiteral` evaluation ([@&#8203;nmn](https://togithub.com/nmn)) - `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties` - [#&#8203;15312](https://togithub.com/babel/babel/pull/15312) fix: `delete this` in static class properties initialization ([@&#8203;SuperSodaSea](https://togithub.com/SuperSodaSea)) ##### :nail_care: Polish - `babel-traverse` - [#&#8203;15313](https://togithub.com/babel/babel/pull/15313) Implement support for evaluating computed properties. ([@&#8203;JBYoshi](https://togithub.com/JBYoshi)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC44MS4wIiwidXBkYXRlZEluVmVyIjoiMzQuODEuMCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-04 23:44:01 +01:00
"@babel/core": "7.20.12",
chore: fix broken docs build / remove unused tag files (#2402) ## Issue So, we've got an issue with our docs build not working. When building for production, we get an error that looks a little bit like this: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 40.85s TypeError: source_default(...).bold is not a function TypeError: source_default(...).bold is not a function [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` Which isn't very helpful at all. If you go into `/node_modules/@docusaurus/core/lib/client/serverEntry.js` and modify the `render` function to log the actual error and remove anything chalk-related, you get this instead: ``` $ docusaurus build [INFO] [en] Creating an optimized production build... ✔ Client ✖ Server Compiled with some errors in 44.62s Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38139:1593) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Actual error: Error: Unexpected: cant find current sidebar in context at useCurrentSidebarCategory (main:11618:247) at MDXContent (main:38513:1469) at Fb (main:149154:44) at Ib (main:149156:254) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) at W (main:149162:89) at Jb (main:149165:98) at Ib (main:149157:145) Error: Unexpected: cant find current sidebar in context Error: Unexpected: cant find current sidebar in context [ERROR] Unable to build website for locale en. [ERROR] Error: Failed to compile with errors. at /Users/thomas/projects/work/unleash/website/node_modules/@docusaurus/core/lib/webpack/utils.js:180:24 at /Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/Users/thomas/projects/work/unleash/website/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11) [INFO] Docusaurus version: 2.2.0 Node version: v16.14.0 error Command failed with exit code 1. ``` That's better, but it's still not very clear. ## Getting more info We've had problems with a similar error message before. Last time it was caused by an empty file that docusaurus couldn't process. A similar issue has also been described in [ this docusaurus GitHub issue ](https://github.com/facebook/docusaurus/issues/7686). That's also what gave me the idea of changing the logging in the dependency. I'm currently unsure whether this is caused by the openapi docs or something else. I've been in touch with the [openapi plugin maintainer](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323) and he has been able to see the same error when building for prod locally, but it was due to some old generated files. Worth noting: this only seems to affect the prod build. Building for dev (`yarn docusaurus start`) works just fine. It also fails locally **and** in CI, so it _is_ an issue. ## Updating the logging To get better logging, you can go into the `/node_modules/@docusaurus/core/lib/client/serverEntry.js` file and update the `render` function from ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { // We are not using logger in this file, because it seems to fail with some // compilers / some polyfill methods. This is very likely a bug, but in the // long term, when we output native ES modules in SSR, the bug will be gone. // prettier-ignore console.error(chalk.red(`${chalk.bold('[ERROR]')} Docusaurus server-side rendering could not render static page with path ${chalk.cyan.underline(locals.path)}.`)); const isNotDefinedErrorRegex = /(?:window|document|localStorage|navigator|alert|location|buffer|self) is not defined/i; if (isNotDefinedErrorRegex.test(err.message)) { // prettier-ignore console.info(`${chalk.cyan.bold('[INFO]')} It looks like you are using code that should run on the client-side only. To get around it, try using ${chalk.cyan('`<BrowserOnly>`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#browseronly')}) or ${chalk.cyan('`ExecutionEnvironment`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#executionenvironment')}). It might also require to wrap your client code in ${chalk.cyan('`useEffect`')} hook and/or import a third-party library dynamically (if any).`); } throw err; } } ``` to ```js export default async function render(locals) { try { return await doRender(locals); } catch (err) { console.error(err) throw err; } } ``` That'll yield the errors about the current sidebar in context. ## Root cause Found the issue! 🙋🏼 It's explained in [this comment on the openapi docs integration](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/323#issuecomment-1311549864) for now, but in short: we have tags defined that we don't use. They're being picked up by docusaurus, but don't have the proper context. That's causing this. The previously mentioned comment is included here for easy finding in the future: ### Root cause explanation The OpenAPI spec we use to generate the docs has a number of tags listed at the root level. This is necessary for this plugin to pick up tag categories and is, as far as I can tell, also how it _should_ be done. However, not all of those tags are in use. Specifically, there's 2 tags that are not. When the plugin generates docs from the spec, it generates pages for all endpoints and all tags and groups them by tag. However, it seems likely that if a tag doesn't have any associated endpoints, then it won't get added to the sidebar because there's no endpoint that references it. But the doc files for these tags do end up lying around in the directory regardless, and when docusaurus tries to pick up the files in the generated directory, it also tries to pick up the unused tag files. But because they're not part of a sidebar, they end up throwing errors because they can't find the sidebar context. ### How I found it The fact that I got more instances of the error message without the sidebar ref than with it made me pay more attention to the number of errors. I decided to check how many files were in the generated directory and how many files were referenced from the generated sidebar. Turns out the difference there was **2**: there were two generated files in the directory that the sidebar didn't reference. At this point, it was easy enough to try and delete those files before rebuilding, and wouldn't you know: it worked! ### Our use case Now, why do we have tags that are unused in the root spec? Can't we just remove them? That's a good question with a bit of a complicated answer. Unleash uses an open core model and the OpenAPI integration is part of that open core. The closed-source parts of Unleash are located in another repo and extend the open-source distribution. Because the OpenAPI spec is configured in the open-source part, enterprise-only tags etc also need to be configured there. Then, when the changes are absorbed into enterprise, we can use the tags there. It gets more complicated because we use an enterprise instance to generate the docs (because we want enterprise-endpoints to be listed too). The instance uses the latest released instance of Unleash to have the docs most accurately reflect the current state of things. So, in this case, the tags have been added, but not yet used by any endpoints, which suddenly causes this build failure. We can add the tags to the enterprise-version, but the spec wouldn't be updated before the next release regardless, which will probably be in a week or so. This isn't an ideal setup, but .. it is what it is. ## Solutions and workarounds As mentioned in the previous section, the reason the build was failing was that there were unused tag files that docusaurus tried to include in the build. Because they don't belong to a sidebar, the compilation failed. I've reported the issue to the openapi plugin maintainers and am waiting for a response. However, it seems that having unused root tags declared is invalid according to the spec, so it's something we should look into fixing in the future. ### Current workaround: cleaning script The current workaround is to extend the api cleaning script to manually remove the unused tag files. ### Ideal solution: filter root-level tags Ideally, we shouldn't list unused OpenAPI tags on the root level at all. However, because of the way we add root-level tags (as a predefined, static lists, refer to `src/lib/openapi/index.ts`) and endpoints (dynamically added at runtime) today, we don't really have a clear way to filter the list of tags. This gets even more complicated when taking the enterprise functionality and the potential extra tags they must have. This is, however, something that should definitely be looked into. Working with OpenAPI across multipile repos is already troublesome, so this is just yet another thing to look into.
2022-11-11 14:01:54 +01:00
"@docusaurus/module-type-aliases": "2.2.0",
chore(deps): update storybook monorepo to v6.5.15 (#2751) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@storybook/addon-actions](https://togithub.com/storybookjs/storybook/tree/main/addons/actions) ([source](https://togithub.com/storybookjs/storybook)) | [`6.5.14` -> `6.5.15`](https://renovatebot.com/diffs/npm/@storybook%2faddon-actions/6.5.14/6.5.15) | [![age](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-actions/6.5.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-actions/6.5.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-actions/6.5.15/compatibility-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-actions/6.5.15/confidence-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | | [@storybook/addon-essentials](https://togithub.com/storybookjs/storybook/tree/main/addons/essentials) ([source](https://togithub.com/storybookjs/storybook)) | [`6.5.14` -> `6.5.15`](https://renovatebot.com/diffs/npm/@storybook%2faddon-essentials/6.5.14/6.5.15) | [![age](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-essentials/6.5.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-essentials/6.5.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-essentials/6.5.15/compatibility-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-essentials/6.5.15/confidence-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | | [@storybook/addon-interactions](https://togithub.com/storybookjs/storybook/tree/main/addons/interactions) ([source](https://togithub.com/storybookjs/storybook)) | [`6.5.14` -> `6.5.15`](https://renovatebot.com/diffs/npm/@storybook%2faddon-interactions/6.5.14/6.5.15) | [![age](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-interactions/6.5.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-interactions/6.5.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-interactions/6.5.15/compatibility-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-interactions/6.5.15/confidence-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | | [@storybook/addon-links](https://togithub.com/storybookjs/storybook/tree/main/addons/links) ([source](https://togithub.com/storybookjs/storybook)) | [`6.5.14` -> `6.5.15`](https://renovatebot.com/diffs/npm/@storybook%2faddon-links/6.5.14/6.5.15) | [![age](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-links/6.5.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-links/6.5.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-links/6.5.15/compatibility-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@storybook%2faddon-links/6.5.15/confidence-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | | [@storybook/react](https://togithub.com/storybookjs/storybook/tree/main/app/react) ([source](https://togithub.com/storybookjs/storybook)) | [`6.5.14` -> `6.5.15`](https://renovatebot.com/diffs/npm/@storybook%2freact/6.5.14/6.5.15) | [![age](https://badges.renovateapi.com/packages/npm/@storybook%2freact/6.5.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@storybook%2freact/6.5.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@storybook%2freact/6.5.15/compatibility-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@storybook%2freact/6.5.15/confidence-slim/6.5.14)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>storybookjs/storybook</summary> ### [`v6.5.15`](https://togithub.com/storybookjs/storybook/blob/HEAD/CHANGELOG.md#&#8203;6515-December-20-2022) [Compare Source](https://togithub.com/storybookjs/storybook/compare/v6.5.14...v6.5.15) ##### Bug Fixes - Support Angular 15.0.4 [#&#8203;20287](https://togithub.com/storybooks/storybook/pull/20287) - CLI: execute automigrations when pressing enter in the prompts [#&#8203;20208](https://togithub.com/storybooks/storybook/pull/20208) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43My4zIiwidXBkYXRlZEluVmVyIjoiMzQuNzMuMyJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-27 23:50:34 +01:00
"@storybook/addon-actions": "6.5.15",
"@storybook/addon-essentials": "6.5.15",
"@storybook/addon-interactions": "6.5.15",
"@storybook/addon-links": "6.5.15",
"@storybook/react": "6.5.15",
"@storybook/testing-library": "0.0.13",
"@tsconfig/docusaurus": "1.0.6",
chore(deps): update dependency babel-loader to v9.1.2 (#2826) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [babel-loader](https://togithub.com/babel/babel-loader) | [`9.1.0` -> `9.1.2`](https://renovatebot.com/diffs/npm/babel-loader/9.1.0/9.1.2) | [![age](https://badges.renovateapi.com/packages/npm/babel-loader/9.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/babel-loader/9.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/babel-loader/9.1.2/compatibility-slim/9.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/babel-loader/9.1.2/confidence-slim/9.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>babel/babel-loader</summary> ### [`v9.1.2`](https://togithub.com/babel/babel-loader/releases/tag/v9.1.2) [Compare Source](https://togithub.com/babel/babel-loader/compare/v9.1.1...v9.1.2) 9.1.1 was a broken release, it didn't include all the commits. #### Dependencies updates - Bump qs from 6.5.2 to 6.5.3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [https://github.com/babel/babel-loader/pull/977](https://togithub.com/babel/babel-loader/pull/977) - Bump json5 from 2.2.1 to 2.2.3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [https://github.com/babel/babel-loader/pull/980](https://togithub.com/babel/babel-loader/pull/980) #### Misc - GitHub Workflows security hardening by [@&#8203;sashashura](https://togithub.com/sashashura) in [https://github.com/babel/babel-loader/pull/976](https://togithub.com/babel/babel-loader/pull/976) #### New Contributors - [@&#8203;sashashura](https://togithub.com/sashashura) made their first contribution in [https://github.com/babel/babel-loader/pull/976](https://togithub.com/babel/babel-loader/pull/976) **Full Changelog**: https://github.com/babel/babel-loader/compare/v9.1.0...v9.1.2 ### [`v9.1.1`](https://togithub.com/babel/babel-loader/compare/v9.1.0...v9.1.1) [Compare Source](https://togithub.com/babel/babel-loader/compare/v9.1.0...v9.1.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC44MS4wIiwidXBkYXRlZEluVmVyIjoiMzQuODEuMCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-05 02:53:41 +01:00
"babel-loader": "9.1.2",
chore(deps): update dependency enhanced-resolve to v5.12.0 (#2517) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [enhanced-resolve](https://togithub.com/webpack/enhanced-resolve) | [`5.11.0` -> `5.12.0`](https://renovatebot.com/diffs/npm/enhanced-resolve/5.11.0/5.12.0) | [![age](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.12.0/compatibility-slim/5.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.12.0/confidence-slim/5.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>webpack/enhanced-resolve</summary> ### [`v5.12.0`](https://togithub.com/webpack/enhanced-resolve/releases/tag/v5.12.0) [Compare Source](https://togithub.com/webpack/enhanced-resolve/compare/v5.11.0...v5.12.0) - reverts "utilize throwIfNoEntry in sync mode" </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4zMC40IiwidXBkYXRlZEluVmVyIjoiMzQuMzAuNCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-23 22:57:46 +01:00
"enhanced-resolve": "5.12.0",
chore(deps): update react-router monorepo to v6.6.1 (#2762) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-router](https://togithub.com/remix-run/react-router) | [`6.4.5` -> `6.6.1`](https://renovatebot.com/diffs/npm/react-router/6.4.5/6.6.1) | [![age](https://badges.renovateapi.com/packages/npm/react-router/6.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/react-router/6.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/react-router/6.6.1/compatibility-slim/6.4.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/react-router/6.6.1/confidence-slim/6.4.5)](https://docs.renovatebot.com/merge-confidence/) | | [react-router-dom](https://togithub.com/remix-run/react-router) | [`6.4.5` -> `6.6.1`](https://renovatebot.com/diffs/npm/react-router-dom/6.4.5/6.6.1) | [![age](https://badges.renovateapi.com/packages/npm/react-router-dom/6.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/react-router-dom/6.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/react-router-dom/6.6.1/compatibility-slim/6.4.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/react-router-dom/6.6.1/confidence-slim/6.4.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>remix-run/react-router (react-router)</summary> ### [`v6.6.1`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#&#8203;661) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.6.0...react-router@6.6.1) ##### Patch Changes - Updated dependencies: - `@remix-run/router@1.2.1` ### [`v6.6.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#&#8203;660) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.5.0...react-router@6.6.0) ##### Patch Changes - Prevent `useLoaderData` usage in `errorElement` ([#&#8203;9735](https://togithub.com/remix-run/react-router/pull/9735)) - Updated dependencies: - `@remix-run/router@1.2.0` ### [`v6.5.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#&#8203;650) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.4.5...react-router@6.5.0) This release introduces support for [Optional Route Segments](https://togithub.com/remix-run/react-router/issues/9546). Now, adding a `?` to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters. **Optional Params Examples** - `<Route path=":lang?/about>` will match: - `/:lang/about` - `/about` - `<Route path="/multistep/:widget1?/widget2?/widget3?">` will match: - `/multistep` - `/multistep/:widget1` - `/multistep/:widget1/:widget2` - `/multistep/:widget1/:widget2/:widget3` **Optional Static Segment Example** - `<Route path="/home?">` will match: - `/` - `/home` - `<Route path="/fr?/about">` will match: - `/about` - `/fr/about` ##### Minor Changes - Allows optional routes and optional static segments ([#&#8203;9650](https://togithub.com/remix-run/react-router/pull/9650)) ##### Patch Changes - Stop incorrectly matching on partial named parameters, i.e. `<Route path="prefix-:param">`, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the `useParams` call site: ([#&#8203;9506](https://togithub.com/remix-run/react-router/pull/9506)) ```jsx // Old behavior at URL /prefix-123 <Route path="prefix-:id" element={<Comp /> }> function Comp() { let params = useParams(); // { id: '123' } let id = params.id; // "123" ... } // New behavior at URL /prefix-123 <Route path=":id" element={<Comp /> }> function Comp() { let params = useParams(); // { id: 'prefix-123' } let id = params.id.replace(/^prefix-/, ''); // "123" ... } ``` - Updated dependencies: - `@remix-run/router@1.1.0` </details> <details> <summary>remix-run/react-router (react-router-dom)</summary> ### [`v6.6.1`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router-dom/CHANGELOG.md#&#8203;661) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router-dom@6.6.0...react-router-dom@6.6.1) ##### Patch Changes - Updated dependencies: - `@remix-run/router@1.2.1` - `react-router@6.6.1` ### [`v6.6.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router-dom/CHANGELOG.md#&#8203;660) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router-dom@6.5.0...react-router-dom@6.6.0) ##### Minor Changes - Add `useBeforeUnload()` hook ([#&#8203;9664](https://togithub.com/remix-run/react-router/pull/9664)) - Remove `unstable_` prefix from `createStaticHandler`/`createStaticRouter`/`StaticRouterProvider` ([#&#8203;9738](https://togithub.com/remix-run/react-router/pull/9738)) ##### Patch Changes - Proper hydration of `Error` objects from `StaticRouterProvider` ([#&#8203;9664](https://togithub.com/remix-run/react-router/pull/9664)) - Support uppercase `<Form method>` and `useSubmit` method values ([#&#8203;9664](https://togithub.com/remix-run/react-router/pull/9664)) - Skip initial scroll restoration for SSR apps with `hydrationData` ([#&#8203;9664](https://togithub.com/remix-run/react-router/pull/9664)) - Fix `<button formmethod>` form submission overriddes ([#&#8203;9664](https://togithub.com/remix-run/react-router/pull/9664)) - Updated dependencies: - `@remix-run/router@1.2.0` - `react-router@6.6.0` ### [`v6.5.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router-dom/CHANGELOG.md#&#8203;650) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router-dom@6.4.5...react-router-dom@6.5.0) ##### Patch Changes - Updated dependencies: - `react-router@6.5.0` - `@remix-run/router@1.1.0` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43My4zIiwidXBkYXRlZEluVmVyIjoiMzQuNzMuMyJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-28 22:50:42 +01:00
"react-router": "6.6.1",
"replace-in-file": "6.3.5",
"storybook-addon-root-attribute": "1.0.2",
"typescript": "4.8.4"
}
}