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

Upgrade glob@7 to glob@10 to resolve deprecation warnings #48875

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

byCedric
Copy link
Contributor

@byCedric byCedric commented Jan 22, 2025

Summary:

This is a long overdue follow-up from #46724, and upgrades the deprecated glob@7 to glob@10.

When creating any React Native project today, you are greeted by a wall of deprecation warnings when installing with npm -- with the most frequent offender being [email protected]. This hurts UX and diminishes developers' trust, even before starting their project.

image

Unfortunately, no flow types are available for glob@9+. I've tried creating a flow definition, but it turns out that the glob@10 types use path-scurry@^1.11.1, minimatch@^9.0.4, and minipass@^7.1.2 -- all without flow type definitions. Writing the flow definitions for glob@9+ is non-trivial work, I'd be happy to help but I can't fix that on my own.

Important

glob@11 has already been released, but it's only supporting Node 20+. I believe React Native still supports Node 18 until the EOL in April 2025, that's why I used glob@10.

Changelog:

[GENERAL] [CHANGED] - Upgrade from deprecated glob@7 to supported glob@10

Test Plan:

  • npm create expo@latest ./test-install-warnings
  • cd ./test-install-warnings
  • rm -rf node_modules
  • npm install
  • npm list [email protected]

Most of the offending packages come from React Native packages, with some from jest/jest-expo.

image

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 22, 2025
@cortinico cortinico requested review from robhogan and huntie February 12, 2025 17:22
@cortinico
Copy link
Contributor

@robhogan @huntie are you folks able to give a sense of how big of an effort this one is going to be?

@huntie huntie self-assigned this Feb 13, 2025
@huntie
Copy link
Member

huntie commented Feb 13, 2025

Looks like just Flow errors. Will import and resolve.

@facebook-github-bot
Copy link
Contributor

@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@huntie
Copy link
Member

huntie commented Feb 18, 2025

@byCedric

  • I've rebased and added valid glob_v10.x.x Flow types.
  • There's one load-bearing call site for users, which we want to validate hasn't broken on Windows (per the glob changelog, thanks @robhogan!):
    • packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js

Will see if I have time to test this today (need to secure a Windows device from around the office).

@byCedric
Copy link
Contributor Author

Hey @huntie! I just got back from my Lunar new year tour. If there is any way I can help test the Glob changes on Windows, lmk. I literally have 2 desktops ready to go for that.

robhogan pushed a commit to facebook/metro that referenced this pull request Feb 26, 2025
Summary:
This is a long overdue follow-up from facebook/react-native#46724, and upgrades the deprecated `glob@7` to `glob@10`.

When creating any React Native project today, you are greeted by a wall of deprecation warnings when installing with `npm` -- with the most frequent offender being `[email protected]`. This hurts UX and diminishes developers' trust, even before starting their project.

<img width="1005" alt="image" src="https://github.com/user-attachments/assets/a5661470-98df-4f3f-8be2-7b0baa9711b6" />

Unfortunately, no [flow types are available for `glob@9+`](https://github.com/flow-typed/flow-typed/tree/main/definitions/npm). I've tried creating a flow definition, but it turns out that the `glob@10` types use `path-scurry@^1.11.1`, `minimatch@^9.0.4`, and `minipass@^7.1.2` -- all without flow type definitions. Writing the flow definitions for glob@9+ is non-trivial work, I'd be happy to help but I can't fix that on my own.

> [!IMPORTANT]
> `glob@11` has already been released, but it's only supporting Node 20+. I believe React Native still supports Node 18 until the EOL in April 2025, that's why I used `glob@10`.

## Changelog:

[GENERAL] [CHANGED] - Upgrade from deprecated `glob@7` to supported `glob@10`

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [CHANGED] - Upgrade from deprecated `glob@7` to supported `glob@10`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

X-link: facebook/react-native#48875

Reviewed By: robhogan, cortinico

Differential Revision: D69594539

Pulled By: huntie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants