Skip to content

Breaking: Use named exports in metro-babel-register#52564

Closed
robhogan wants to merge 2 commits into
mainfrom
export-D78157559
Closed

Breaking: Use named exports in metro-babel-register#52564
robhogan wants to merge 2 commits into
mainfrom
export-D78157559

Conversation

@robhogan
Copy link
Copy Markdown
Contributor

Summary:
Currently, metro-babel-register has a function as its default export, to which we've tagged on various properties.

This tidies that up to a more idiomatic object of named exports, with register as a new one of them.

This also serves to make it more compatible with automatic TypeScript generation.

This is semver breaking, but metro-babel-register has very little usage outside Meta projects so isn't expected to be disruptive.

Changelog: [Internal]

Metro changelog:

 - **[Breaking]**: Move metro-babel-register's main function to a named export `register`

Differential Revision: D78157559

@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: Facebook Partner: Facebook Partner labels Jul 11, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78157559

robhogan added 2 commits July 11, 2025 05:18
…52561)

Summary:

The removed code comment is pretty clear that this workaround is in place for a specific bug, which was closed in a Node.js 8.x minor: nodejs/node#13391

A related issue descibed a problem that still existed in Node 10:
nodejs/node#27363

Subsequent comments reporting problems with newer Node.js versions all seem to relate to mismatched configuration with load balancers, not directly relevant to Metro.

Reproducers for the original bugs no longer repro on new Node.js (tested with 22.14), so I think it's safe to conclude this is fixed.

Changelog: [Internal]

Differential Revision: D78158427
Summary:

Currently, `metro-babel-register` has a function as its default export, to which we've tagged on various properties.

This tidies that up to a more idiomatic object of named exports, with `register` as a new one of them.

This also serves to make it more compatible with automatic TypeScript generation.

This is semver breaking, but `metro-babel-register` has very little usage outside Meta projects so isn't expected to be disruptive.

Changelog: [Internal]

Metro changelog:
```
 - **[Breaking]**: Move metro-babel-register's main function to a named export `register`
```

Differential Revision: D78157559
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78157559

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 11, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in ec5bde6.

facebook-github-bot pushed a commit to facebook/metro that referenced this pull request Jul 11, 2025
Summary:
X-link: facebook/react-native#52564

Currently, `metro-babel-register` has a function as its default export, to which we've tagged on various properties.

This tidies that up to a more idiomatic object of named exports, with `register` as a new one of them.

This also serves to make it more compatible with automatic TypeScript generation.

This is semver breaking, but `metro-babel-register` has very little usage outside Meta projects so isn't expected to be disruptive.

Changelog: [Internal]

Metro changelog:
```
 - **[Breaking]**: Move metro-babel-register's main function to a named export `register`
```

Reviewed By: huntie

Differential Revision: D78157559

fbshipit-source-id: c59c9820e9895007345561fed9ccec2273b925c8
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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants