Skip to content

chore: switch to tinyglobby#11042

Merged
slorber merged 40 commits into
facebook:mainfrom
benmccann:tinyglobby
Jun 12, 2026
Merged

chore: switch to tinyglobby#11042
slorber merged 40 commits into
facebook:mainfrom
benmccann:tinyglobby

Conversation

@benmccann

Copy link
Copy Markdown
Contributor

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

https://npmgraph.js.org/?q=globby - 23 dependencies
https://npmgraph.js.org/?q=tinyglobby - 2 dependencies

Test Plan

Rely on existing unit tests since this is a refactor and doesn't add any new functionality

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

Discussed in #11020 (comment)

@github-actions

github-actions Bot commented Mar 28, 2025

Copy link
Copy Markdown

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 44 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🔴 47 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 72 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 61 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🔴 45 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 62 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 72 🟢 100 🟢 100 🟠 86 Report

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Apr 4, 2025
@netlify

netlify Bot commented Apr 8, 2025

Copy link
Copy Markdown

[V2]

Name Link
🔨 Latest commit f2b3e18
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a2c417765a6680008784bc3
😎 Deploy Preview https://deploy-preview-11042--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@slorber slorber marked this pull request as draft April 8, 2025 14:39
@slorber

slorber commented Apr 8, 2025

Copy link
Copy Markdown
Collaborator

I tried to update the PR but tinyglobby seems to introduce problems we don't have with original globby

Not sure what is happening but this unit test timeouts in both our CI and on my computer:

yarn install
yarn test packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts

I can clearly see tinyglobby doesn't return anything and blocks the tests

The parameters are:

      globPaths: [
        '../../../../../var/folders/5r/rf5fj2ms2tv4_2fdhcxcnwbm0000gn/T/jest-createTmpSiteDir-45448-tk3qr3eGPkKO/src',
        '../../../../../var/folders/5r/rf5fj2ms2tv4_2fdhcxcnwbm0000gn/T/jest-createTmpSiteDir-45448-qOVHltphU5e0/subpath/**/*.{js,jsx,ts,tsx}',
        '../../../../../var/folders/5r/rf5fj2ms2tv4_2fdhcxcnwbm0000gn/T/jest-createTmpSiteDir-45448-qOVHltphU5e0/src/theme',
        '../../../../../var/folders/5r/rf5fj2ms2tv4_2fdhcxcnwbm0000gn/T/jest-createTmpSiteDir-45448-lpQQgC3uqiBy/subpath/**/*.{js,jsx,ts,tsx}',
        '../../../../../var/folders/5r/rf5fj2ms2tv4_2fdhcxcnwbm0000gn/T/jest-createTmpSiteDir-45448-lpQQgC3uqiBy/src/theme'
      ],

Any idea @SuperchupuDev ?

@benmccann benmccann mentioned this pull request Apr 8, 2025
3 tasks
@SuperchupuDev

SuperchupuDev commented Apr 8, 2025

Copy link
Copy Markdown

there's an fdir issue in some cases that makes this hang, the hang isn't common but it can happen. the fix is currently on fdir's main branch, i'm waiting for a release which should hopefully happen this week

@benmccann

Copy link
Copy Markdown
Contributor Author

I'll come back to this after the fdir release then. For future reference, the affected function is globTranslatableSourceFiles which calls tinyglobby with /tmp/jest-createTmpSiteDir-2151983-O1b2L2hxiTCF/src,/tmp/jest-createTmpSiteDir-2151983-A0re2B0kXWVk/subpath/**/*.{js,jsx,ts,tsx},/tmp/jest-createTmpSiteDir-2151983-A0re2B0kXWVk/src/theme,/tmp/jest-createTmpSiteDir-2151983-bPilA0xX1aPL/subpath/**/*.{js,jsx,ts,tsx},/tmp/jest-createTmpSiteDir-2151983-bPilA0xX1aPL/src/theme

@benmccann benmccann marked this pull request as ready for review April 19, 2025 20:22
@benmccann

benmccann commented Apr 19, 2025

Copy link
Copy Markdown
Contributor Author

@slorber I've updated this PR to use the latest tinyglobby/fdir release, so yarn test packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts no longer times out and now passes on Linux. It looks like tinyglobby still needs to be tweaked to get it passing on the Windows Tests CI job, so I'll do that

I'm not sure what some of these other CI errors are that appear unrelated to the PR though. E.g.

Error: src/components/HomepageFeatures/index.tsx(15,10): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

This reverts commit 346a349.
@slorber slorber marked this pull request as ready for review January 1, 2026 10:59
@slorber slorber added the pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. label Jan 1, 2026
@slorber

slorber commented Jan 1, 2026

Copy link
Copy Markdown
Collaborator

This seems to be working fine now, we'll merge this for v4

@slorber

slorber commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

LGTM 👍

We may move to native Nodejs glob() in the future, but I'm not super confident doing so right now.

See also #12153

@slorber slorber merged commit e551c9a into facebook:main Jun 12, 2026
35 of 37 checks passed
@slorber slorber mentioned this pull request Jun 12, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: maintenance This PR does not produce any behavior differences to end users when upgrading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants