react-native icon indicating copy to clipboard operation
react-native copied to clipboard

update TypeScript dependencies

Open paulschreiber opened this issue 1 year ago • 13 comments

Summary:

Update TypeScript dependencies to support TypeScript 5.4.

TypeScript 5.4 support was added in eslint-plugin 7.2.0 Updating to current version (7.6.0).

Changelog:

[INTERNAL] [CHANGED] - Update @typescript-eslint modules.

Test Plan:

Run standard unit and integration tests.

paulschreiber avatar Apr 08 '24 20:04 paulschreiber

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,217,872 -4
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,594,636 +20
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: eae5d97113ba359d6a6c131cd6831f12ce6d1390 Branch: main

analysis-bot avatar Apr 08 '24 21:04 analysis-bot

Also add "typescript": "^5.4.4" to the package.json

joe-sam avatar Apr 09 '24 01:04 joe-sam

@joe-sam which package.json? This same one? If so, in which section?

paulschreiber avatar Apr 09 '24 01:04 paulschreiber

@joe-sam which package.json? This same one? If so, in which section?

Not sure which ones probably at minimum the main react-native package.json and the template package.json and as far as I know these are all devDependencies sections and do not affect the runtime. Typescript has not been bumped up since last year and we could all benefit with some of the new semantics.

Best avoid use the caret (^) as that might cause some unexpected compile problems later in the project lifetime. "typescript": "5.4.4" https://github.com/facebook/react-native/pull/36862

see https://github.com/paulschreiber/react-native/commit/d2e446d98f322d7c5f98c3abd5abb59d12367ea9

joe-sam avatar Apr 09 '24 02:04 joe-sam

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

facebook-github-bot avatar Apr 09 '24 11:04 facebook-github-bot

@paulschreiber the Node that we have on CircleCI (v18.16.0) is incompatible with what's required this change (v18.18.0). We're currently discussing what to do about this.

dmytrorykun avatar Apr 09 '24 13:04 dmytrorykun

@dmytrorykun Should I update typescript to 5.4.4 in this PR? Or should that be handled separately?

paulschreiber avatar Apr 09 '24 14:04 paulschreiber

@paulschreiber I think let's wait until we land this.

dmytrorykun avatar Apr 09 '24 14:04 dmytrorykun

The difficult part with this sort of dependency change is the circular logic usually getting the types/react to sync to the react lib version bump and then in turn having to fix all the breaking change caused by having all the apps to follow suit. Since react 18 is already supported out of the box these type definition upgrades have already been made upto the latest major version release.

I am already using typescript 5.4.4 with yarn tsc without bumping the parser plugins in an older react-native supported version and an IDE linter plugin, and have experienced no issues at all. In fact am happy to note some false positives in the linter were fixed with the update. Since the plugin anyway supports 5.4 it makes sense to sync the latest patch release typescript 5.4.4 it into this version within this commit iteration. If it causes it to fails fast we should know straightaway and can report that to the devs of the plugin. Otherwise you might experience TYPE 1/ TYPE 2 errors and not know if your commit was actually working !!!

joe-sam avatar Apr 12 '24 03:04 joe-sam

What is this blocked on?

paulschreiber avatar Jun 24 '24 14:06 paulschreiber

Hey @robhogan do you know what is the latest on this?

dmytrorykun avatar Jun 25 '24 13:06 dmytrorykun

TypeScript 5.5.x is now out.

paulschreiber avatar Jun 25 '24 15:06 paulschreiber

Here is the blog announcing all the amazing benefits of upgrading straight upto typescript 5.5 for React Native developers !

joe-sam avatar Jun 27 '24 05:06 joe-sam

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

react-native-bot avatar Aug 14 '25 05:08 react-native-bot

This PR was closed because it has been stalled for 7 days with no activity.

react-native-bot avatar Aug 21 '25 05:08 react-native-bot