Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Scalar to a previous version to mitigate an app crash happening when switching between API pages. #2670

Merged
merged 8 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/moody-hairs-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@gitbook/react-openapi': minor
'gitbook': minor
---

Revert scalar to 1.0.87 to mitigate an issue with ApiClientModalProvider
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ Any published GitBook site can be accessed through your local development instan

All pull-requests will be tested against both visual and performances testing to prevent regressions.

## Fonts and Icons

GitBook Open uses fontawesome. During development, your local environment will use the free version. However, only the pro version will be accepted by CI. If you see the following error:

```
The GitBook icon is missing. It indicates that the dependencies were installed without the correct font-awesome package. These changes have probably been persisted in the Bun lockfile. Read the README for more information.
```

It means that you've changed the GBO dependencies and bundled in the free version. Only GitBook staff can help with this - if you're not on the GitBook team, please ping us in the PR and we'll help get things moving.

If you are GitBook staff, you'll need our NPM token in your local environment.

```
.env.local

NPM_TOKEN_READONLY=xxx
```

and then reinstall dependencies.

## Contributing

GitBook's rendering engine is fully open source and built on top of [Next.js](https://nextjs.org/). Head to our [contributing guide](https://github.com/GitbookIO/gitbook/blob/main/.github/CONTRIBUTING.md) to learn more about the workflow on adding your first Pull Request.
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"private": true,
"scripts": {
"dev": "turbo run dev",
"dev": "turbo run dev --ui=stream",
"build": "turbo run build",
"build:cloudflare": "turbo run build:cloudflare",
"lint": "turbo run lint",
Expand Down
3 changes: 2 additions & 1 deletion packages/icons/src/pro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { validateIconName } from './icons';
it('should have the GitBook custom icon', () => {
if (!validateIconName('gitbook')) {
const message =
'The GitBook icon is missing. It indicates that the dependencies were installed without the font-awesome custom package.';
'The GitBook icon is missing. It indicates that the dependencies were installed without the correct font-awesome package. These changes have probably been persisted in the Bun lockfile. Read the README for more information.';

if (process.env.CI) {
throw new Error(message);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"version": "0.7.1",
"dependencies": {
"@scalar/api-client-react": "1.1.2",
"@scalar/api-client-react": "1.0.87",
"classnames": "^2.5.1",
"flatted": "^3.2.9",
"openapi-types": "^12.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-openapi/src/OpenAPIOperation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function OpenAPIOperation(props: {

return (
<ApiClientModalProvider
configuration={{ spec: { url: context.specUrl }, showSidebar: false }}
configuration={{ spec: { url: context.specUrl } }}
initialRequest={{ path: data.path, method: data.method }}
>
<div className={classNames('openapi-operation', className)}>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-openapi/src/ScalarApiButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ScalarApiButton({ method, path }: { method: string; path: string
<button
className="scalar-activate-button"
onClick={() => {
client?.open({ method, path, _source: 'gitbook' });
client?.open({ method, path });
onOpenClient({ method, path });
}}
>
Expand Down
Loading