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

react-native: Use number literals in TypeScript types for FileReader and XMLHttpRequest states #36000

Closed
wants to merge 1 commit into from

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Jan 30, 2023

Summary

Mostly to improve compat in codebases where lib.dom.d.ts is loaded alongside RN. TS 5.0 updates to lib.dom.d.ts added number literals for these states as well so the abstract number type from RN was no longer compatible.

Forward-port of DefinitelyTyped/DefinitelyTyped#64144

Underlying flow types:

Changelog

[GENERAL] [CHANGED] - Use number literals in TypeScript types for FileReader and XMLHttpRequest states

Test Plan

@facebook-github-bot facebook-github-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 Jan 30, 2023
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,463,316 +0
android hermes armeabi-v7a 7,783,671 +0
android hermes x86 8,936,293 +0
android hermes x86_64 8,794,200 +0
android jsc arm64-v8a 9,648,925 +0
android jsc armeabi-v7a 8,383,202 +0
android jsc x86 9,710,897 +0
android jsc x86_64 10,187,754 +0

Base commit: 8d5f880
Branch: main

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 30, 2023
@facebook-github-bot
Copy link
Contributor

@jacdebug merged this pull request in 8568b93.

@eps1lon eps1lon deleted the fix/ts50 branch January 31, 2023 04:34
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…` and `XMLHttpRequest` states (facebook#36000)

Summary:
Mostly to improve compat in codebases where `lib.dom.d.ts` is loaded alongside RN. TS 5.0 updates to `lib.dom.d.ts` added number literals for these states as well so the abstract `number` type from RN was no longer compatible.

Forward-port of DefinitelyTyped/DefinitelyTyped#64144

Underlying flow types:
- https://github.com/facebook/react-native/blob/v0.71.1/Libraries/Blob/FileReader.js#L33-L35
- https://github.com/facebook/react-native/blob/v0.71.1/Libraries/Network/XMLHttpRequest.js#L54-L58

## Changelog

[GENERAL] [CHANGED] - Use number literals in TypeScript types for `FileReader` and `XMLHttpRequest` states

Pull Request resolved: facebook#36000

Test Plan: - [x] DefinitelyTyped/DefinitelyTyped#64144 green

Reviewed By: christophpurrer

Differential Revision: D42849886

Pulled By: jacdebug

fbshipit-source-id: c3cf2ac4f5f53ab889a9190583486da4627d3dcc
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. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants