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

Introduce support for Docusaurus 3.5.0+ #919

Merged
merged 3 commits into from
Aug 19, 2024
Merged

Introduce support for Docusaurus 3.5.0+ #919

merged 3 commits into from
Aug 19, 2024

Conversation

sserrata
Copy link
Member

Description

Introduces support for latest Docusaurus, i.e. 3.5.0 - 3.5.2. Note that Docusaurus 3.5.0 moved useDoc and DocProvider which required changes that will not be backward compatible with prior Docusaurus versions.

@sserrata sserrata self-assigned this Aug 16, 2024
@sserrata
Copy link
Member Author

#911

Copy link

Size Change: -5.24 MB (-38.76%) 🎉

Total Size: 8.28 MB

Filename Size Change
demo/build/assets/js/1a4e3797.********.js 86 kB +67 B (+0.08%)
demo/build/assets/js/4c5e977b.********.js 76.4 kB -1.97 kB (-2.52%)
demo/build/assets/js/5624.********.js 0 B -10.6 MB (removed) 🏆
demo/build/assets/js/5882.********.js 0 B -96.7 kB (removed) 🏆
demo/build/assets/js/common.********.js 436 kB -2.46 kB (-0.56%)
demo/build/assets/js/main.********.js 630 kB +99.7 kB (+18.81%) ⚠️
demo/build/index.html 85.7 kB -148 B (-0.17%)
demo/build/assets/js/1828.********.js 5.34 MB +5.34 MB (new file) 🆕
demo/build/assets/js/9714.********.js 152 B +152 B (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
demo/.docusaurus/globalData.json 23.1 kB 0 B
demo/build/assets/css/styles.********.css 124 kB -11 B (-0.01%)
demo/build/assets/js/006e727e.********.js 12.5 kB 0 B
demo/build/assets/js/04510fe4.********.js 1.75 kB 0 B
demo/build/assets/js/05f64ae1.********.js 3.08 kB +23 B (+0.75%)
demo/build/assets/js/06e5f0f0.********.js 15.3 kB 0 B
demo/build/assets/js/081bfb0d.********.js 7.27 kB 0 B
demo/build/assets/js/09e07b87.********.js 3.25 kB +23 B (+0.71%)
demo/build/assets/js/0cfc62ff.********.js 444 B 0 B
demo/build/assets/js/0d832478.********.js 19.8 kB 0 B
demo/build/assets/js/0e31c608.********.js 363 B 0 B
demo/build/assets/js/12693653.********.js 19.5 kB 0 B
demo/build/assets/js/14492604.********.js 629 B 0 B
demo/build/assets/js/14eb3368.********.js 9.1 kB -22 B (-0.24%)
demo/build/assets/js/1639936b.********.js 5.69 kB 0 B
demo/build/assets/js/177e86db.********.js 8.31 kB 0 B
demo/build/assets/js/19d75775.********.js 6.33 kB 0 B
demo/build/assets/js/1a8cc2a6.********.js 9.88 kB 0 B
demo/build/assets/js/1c54f54e.********.js 7.85 kB 0 B
demo/build/assets/js/1e6c5cae.********.js 26.1 kB 0 B
demo/build/assets/js/1e6ff21d.********.js 8.35 kB 0 B
demo/build/assets/js/1f818248.********.js 8.97 kB 0 B
demo/build/assets/js/22dd74f7.********.js 45 kB 0 B
demo/build/assets/js/2bb7a9e5.********.js 15.1 kB 0 B
demo/build/assets/js/2c860537.********.js 6.26 kB 0 B
demo/build/assets/js/326c3861.********.js 12.7 kB 0 B
demo/build/assets/js/3431.********.js 1.32 kB 0 B
demo/build/assets/js/3720c009.********.js 1.73 kB 0 B
demo/build/assets/js/3946f914.********.js 25.2 kB 0 B
demo/build/assets/js/39d00f16.********.js 16 kB 0 B
demo/build/assets/js/3e0d14e9.********.js 18.6 kB 0 B
demo/build/assets/js/3fccde26.********.js 2.65 kB 0 B
demo/build/assets/js/40a238b6.********.js 19.5 kB 0 B
demo/build/assets/js/41ad23b9.********.js 443 B 0 B
demo/build/assets/js/41cd56a1.********.js 8.08 kB 0 B
demo/build/assets/js/423cd203.********.js 11.5 kB 0 B
demo/build/assets/js/441ad7e9.********.js 369 B 0 B
demo/build/assets/js/466ac800.********.js 29.7 kB 0 B
demo/build/assets/js/47abaca6.********.js 3.17 kB +23 B (+0.73%)
demo/build/assets/js/483a5060.********.js 586 B 0 B
demo/build/assets/js/4964e910.********.js 17.8 kB 0 B
demo/build/assets/js/499b3970.********.js 373 B 0 B
demo/build/assets/js/49bd3d39.********.js 12.9 kB 0 B
demo/build/assets/js/4b891ed6.********.js 8.96 kB 0 B
demo/build/assets/js/55a6d13f.********.js 12.4 kB 0 B
demo/build/assets/js/56717cba.********.js 3.24 kB +23 B (+0.71%)
demo/build/assets/js/57708823.********.js 5.43 kB 0 B
demo/build/assets/js/57f1a671.********.js 9 kB 0 B
demo/build/assets/js/58ff8b1e.********.js 22.6 kB 0 B
demo/build/assets/js/597ddc40.********.js 7.65 kB 0 B
demo/build/assets/js/59af61a6.********.js 391 B 0 B
demo/build/assets/js/5e95c892.********.js 345 B 0 B
demo/build/assets/js/5f33cfb8.********.js 11.1 kB 0 B
demo/build/assets/js/5fb917be.********.js 2.78 kB 0 B
demo/build/assets/js/63fc267d.********.js 8.5 kB 0 B
demo/build/assets/js/6693.********.js 104 B 0 B
demo/build/assets/js/66c76a57.********.js 26 kB 0 B
demo/build/assets/js/674cd211.********.js 8.27 kB 0 B
demo/build/assets/js/68b61ac5.********.js 31.2 kB 0 B
demo/build/assets/js/69a61f78.********.js 18.5 kB 0 B
demo/build/assets/js/6ad7bd23.********.js 1.56 kB 0 B
demo/build/assets/js/6d85557e.********.js 7.74 kB 0 B
demo/build/assets/js/73b594ee.********.js 26.1 kB 0 B
demo/build/assets/js/77264a1a.********.js 25.2 kB 0 B
demo/build/assets/js/785615ec.********.js 15.1 kB 0 B
demo/build/assets/js/7b96997a.********.js 2.39 kB 0 B
demo/build/assets/js/7ca3ae45.********.js 13.4 kB 0 B
demo/build/assets/js/7ed7dafe.********.js 19.8 kB 0 B
demo/build/assets/js/7ee7d9e7.********.js 1.69 kB 0 B
demo/build/assets/js/7f47b856.********.js 10.4 kB 0 B
demo/build/assets/js/7f6346b9.********.js 5.71 kB 0 B
demo/build/assets/js/83208226.********.js 1.37 kB 0 B
demo/build/assets/js/85d3c400.********.js 3.16 kB +23 B (+0.73%)
demo/build/assets/js/85e11929.********.js 6.71 kB 0 B
demo/build/assets/js/85ec4403.********.js 4.66 kB 0 B
demo/build/assets/js/86b273b1.********.js 8.14 kB 0 B
demo/build/assets/js/86c45737.********.js 22.1 kB 0 B
demo/build/assets/js/8961c7a6.********.js 19.6 kB 0 B
demo/build/assets/js/8973.********.js 104 B 0 B
demo/build/assets/js/8ab9b16e.********.js 7.73 kB 0 B
demo/build/assets/js/8d4e78cd.********.js 3.12 kB +23 B (+0.74%)
demo/build/assets/js/8f441c78.********.js 16.1 kB 0 B
demo/build/assets/js/91696e06.********.js 26.1 kB 0 B
demo/build/assets/js/93304a97.********.js 5.79 kB 0 B
demo/build/assets/js/94589c06.********.js 15.2 kB 0 B
demo/build/assets/js/95d88c92.********.js 8.27 kB 0 B
demo/build/assets/js/96d3d581.********.js 408 B 0 B
demo/build/assets/js/97810f3c.********.js 18.9 kB 0 B
demo/build/assets/js/9b5caaf3.********.js 19.5 kB 0 B
demo/build/assets/js/9c42c0f3.********.js 25 kB 0 B
demo/build/assets/js/a06b4842.********.js 5.75 kB 0 B
demo/build/assets/js/a40c6d71.********.js 5.78 kB 0 B
demo/build/assets/js/a6cd895f.********.js 23 kB 0 B
demo/build/assets/js/a705d98d.********.js 6.46 kB 0 B
demo/build/assets/js/a728d93a.********.js 7.77 kB 0 B
demo/build/assets/js/a7bd4aaa.********.js 695 B -1 B (-0.14%)
demo/build/assets/js/a94703ab.********.js 11 kB -1 B (-0.01%)
demo/build/assets/js/aa2f1ec7.********.js 18.9 kB 0 B
demo/build/assets/js/ab09fd5c.********.js 23.1 kB 0 B
demo/build/assets/js/ab6072f2.********.js 18.5 kB 0 B
demo/build/assets/js/aba21aa0.********.js 172 B 0 B
demo/build/assets/js/ac9f9fec.********.js 9.28 kB 0 B
demo/build/assets/js/ae7f40a3.********.js 31.2 kB 0 B
demo/build/assets/js/aeac4323.********.js 631 B 0 B
demo/build/assets/js/aedd5031.********.js 8.2 kB 0 B
demo/build/assets/js/b2a753ec.********.js 7.86 kB +23 B (+0.29%)
demo/build/assets/js/b4ebd305.********.js 13.4 kB 0 B
demo/build/assets/js/b5c059ef.********.js 25 kB 0 B
demo/build/assets/js/b89b49f4.********.js 6.89 kB 0 B
demo/build/assets/js/baebb6c1.********.js 2.75 kB 0 B
demo/build/assets/js/bc17b4cf.********.js 8.52 kB 0 B
demo/build/assets/js/bdbe39c2.********.js 2.75 kB 0 B
demo/build/assets/js/bead4b8e.********.js 3.29 kB +23 B (+0.7%)
demo/build/assets/js/bf87ce40.********.js 375 B 0 B
demo/build/assets/js/c141421f.********.js 172 B 0 B
demo/build/assets/js/c51aa9b5.********.js 417 B 0 B
demo/build/assets/js/c65697f5.********.js 18.8 kB 0 B
demo/build/assets/js/c7a5be9f.********.js 8.04 kB 0 B
demo/build/assets/js/c7ded1cb.********.js 3.22 kB +23 B (+0.72%)
demo/build/assets/js/cf07762b.********.js 22.2 kB 0 B
demo/build/assets/js/d63c7029.********.js 3.2 kB +23 B (+0.72%)
demo/build/assets/js/dc1ed7fc.********.js 8.19 kB 0 B
demo/build/assets/js/dd696920.********.js 18.8 kB 0 B
demo/build/assets/js/df203c0f.********.js 8 kB -20 B (-0.25%)
demo/build/assets/js/e015ccf9.********.js 19.5 kB 0 B
demo/build/assets/js/e01f8d18.********.js 6.29 kB 0 B
demo/build/assets/js/e5e5340c.********.js 2.63 kB 0 B
demo/build/assets/js/e5f74b05.********.js 379 B 0 B
demo/build/assets/js/e7e42acb.********.js 2.68 kB 0 B
demo/build/assets/js/eae14b71.********.js 24.1 kB 0 B
demo/build/assets/js/eaf4471e.********.js 9.85 kB 0 B
demo/build/assets/js/ee308fa3.********.js 7.58 kB 0 B
demo/build/assets/js/f212caf7.********.js 19.6 kB 0 B
demo/build/assets/js/f283d1c6.********.js 5.33 kB 0 B
demo/build/assets/js/f4486b6b.********.js 9.39 kB 0 B
demo/build/assets/js/f4538a24.********.js 2.63 kB 0 B
demo/build/assets/js/f65290a6.********.js 8.1 kB 0 B
demo/build/assets/js/f8409a7e.********.js 35.6 kB 0 B
demo/build/assets/js/f84e10c2.********.js 14.4 kB 0 B
demo/build/assets/js/fb27f34a.********.js 435 B 0 B
demo/build/assets/js/fcd67c8d.********.js 14.4 kB 0 B
demo/build/assets/js/fe97f0d1.********.js 15.2 kB 0 B
demo/build/assets/js/runtime~main.********.js 10.3 kB 0 B

compressed-size-action

Copy link

Visit the preview URL for this PR (updated for commit b06fdcc):

https://docusaurus-openapi-36b86--pr919-xgjyuhft.web.app

(expires Sun, 15 Sep 2024 16:15:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata sserrata merged commit 02e0ae8 into main Aug 19, 2024
13 checks passed
@sserrata sserrata deleted the 3.5.2 branch August 19, 2024 20:35
import type { Props } from "@theme/DocItem";
import DocItemLayout from "@theme/DocItem/Layout";
Copy link
Contributor

@IanVS IanVS Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this change caused a visual update to generated API pages. Previously, the pagination at the bottom of the page was constrained to the center portion of the page, now after this update, the pagination also stretches into the right sidebar. We prefer the way it was previously. Is there any way to restore that?

Before:
image

After:
Arc 2024-08-27 08 48 39

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @IanVS! I thought I could get away with not including Layout in our theme but didn't notice this side effect. Should be an easy fix.

If you need a fix sooner, you can swizzle Layout and use the useDoc hook to extract api from front matter, which can be used to conditionally set the footer/paginator col width:

Snippet:

<div className="row">
  <div className={clsx("col", !docTOC.hidden && styles.docItemCol)}>
    {unlisted && <Unlisted />}
    <DocVersionBanner />
    <div className={styles.docItemContainer}>
      <article>
        <DocBreadcrumbs />
        <DocVersionBadge />
        {docTOC.mobile}
        <DocItemContent>{children}</DocItemContent>
        <div className="row">
          <div className={clsx("col", api ? "col--7" : "col--12")}>
            <DocItemFooter />
          </div>
        </div>
      </article>
      <div className="row">
        <div className={clsx("col", api ? "col--7" : "col--12")}>
          <DocItemPaginator />
        </div>
      </div>
    </div>
  </div>
  {docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
</div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I caught it because of a visual regression testing tool, have you considered adding something like that to the demo, to catch small changes like this that are potentially easy to miss?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have - would you be willing to share your setup? I know Docusaurus uses Playwright + Argos, but I was hoping for something self-contained that can run entirely in GH Actions. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used Percy in the past and recently switched to using lost-pixel. I'm using their platform version via a github action (which is free for open source projects), but they also have a purely open-source self-hosted model available that would probably meet your needs from what I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants