Skip to content

[0.85] TypeScript: Restore publishing of underscore-prefixed identifiers in .d.ts - #1912

Merged
robhogan merged 1 commit into
0.85.xfrom
0.85/restore-underscore-types
Sep 7, 2026
Merged

robhogan merged 1 commit into
0.85.xfrom
0.85/restore-underscore-types

Conversation

@robhogan

@robhogan robhogan commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Cherry-pick #1876 to 0.85.x

Changelog:

 - **[Types]**: Restore publishing of private (underscore-prefixed) fields in TypeScript declarations

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 7, 2026
….d.ts (#1876)

Summary:
`flow-api-translator@0.36.0`, which we first used to publish Metro `0.85.0`, changed the default handling of underscore-prefixed identifiers, filtering them out unless `mungeUnderscores: false` was used explicitly.

eg:
https://unpkg.com/metro@0.84.5/src/Server.d.ts
https://unpkg.com/metro@0.85.0/src/Server.d.ts

This meant they silently disappeared from our published `.d.ts` files, which are intended to describe the entire API (including private props).

Bring them back for `.d.ts` only via `mungeUnderscores: false`. Keep the generated API.md snapshots underscore-free, as underscore-prefixed fields are not part of the semver-guaranteed surface.

Pull Request resolved: #1876

Test Plan:
```
yarn run build
```

```
grep _bundler packages/metro/src/Server.d.ts
```

```
grep _bundler packages/metro/types/Server.d.ts
  _bundler: IncrementalBundler;
```

Changelog:
```
 - **[Types]**: Restore publishing of private (underscore-prefixed) fields in TypeScript declarations
```

Reviewed By: javache

Differential Revision: D117215856

Pulled By: vzaidman

fbshipit-source-id: d34ad79d90b683870a187b26ad9f44f411c89e78
@robhogan
robhogan force-pushed the 0.85/restore-underscore-types branch from b215ec1 to 97578d2 Compare September 7, 2026 15:04
@robhogan
robhogan merged commit 7f56fa5 into 0.85.x Sep 7, 2026
13 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant