react-native-tvos 0.73.0-0rc3 → 0.73.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/RCTLegacyInteropComponents.mm +5 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/README.md +21 -3
- package/React/Base/RCTVersion.m +2 -2
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +33 -38
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/components/view/propsConversions.h +1 -2
- package/package.json +7 -7
- package/scripts/cocoapods/utils.rb +2 -1
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/ios/Podfile +23 -20
- package/template/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
/*
|
|
2
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
4
|
*
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
|
|
12
13
|
+ (NSArray<NSString *> *)legacyInteropComponents
|
|
13
14
|
{
|
|
14
|
-
return @[
|
|
15
|
+
return @[
|
|
16
|
+
@"RNTMyLegacyNativeView",
|
|
17
|
+
@"RNTMyNativeView"
|
|
18
|
+
];
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@end
|
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ You should also install `yarn` globally, as it should be used instead of `npm` f
|
|
|
40
40
|
|
|
41
41
|
## Build changes
|
|
42
42
|
|
|
43
|
-
- _Native layer for Apple TV_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'.
|
|
43
|
+
- _Native layer for Apple TV_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'. Changes in the React Native podspecs in 0.73 now require that your application `Podfile` only have one target. This repo supports either an iOS target or a tvOS target, but both targets should not be active at the same time. The new app template now has the iOS target commented out.
|
|
44
44
|
- _Maven artifacts for Android TV_: In 0.71, the React Native Android prebuilt archives are published to Maven instead of being included in the NPM. We are following the same model, except that the Maven artifacts will be in group `io.github.react-native-tvos` instead of `com.facebook.react`. The `@react-native/gradle-plugin` module has been upgraded so that the Android dependencies will be detected correctly during build.
|
|
45
45
|
|
|
46
|
-
## New
|
|
46
|
+
## _(New)_ Project creation using the Expo CLI
|
|
47
47
|
|
|
48
48
|
> _Pitfall:_ Make sure you do not globally install `react-native` or `react-native-tvos`. If you have done this the wrong way, you may get error messages like `ld: library not found for -lPods-TestApp-tvOS`.
|
|
49
49
|
|
|
@@ -70,7 +70,25 @@ npx expo run:ios --scheme MyApp --device "iPhone 15"
|
|
|
70
70
|
npx expo run:android --device tv_api_31
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app
|
|
73
|
+
See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app. Expo SDK support requires a different project configuration as described below.)
|
|
74
|
+
|
|
75
|
+
## _(New)_ Using the Expo SDK with TV apps
|
|
76
|
+
|
|
77
|
+
Starting with the Expo SDK 50 preview, and react-native-tvos 0.73.x, it will be possible to create Expo apps, and build them for TV via a new config plugin.
|
|
78
|
+
|
|
79
|
+
This functionality will be new in Expo SDK 50, and will be considered an experimental feature for now.
|
|
80
|
+
|
|
81
|
+
The fastest way to generate a new project is described in the [TV Example](https://github.com/expo/examples/tree/master/with-tv) in the Expo examples repo.
|
|
82
|
+
|
|
83
|
+
Besides most of the core Expo modules, these also work on TV:
|
|
84
|
+
|
|
85
|
+
- expo-av
|
|
86
|
+
- expo-image
|
|
87
|
+
- expo-localization
|
|
88
|
+
- expo-updates
|
|
89
|
+
|
|
90
|
+
TV does NOT support dev client (dev menu, dev launcher) at this time.
|
|
91
|
+
TV does NOT support Expo Router at this time.
|
|
74
92
|
|
|
75
93
|
## Code changes
|
|
76
94
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(73),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(1),
|
|
27
|
+
RCTVersionPrerelease: @"1",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java
CHANGED
|
@@ -75,16 +75,6 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
|
|
|
75
75
|
view.setAdjustFontSizeToFit(adjustsFontSizeToFit);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
@ReactProp(name = ViewProps.ALLOW_FONT_SCALING, defaultBoolean = true)
|
|
79
|
-
public void setAllowFontScaling(ReactTextView view, boolean allowFontScaling) {
|
|
80
|
-
view.setAllowFontScaling(allowFontScaling);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@ReactProp(name = ViewProps.MAX_FONT_SIZE_MULTIPLIER, defaultFloat = Float.NaN)
|
|
84
|
-
public void setMaxFontSizeMultiplier(ReactTextView view, float maxFontSizeMultiplier) {
|
|
85
|
-
view.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
78
|
@ReactProp(name = ViewProps.FONT_SIZE)
|
|
89
79
|
public void setFontSize(ReactTextView view, float fontSize) {
|
|
90
80
|
view.setFontSize(fontSize);
|
|
@@ -58,6 +58,8 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
58
58
|
private int mNumberOfLines;
|
|
59
59
|
private TextUtils.TruncateAt mEllipsizeLocation;
|
|
60
60
|
private boolean mAdjustsFontSizeToFit;
|
|
61
|
+
private float mFontSize = Float.NaN;
|
|
62
|
+
private float mLetterSpacing = Float.NaN;
|
|
61
63
|
private int mLinkifyMaskType;
|
|
62
64
|
private boolean mNotifyOnInlineViewLayout;
|
|
63
65
|
private boolean mTextIsSelectable;
|
|
@@ -65,12 +67,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
65
67
|
private ReactViewBackgroundManager mReactBackgroundManager;
|
|
66
68
|
private Spannable mSpanned;
|
|
67
69
|
|
|
68
|
-
/**
|
|
69
|
-
* Used to collect some text size affecting attributes to fix some text cut-off issues when users
|
|
70
|
-
* adjust text size and font weight to the max value in system font settings.
|
|
71
|
-
*/
|
|
72
|
-
private TextAttributes mTextAttributes;
|
|
73
|
-
|
|
74
70
|
public ReactTextView(Context context) {
|
|
75
71
|
super(context);
|
|
76
72
|
|
|
@@ -102,7 +98,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
102
98
|
mEllipsizeLocation = TextUtils.TruncateAt.END;
|
|
103
99
|
|
|
104
100
|
mSpanned = null;
|
|
105
|
-
mTextAttributes = new TextAttributes();
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
/* package */ void recycleView() {
|
|
@@ -592,6 +587,29 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
592
587
|
mAdjustsFontSizeToFit = adjustsFontSizeToFit;
|
|
593
588
|
}
|
|
594
589
|
|
|
590
|
+
public void setFontSize(float fontSize) {
|
|
591
|
+
mFontSize =
|
|
592
|
+
mAdjustsFontSizeToFit
|
|
593
|
+
? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))
|
|
594
|
+
: (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));
|
|
595
|
+
|
|
596
|
+
applyTextAttributes();
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public void setLetterSpacing(float letterSpacing) {
|
|
600
|
+
if (Float.isNaN(letterSpacing)) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
float letterSpacingPixels = PixelUtil.toPixelFromDIP(letterSpacing);
|
|
605
|
+
|
|
606
|
+
// `letterSpacingPixels` and `getEffectiveFontSize` are both in pixels,
|
|
607
|
+
// yielding an accurate em value.
|
|
608
|
+
mLetterSpacing = letterSpacingPixels / mFontSize;
|
|
609
|
+
|
|
610
|
+
applyTextAttributes();
|
|
611
|
+
}
|
|
612
|
+
|
|
595
613
|
public void setEllipsizeLocation(TextUtils.TruncateAt ellipsizeLocation) {
|
|
596
614
|
mEllipsizeLocation = ellipsizeLocation;
|
|
597
615
|
}
|
|
@@ -607,8 +625,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
607
625
|
? null
|
|
608
626
|
: mEllipsizeLocation;
|
|
609
627
|
setEllipsize(ellipsizeLocation);
|
|
610
|
-
|
|
611
|
-
applyTextAttributes();
|
|
612
628
|
}
|
|
613
629
|
|
|
614
630
|
@Override
|
|
@@ -664,37 +680,16 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
664
680
|
return super.dispatchHoverEvent(event);
|
|
665
681
|
}
|
|
666
682
|
|
|
667
|
-
public void setLetterSpacing(float letterSpacing) {
|
|
668
|
-
mTextAttributes.setLetterSpacing(letterSpacing);
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
public void setAllowFontScaling(boolean allowFontScaling) {
|
|
672
|
-
if (mTextAttributes.getAllowFontScaling() != allowFontScaling) {
|
|
673
|
-
mTextAttributes.setAllowFontScaling(allowFontScaling);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
public void setFontSize(float fontSize) {
|
|
678
|
-
mTextAttributes.setFontSize(fontSize);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
public void setMaxFontSizeMultiplier(float maxFontSizeMultiplier) {
|
|
682
|
-
if (maxFontSizeMultiplier != mTextAttributes.getMaxFontSizeMultiplier()) {
|
|
683
|
-
mTextAttributes.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
|
|
687
683
|
private void applyTextAttributes() {
|
|
688
|
-
//
|
|
689
|
-
//
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
684
|
+
// Workaround for an issue where text can be cut off with an ellipsis when
|
|
685
|
+
// using certain font sizes and padding. Sets the provided text size and
|
|
686
|
+
// letter spacing to ensure consistent rendering and prevent cut-off.
|
|
687
|
+
if (!Float.isNaN(mFontSize)) {
|
|
688
|
+
setTextSize(TypedValue.COMPLEX_UNIT_PX, mFontSize);
|
|
689
|
+
}
|
|
694
690
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
super.setLetterSpacing(effectiveLetterSpacing);
|
|
691
|
+
if (!Float.isNaN(mLetterSpacing)) {
|
|
692
|
+
super.setLetterSpacing(mLetterSpacing);
|
|
698
693
|
}
|
|
699
694
|
}
|
|
700
695
|
}
|
|
@@ -17,8 +17,8 @@ namespace facebook::react {
|
|
|
17
17
|
constexpr struct {
|
|
18
18
|
int32_t Major = 0;
|
|
19
19
|
int32_t Minor = 73;
|
|
20
|
-
int32_t Patch =
|
|
21
|
-
std::string_view Prerelease = "
|
|
20
|
+
int32_t Patch = 1;
|
|
21
|
+
std::string_view Prerelease = "1";
|
|
22
22
|
} ReactNativeVersion;
|
|
23
23
|
|
|
24
24
|
} // namespace facebook::react
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
#include <react/renderer/components/view/conversions.h>
|
|
11
11
|
#include <react/renderer/core/PropsParserContext.h>
|
|
12
12
|
#include <react/renderer/core/propsConversions.h>
|
|
13
|
-
#include <butter/map.h>
|
|
14
13
|
|
|
15
14
|
#include <optional>
|
|
16
15
|
|
|
@@ -561,7 +560,7 @@ inline void fromRawValue(
|
|
|
561
560
|
const PropsParserContext &,
|
|
562
561
|
const RawValue &value,
|
|
563
562
|
TVParallaxProperties &result) {
|
|
564
|
-
auto map = (
|
|
563
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
565
564
|
|
|
566
565
|
auto enabled = map.find("enabled");
|
|
567
566
|
if (enabled != map.end()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.1-1",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -94,16 +94,16 @@
|
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
97
|
-
"@react-native-community/cli": "12.
|
|
98
|
-
"@react-native-community/cli-platform-android": "12.
|
|
99
|
-
"@react-native-community/cli-platform-ios": "12.
|
|
97
|
+
"@react-native-community/cli": "12.3.0",
|
|
98
|
+
"@react-native-community/cli-platform-android": "12.3.0",
|
|
99
|
+
"@react-native-community/cli-platform-ios": "12.3.0",
|
|
100
100
|
"@react-native/assets-registry": "^0.73.1",
|
|
101
|
-
"@react-native/community-cli-plugin": "
|
|
101
|
+
"@react-native/community-cli-plugin": "0.73.11",
|
|
102
102
|
"@react-native/codegen": "^0.73.2",
|
|
103
103
|
"@react-native/gradle-plugin": "^0.73.4",
|
|
104
104
|
"@react-native/js-polyfills": "^0.73.1",
|
|
105
105
|
"@react-native/normalize-colors": "^0.73.2",
|
|
106
|
-
"@react-native/virtualized-lists": "^0.73.
|
|
106
|
+
"@react-native/virtualized-lists": "^0.73.4",
|
|
107
107
|
"abort-controller": "^3.0.0",
|
|
108
108
|
"anser": "^1.4.9",
|
|
109
109
|
"ansi-regex": "^5.0.0",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
]
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
|
-
"react-native-core": "npm:react-native@0.73.
|
|
153
|
+
"react-native-core": "npm:react-native@0.73.1"
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -564,7 +564,8 @@ class ReactNativePodsUtils
|
|
|
564
564
|
"NSAppTransportSecurity" => ats_configs
|
|
565
565
|
}
|
|
566
566
|
else
|
|
567
|
-
plist["NSAppTransportSecurity"]
|
|
567
|
+
plist["NSAppTransportSecurity"] ||= {}
|
|
568
|
+
plist["NSAppTransportSecurity"] = plist["NSAppTransportSecurity"].merge(ats_configs)
|
|
568
569
|
end
|
|
569
570
|
Xcodeproj::Plist.write_to_path(plist, fullPlistPath)
|
|
570
571
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/ios/Podfile
CHANGED
|
@@ -18,27 +18,30 @@ if linkage != nil
|
|
|
18
18
|
use_frameworks! :linkage => linkage.to_sym
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
target
|
|
22
|
-
|
|
23
|
-
platform :ios, min_ios_version_supported
|
|
21
|
+
####### For now, only one target at a time can be used in a React Native podfile ########
|
|
22
|
+
####### https://github.com/react-native-tvos/react-native-tvos/issues/619 ########
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
# target 'HelloWorld' do
|
|
25
|
+
# config = use_native_modules!
|
|
26
|
+
# platform :ios, min_ios_version_supported
|
|
27
|
+
#
|
|
28
|
+
# use_react_native!(
|
|
29
|
+
# :path => config[:reactNativePath],
|
|
30
|
+
# # Enables Flipper.
|
|
31
|
+
# #
|
|
32
|
+
# # Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
33
|
+
# # you should disable the next line.
|
|
34
|
+
# :flipper_configuration => flipper_config,
|
|
35
|
+
# # An absolute path to your application root.
|
|
36
|
+
# :app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
37
|
+
# )
|
|
38
|
+
#
|
|
39
|
+
# target 'HelloWorldTests' do
|
|
40
|
+
# inherit! :complete
|
|
41
|
+
# # Pods for testing
|
|
42
|
+
# end
|
|
43
|
+
#
|
|
44
|
+
# end
|
|
42
45
|
|
|
43
46
|
target 'HelloWorld-tvOS' do
|
|
44
47
|
config = use_native_modules!
|
package/template/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"test": "jest"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"expo": "^
|
|
14
|
+
"expo": "^50.0.0-preview.4",
|
|
15
15
|
"react": "18.2.0",
|
|
16
|
-
"react-native": "npm:react-native-tvos@0.73.
|
|
16
|
+
"react-native": "npm:react-native-tvos@0.73.1-1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@babel/core": "^7.20.0",
|