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

WIP: RN 76 #28126

Open
wants to merge 11 commits into
base: nojima/HOTPOT-HOTPOT-expo-51-mergedown1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rnmodules/react-native-kb/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ target_link_libraries(
${LOG_LIB}
fbjni::fbjni
ReactAndroid::jsi
ReactAndroid::turbomodulejsijni
ReactAndroid::react_nativemodule_core
# ReactAndroid::turbomodulejsijni
# ReactAndroid::react_nativemodule_core
ReactAndroid::reactnative
android
)
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ internal class KbModule(reactContext: ReactApplicationContext?) : KbSpec(reactCo


// only old arch, uncomment
override fun getConstants(): MutableMap<String, Any>? {
return getTypedExportedConstants()
}
// override fun getConstants(): MutableMap<String, Any>? {
// return getTypedExportedConstants()
// }

// newarch @Override
override fun getTypedExportedConstants(): MutableMap<String, Any> {
Expand Down Expand Up @@ -354,14 +354,14 @@ internal class KbModule(reactContext: ReactApplicationContext?) : KbSpec(reactCo
.addOnCompleteListener(OnCompleteListener { task ->
if (!task.isSuccessful()) {
NativeLogger.info("Fetching FCM registration token failed " + task.getException())
promise.reject(task.getException())
promise.reject("Fetching FCM registration token failed")
return@OnCompleteListener
}

// Get new FCM registration token
val token: String? = task.result
if (token == null) {
promise.reject(task.getException())
promise.reject("null token")
return@OnCompleteListener
}
NativeLogger.info("Got token: $token")
Expand Down
2 changes: 1 addition & 1 deletion rnmodules/react-native-kb/ios/Kb.mm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ - (NSDictionary *)constantsToExport {
});
}

BOOL isBridgeless = false; // SYNC with AppDelegate.mm
BOOL isBridgeless = true; // SYNC with AppDelegate.mm

#if defined(RCT_NEW_ARCH_ENABLED)
@synthesize runtimeExecutor = _runtimeExecutor;
Expand Down
1 change: 1 addition & 0 deletions shared/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.soloader.SoLoader
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import expo.modules.ApplicationLifecycleDispatcher.onApplicationCreate
import expo.modules.ApplicationLifecycleDispatcher.onConfigurationChanged
import io.keybase.ossifrage.modules.BackgroundSyncWorker
Expand Down Expand Up @@ -61,7 +62,7 @@ class MainApplication : Application(), ReactApplication {
override fun onCreate() {
NativeLogger.info("MainApplication created")
super.onCreate()
SoLoader.init(this, /* native exopackage */false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load(bridgelessEnabled = true)
Expand Down
6 changes: 3 additions & 3 deletions shared/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
Expand Down
4 changes: 2 additions & 2 deletions shared/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
#android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand All @@ -21,7 +21,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
# RUN A CLEAN if you change this
newArchEnabled=false
newArchEnabled=true
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
Expand Down
2 changes: 1 addition & 1 deletion shared/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Mon May 06 15:15:57 PDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion shared/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$(cd "${APP_HOME:-./}" >/dev/null && pwd -P) || exit
APP_HOME=$(cd -P "${APP_HOME:-./}" >/dev/null && printf '%s
' "$PWD") || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions shared/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
18 changes: 9 additions & 9 deletions shared/chat/audio/audio-recorder.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ const useTooltip = () => {
if (showTooltip === lastShowTooltipRef.current) return
lastShowTooltipRef.current = showTooltip
if (showTooltip) {
opacitySV.set(() =>
opacitySV.set(
withSequence(withTiming(1, {duration: 200}), withDelay(1000, withTiming(0, {duration: 200})))
)

const id = setTimeout(() => {
setShowTooltip(false)
}, 1400)
Expand Down Expand Up @@ -119,7 +120,7 @@ const useIconAndOverlay = (p: {

const onReset = React.useCallback(() => {
'worklet'
fadeSV.set(() => withTiming(0, {duration: 200}))
fadeSV.set(withTiming(0, {duration: 200}))
dragXSV.set(0)
dragYSV.set(0)
lockedSV.set(0)
Expand Down Expand Up @@ -167,7 +168,7 @@ const useIconAndOverlay = (p: {
return
}
startedSV.set(1)
fadeSV.set(() => withSpring(1, {duration: 200}))
fadeSV.set(withSpring(1, {duration: 200}))
startRecording()
}

Expand All @@ -178,6 +179,7 @@ const useIconAndOverlay = (p: {
}
const cleanupOverlayTimeout = () => {
clearTimeout(id)
// eslint-disable-next-line
id = 0
}

Expand Down Expand Up @@ -214,7 +216,7 @@ const useIconAndOverlay = (p: {
if (!panLocked) {
runOnJS(sendRecording)()
onReset()
fadeSV.set(() => withTiming(0, {duration: 200}))
fadeSV.set(withTiming(0, {duration: 200}))
}
})
.onUpdate((e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {
Expand All @@ -224,10 +226,8 @@ const useIconAndOverlay = (p: {
}
const maxCancelDrift = -120
const maxLockDrift = -100
dragYSV.set(() =>
interpolate(e.translationY, [maxLockDrift, 0], [maxLockDrift, 0], Extrapolation.CLAMP)
)
dragXSV.set(() =>
dragYSV.set(interpolate(e.translationY, [maxLockDrift, 0], [maxLockDrift, 0], Extrapolation.CLAMP))
dragXSV.set(
interpolate(e.translationX, [maxCancelDrift, 0], [maxCancelDrift, 0], Extrapolation.CLAMP)
)
if (e.translationX < maxCancelDrift) {
Expand Down Expand Up @@ -430,7 +430,7 @@ const useRecorder = (p: {ampSV: SVN; setShowAudioSend: (s: boolean) => void; sho
ampTracker.addAmp(amp)
const maxScale = 8
const minScale = 3
ampSV.set(() => withTiming(minScale + amp * (maxScale - minScale), {duration: 100}))
ampSV.set(withTiming(minScale + amp * (maxScale - minScale), {duration: 100}))
}

const recording = await makeRecorder(onRecordingStatusUpdate)
Expand Down
2 changes: 1 addition & 1 deletion shared/common-adapters/loading-line.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Animated, {withRepeat, useSharedValue, withTiming, useAnimatedStyle, with
const LoadingLine = React.memo(function LoadingLine() {
const opacity = useSharedValue(1)
React.useEffect(() => {
opacity.set(() => withDelay(1000, withRepeat(withTiming(0, {duration: 600}), -1, true)))
opacity.set(withDelay(1000, withRepeat(withTiming(0, {duration: 600}), -1, true)))
}, [opacity])
const animatedStyle = useAnimatedStyle(() => {
return {opacity: opacity.value}
Expand Down
4 changes: 3 additions & 1 deletion shared/common-adapters/markdown/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const _markdownStyles = Styles.styleSheetCreate(
backgroundColor: Styles.globalColors.redLighter,
color: Styles.globalColors.black,
fontSize: 15,
marginBottom: Styles.globalMargins.xtiny,
marginTop: Styles.globalMargins.xtiny,
},
}),
codeSnippetStyle: Styles.platformStyles({
Expand Down Expand Up @@ -173,7 +175,7 @@ const InlineCode = (p: {children: React.ReactNode; state: State}) => {
const Fence = (p: {children: React.ReactNode; state: State}) => {
const {children, state} = p
return Styles.isMobile ? (
<Box style={markdownStyles.codeSnippetBlockTextStyle}>
<Box>
<Text
type="Body"
style={Styles.collapseStyles([markdownStyles.codeSnippetBlockTextStyle, state.styleOverride?.fence])}
Expand Down
2 changes: 1 addition & 1 deletion shared/common-adapters/zoomable-image.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const ZoomableImage = React.memo(function (p: Props) {
const opacity = useSharedValue(0)

React.useEffect(() => {
opacity.set(() => withTiming(1, {duration: 800}))
opacity.set(withTiming(1, {duration: 800}))
}, [opacity])

const fadeStyle = useAnimatedStyle(() => {
Expand Down
9 changes: 5 additions & 4 deletions shared/constants/platform-specific/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,19 @@ const ensureBackgroundTask = () => {
if (madeBackgroundTask) return
madeBackgroundTask = true

ExpoTaskManager.defineTask(locationTaskName, ({data, error}) => {
ExpoTaskManager.defineTask(locationTaskName, async ({data, error}) => {
if (error) {
// check `error.message` for more details.
return
return Promise.resolve()
}

if (!data) {
return
return Promise.resolve()
}
const d = data as {locations?: Array<ExpoLocation.LocationObject>}
const locations = d.locations
if (!locations?.length) {
return
return Promise.resolve()
}
const pos = locations.at(-1)
const coord = {
Expand All @@ -295,6 +295,7 @@ const ensureBackgroundTask = () => {
}

C.useChatState.getState().dispatch.updateLastCoord(coord)
return Promise.resolve()
})
}

Expand Down
3 changes: 1 addition & 2 deletions shared/constants/settings-contacts.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,12 @@ export const useState_ = Z.createZustand<State>((set, get) => {

// feature enabled and permission granted
let mapped: T.RPCChat.Keybase1.Contact[]
let defaultCountryCode: string
let defaultCountryCode = ''
try {
const _contacts = await Contacts.getContactsAsync({
fields: [Contacts.Fields.Name, Contacts.Fields.PhoneNumbers, Contacts.Fields.Emails],
})

let defaultCountryCode = ''
try {
defaultCountryCode = await getDefaultCountryCode()
if (__DEV__ && !defaultCountryCode) {
Expand Down
3 changes: 0 additions & 3 deletions shared/desktop/app/installer.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,12 @@ const darwinInstall = (callback: CB) => {
const buttons = errorTypes.fuse || errorTypes.kbnm ? ['Okay'] : ['Ignore', 'Quit']
const detail = errors.join('\n') + `\n\nPlease run \`keybase log send\` to report the error.`
const message = 'Keybase Install Error'
// eslint-disable-next-line promise/no-promise-in-callback
loggingPromise
.then(async () =>
// eslint-disable-next-line promise/no-promise-in-callback
Electron.dialog.showMessageBox({buttons, detail, message}).then(({response}) => {
if (response === 1) {
ctlQuit()
} else {
// eslint-disable-next-line promise/no-callback-in-promise
callback(null)
}
})
Expand Down
1 change: 0 additions & 1 deletion shared/desktop/app/node2.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ const plumbEvents = () => {
const url = pathToURL(resolvedPath)
logger.info('Open URL (directory):', url)

// eslint-disable-next-line promise/no-promise-in-callback
Electron.shell
.openExternal(url, {activate: true})
.then(() => {
Expand Down
4 changes: 2 additions & 2 deletions shared/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ const tsRules = {
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'off',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/no-promise-in-callback': 'off',
'promise/no-callback-in-promise': 'off',
'promise/avoid-new': 'off',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'error',
Expand Down
12 changes: 6 additions & 6 deletions shared/ios/Keybase.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
"$(SRCROOT)/KeybaseGo",
);
INFOPLIST_FILE = Keybase/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -758,7 +758,7 @@
"$(SRCROOT)/KeybaseGo",
);
INFOPLIST_FILE = Keybase/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -820,7 +820,7 @@
);
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = KeybaseShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -871,7 +871,7 @@
);
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = KeybaseShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -962,7 +962,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD = "";
LDPLUSPLUS = "";
MTL_ENABLE_DEBUG_INFO = YES;
Expand Down Expand Up @@ -1060,7 +1060,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD = "";
LDPLUSPLUS = "";
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down
2 changes: 1 addition & 1 deletion shared/ios/Keybase/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ - (NSURL *)bundleURL {

- (BOOL)bridgelessEnabled
{
return NO; // if you change this change Kb.mm also BOOL isBridgeless;
return YES; // if you change this change Kb.mm also BOOL isBridgeless;
}

@end
Expand Down
2 changes: 1 addition & 1 deletion shared/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

platform :ios, "13.4"
platform :ios, min_ios_version_supported
install! 'cocoapods',
:deterministic_uuids => false

Expand Down
Loading