Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into expo-build-plugins/…
Browse files Browse the repository at this point in the history
…flipper

* upstream/main: (47 commits)
  [docs] Update Hermes guide to state that Hermes is the new default engine (expo#21047)
  chore: don't mark issues with the "Issue accepted" label as stale (expo#21058)
  Switch default JS engine to Hermes (expo#21001)
  [mail-composer][android] fix composeAsync not resolving after send/ discard (expo#20869)
  Update CHANGELOG.md (expo#21061)
  [core][iOS] Fix expo modules aren't added to global (expo#21037)
  [test-suite] Fix import in the Image example (expo#21043)
  [test-suite] fix video hanging (expo#21057)
  [av][ncl][go] fix audio and video qa issues (expo#21055)
  [tools] Selecting pull requests to label in the publish command (expo#20991)
  [document-picker] fill missing descriptions in `DocumentResult` type (expo#21040)
  [tools] Bump http-cache-semantics from 4.1.0 to 4.1.1 (expo#21049)
  Bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs (expo#21050)
  [apps][yarn-workspace] replace deprecated activateKeepAwake
  update changelogs for react-native 0.71 upgrade (expo#20858)
  Upgrade react native to 0.71.2 (expo#21045)
  [go] update @shopify/react-native-skia to 0.1.172 (expo#21014)
  [stripe] Upgrade stripe to 0.23.1 (expo#20964)
  [expo-firebase-*] Remove libraries (expo#20979)
  [docs] Update expo-secure-store to add info about Export compliance (expo#21021)
  ...
  • Loading branch information
jakobo committed Feb 2, 2023
2 parents 244951a + fd7776f commit 6302f0d
Show file tree
Hide file tree
Showing 623 changed files with 11,249 additions and 15,947 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/issue-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
days-before-issue-stale: 90
days-before-issue-close: 7
stale-issue-label: "stale"
exempt-issue-labels: "Issue accepted"
stale-issue-message: "This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed."
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem."
days-before-pr-stale: -1
days-before-pr-close: -1
enable-statistics: true
enable-statistics: true
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ Package-specific changes not released in any SDK will be added here just before

### 📚 3rd party library updates

- Updated `@stripe/stripe-react-native` from `0.19.0` to `0.23.1`. ([#20964](https://github.com/expo/expo/pull/20964) by [@aleqsio](https://github.com/aleqsio))
- Updated `react-native-webview` from `11.23.1` to `11.26.0`. ([#20933](https://github.com/expo/expo/pull/20933) by [@aleqsio](https://github.com/aleqsio))
- Updated `react-native-gesture-handler` from `2.8.0` to `2.9.0`. ([#20930](https://github.com/expo/expo/pull/20930) by [@tsapeta](https://github.com/tsapeta))
- Updated `react-native-shared-element` from `0.8.4` to `0.8.7`. ([#20593](https://github.com/expo/expo/pull/20593) by [@ijzerenhein](https://github.com/ijzerenhein))
- Updated `@react-native-async-storage/async-storage` from `1.17.3' to `1.17.11`. ([#20780](https://github.com/expo/expo/pull/20780) by [@kudo](https://github.com/kudo))
- Updated `@react-native-async-storage/async-storage` from `1.17.3` to `1.17.11`. ([#20780](https://github.com/expo/expo/pull/20780) by [@kudo](https://github.com/kudo))
- Updated `react-native-reanimated` from `2.12.0` to `2.14.4`. ([#20798](https://github.com/expo/expo/pull/20798) by [@kudo](https://github.com/kudo), [#20990](https://github.com/expo/expo/pull/20990) by [@tsapeta](https://github.com/tsapeta))
- Updated `@shopify/react-native-skia` from `0.1.157` to `0.1.171`. ([#20857](https://github.com/expo/expo/pull/20857) by [@kudo](https://github.com/kudo))
- Updated `@shopify/react-native-skia` from `0.1.157` to `0.1.172`. ([#20857](https://github.com/expo/expo/pull/20857), [#21014](https://github.com/expo/expo/pull/21014) by [@kudo](https://github.com/kudo))
- Updated `react-native-safe-area-context` from `4.4.1` to `4.5.0`. ([#20899](https://github.com/expo/expo/pull/20899) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Updated `react-native-screens` from `3.18.0` to `3.19.0`. ([#20938](https://github.com/expo/expo/pull/20938) by [@lukmccall](https://github.com/lukmccall))
- Updated `react-native-pager-view` from `6.0.1` to `6.1.2`. ([#20932](https://github.com/expo/expo/pull/20932) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Updated `@react-native-community/slider` from `4.2.4` to `4.4.1`. ([#20903](https://github.com/expo/expo/pull/20903) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Updated `@react-native-community/slider` from `4.2.4` to `4.4.2`. ([#20903](https://github.com/expo/expo/pull/20903) by [@gabrieldonadel](https://github.com/gabrieldonadel), [#21055](https://github.com/expo/expo/pull/21055) by [@kudo](https://github.com/kudo))
- Updated `react-native-shared-element` from `0.8.7` to `0.8.8`. ([#20929](https://github.com/expo/expo/pull/20929) by [@byCedric](https://github.com/byCedric))
- Updated `@react-native-community/datetimepicker` from `6.5.2` to `6.7.3`. ([#20926](https://github.com/expo/expo/pull/20926) by [@byCedric](https://github.com/byCedric))
- Updated `@shopify/flash-list` from `1.3.1` to `1.4.0`. ([#20927](https://github.com/expo/expo/pull/20927) by [@lukmccall](https://github.com/lukmccall))

### 🛠 Breaking changes

Expand Down
4 changes: 4 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ allprojects {
.because("Building React Native from source")
}
// WHEN_DISTRIBUTING_REMOVE_TO_HERE

// Newer androidx.annotation:annotation use kotlin 1.8, we should stick on old version.
// Remove this when we upgrade kotlin to 1.8
resolutionStrategy.force("androidx.annotation:annotation:1.4.0")
}
}

Expand Down
14 changes: 11 additions & 3 deletions android/expoview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ dependencies {
}
}

api 'com.google.firebase:firebase-core:17.2.3'
api 'com.google.firebase:firebase-core:21.1.0'
api 'com.google.firebase:firebase-messaging:22.0.0'
api 'com.google.maps.android:android-maps-utils:0.5'
// Remember to update DetachAppTemplate build.gradle if you add any excludes or transitive = false here!
Expand All @@ -290,6 +290,14 @@ dependencies {
implementation "com.google.android.play:review:2.0.1"
implementation "com.google.android.play:review-ktx:2.0.0"

// expo-image
def GLIDE_VERSION = "4.13.2"
implementation "com.github.zjupure:webpdecoder:2.1.${GLIDE_VERSION}"
api "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
kapt "com.github.bumptech.glide:compiler:${GLIDE_VERSION}"
implementation "com.github.bumptech.glide:avif-integration:${GLIDE_VERSION}"
implementation "jp.wasabeef:glide-transformations:4.3.0"

//dbflow
kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${safeExtGet('dbFlowVersion', '4.2.4')}"
implementation "com.github.Raizlabs.DBFlow:dbflow-core:${safeExtGet('dbFlowVersion', '4.2.4')}"
Expand All @@ -301,8 +309,8 @@ dependencies {
api 'com.github.troZee:ViewPager2:v1.0.6'

// stripe-react-native
implementation('com.stripe:stripe-android:20.12.+')
implementation('com.stripe:financial-connections:20.12.+')
implementation('com.stripe:stripe-android:20.19.+')
implementation('com.stripe:financial-connections:20.19.+')
compileOnly 'com.stripe:stripe-android-issuing-push-provisioning:1.1.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
Expand Down
17 changes: 17 additions & 0 deletions android/expoview/src/main/java/host/exp/exponent/kernel/Kernel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ import android.os.Bundle
import android.os.Handler
import android.util.Log
import android.widget.Toast
import com.facebook.hermes.reactexecutor.HermesExecutorFactory
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.react.ReactInstanceManager
import com.facebook.react.ReactRootView
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.JavaScriptExecutorFactory
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.common.LifecycleState
import com.facebook.react.jscexecutor.JSCExecutorFactory
import com.facebook.react.modules.network.ReactCookieJarContainer
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers
import com.facebook.react.shell.MainReactPackage
import com.facebook.soloader.SoLoader
import de.greenrobot.event.EventBus
Expand Down Expand Up @@ -258,6 +262,7 @@ class Kernel : KernelInterface() {
.setApplication(applicationContext)
.setCurrentActivity(activityContext)
.setJSBundleFile(localBundlePath)
.setJavaScriptExecutorFactory(jsExecutorFactory)
.addPackage(MainReactPackage())
.addPackage(
ExponentPackage.kernelExponentPackage(
Expand Down Expand Up @@ -361,6 +366,18 @@ class Kernel : KernelInterface() {
}
return bundle
}
private val jsExecutorFactory: JavaScriptExecutorFactory
get() {
val manifest = exponentManifest.getKernelManifest()
val appName = manifest.getName() ?: ""
val deviceName = AndroidInfoHelpers.getFriendlyDeviceName()

val jsEngineFromManifest = manifest.jsEngine
return if (jsEngineFromManifest == "hermes") HermesExecutorFactory() else JSCExecutorFactory(
appName,
deviceName
)
}

fun hasOptionsForManifestUrl(manifestUrl: String?): Boolean {
return manifestUrlToOptions.containsKey(manifestUrl)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package host.exp.exponent.modules

import android.content.Context
import android.util.Log
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule

/**
* We need to include an [AppGlideModule] for [GlideModule] annotations
* to work.
*/
@GlideModule
class ExponentKernelImageAppGlideModule : AppGlideModule() {
override fun applyOptions(context: Context, builder: GlideBuilder) {
super.applyOptions(context, builder)
builder.setLogLevel(Log.ERROR)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import expo.modules.easclient.EASClientModule
import expo.modules.errorrecovery.ErrorRecoveryPackage
import expo.modules.facedetector.FaceDetectorPackage
import expo.modules.filesystem.FileSystemPackage
import expo.modules.firebase.analytics.FirebaseAnalyticsPackage
import expo.modules.firebase.core.FirebaseCorePackage
import expo.modules.font.FontLoaderPackage
import expo.modules.gl.GLPackage
import expo.modules.gl.GLViewModule
Expand Down Expand Up @@ -81,8 +79,6 @@ object ExperiencePackagePicker : ModulesProvider {
ErrorRecoveryPackage(),
FaceDetectorPackage(),
FileSystemPackage(),
FirebaseCorePackage(),
FirebaseAnalyticsPackage(),
FontLoaderPackage(),
GLPackage(),
ImageLoaderPackage(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package versioned.host.exp.exponent.modules.api.components.reactnativestripesdk

import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.text.Editable
import android.text.InputFilter
Expand All @@ -11,9 +10,11 @@ import android.util.Log
import android.widget.FrameLayout
import androidx.core.os.LocaleListCompat
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.uimanager.PixelUtil
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.UIManagerModule
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.views.text.ReactTypefaceUtils
import com.google.android.material.shape.CornerFamily
import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.shape.ShapeAppearanceModel
Expand Down Expand Up @@ -124,7 +125,8 @@ class CardFieldView(context: ThemedReactContext) : FrameLayout(context) {
}
fontFamily?.let {
for (editTextBinding in bindings) {
editTextBinding.typeface = Typeface.create(it, Typeface.NORMAL)
// Load custom font from assets, and fallback to default system font
editTextBinding.typeface = ReactTypefaceUtils.applyStyles(null, -1, -1, it.takeIf { it.isNotEmpty() }, context.assets)
}
}
cursorColor?.let {
Expand All @@ -140,18 +142,18 @@ class CardFieldView(context: ThemedReactContext) : FrameLayout(context) {
}
}

mCardWidget.setPadding(40, 0, 40, 0)
mCardWidget.setPadding(20, 0, 20, 0)
mCardWidget.background = MaterialShapeDrawable(
ShapeAppearanceModel()
.toBuilder()
.setAllCorners(CornerFamily.ROUNDED, (borderRadius * 2).toFloat())
.setAllCorners(CornerFamily.ROUNDED, PixelUtil.toPixelFromDIP(borderRadius.toDouble()))
.build()
).also { shape ->
shape.strokeWidth = 0.0f
shape.strokeColor = ColorStateList.valueOf(Color.parseColor("#000000"))
shape.fillColor = ColorStateList.valueOf(Color.parseColor("#FFFFFF"))
borderWidth?.let {
shape.strokeWidth = (it * 2).toFloat()
shape.strokeWidth = PixelUtil.toPixelFromDIP(it.toDouble())
}
borderColor?.let {
shape.strokeColor = ColorStateList.valueOf(Color.parseColor(it))
Expand Down Expand Up @@ -201,6 +203,10 @@ class CardFieldView(context: ThemedReactContext) : FrameLayout(context) {

fun setPostalCodeEnabled(isEnabled: Boolean) {
mCardWidget.postalCodeEnabled = isEnabled

if (isEnabled === false) {
mCardWidget.postalCodeRequired = false
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ package versioned.host.exp.exponent.modules.api.components.reactnativestripesdk

import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.text.InputFilter
import android.view.View
import android.view.View.OnFocusChangeListener
import android.widget.FrameLayout
import androidx.core.view.setMargins
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.uimanager.PixelUtil
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.UIManagerModule
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.views.text.ReactTypefaceUtils
import com.google.android.material.shape.CornerFamily
import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.shape.ShapeAppearanceModel
Expand Down Expand Up @@ -39,7 +41,7 @@ class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
init {
cardFormViewBinding.cardMultilineWidgetContainer.isFocusable = true
cardFormViewBinding.cardMultilineWidgetContainer.isFocusableInTouchMode = true

(cardFormViewBinding.cardMultilineWidgetContainer.layoutParams as MarginLayoutParams).setMargins(0)
addView(cardForm)
setListeners()

Expand Down Expand Up @@ -135,6 +137,12 @@ class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
cardFormViewBinding.cardMultilineWidget.expiryDateEditText,
cardFormViewBinding.postalCode
)
val placeholderTextBindings = setOf(
multilineWidgetBinding.tlExpiry,
multilineWidgetBinding.tlCardNumber,
multilineWidgetBinding.tlCvc,
cardFormViewBinding.postalCodeContainer,
)

textColor?.let {
for (binding in editTextBindings) {
Expand All @@ -149,20 +157,27 @@ class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
}
}
placeholderColor?.let {
multilineWidgetBinding.tlExpiry.defaultHintTextColor = ColorStateList.valueOf(Color.parseColor(it))
multilineWidgetBinding.tlCardNumber.defaultHintTextColor = ColorStateList.valueOf(Color.parseColor(it))
multilineWidgetBinding.tlCvc.defaultHintTextColor = ColorStateList.valueOf(Color.parseColor(it))
cardFormViewBinding.postalCodeContainer.defaultHintTextColor = ColorStateList.valueOf(Color.parseColor(it))
for (binding in placeholderTextBindings) {
binding.defaultHintTextColor = ColorStateList.valueOf(Color.parseColor(it))
}
}
fontSize?.let {
for (binding in editTextBindings) {
binding.textSize = it.toFloat()
}
}
fontFamily?.let {
// Load custom font from assets, and fallback to default system font
val typeface = ReactTypefaceUtils.applyStyles(null, -1, -1, it.takeIf { it.isNotEmpty() }, context.assets)
for (binding in editTextBindings) {
binding.typeface = Typeface.create(it, Typeface.NORMAL)
binding.typeface = typeface
}
for (binding in placeholderTextBindings) {
binding.typeface = typeface
}
cardFormViewBinding.countryLayout.typeface = typeface
cardFormViewBinding.countryLayout.countryAutocomplete.typeface = typeface
cardFormViewBinding.errors.typeface = typeface
}
cursorColor?.let {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Expand All @@ -177,18 +192,17 @@ class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
}
}

cardFormViewBinding.cardMultilineWidgetContainer.setPadding(40, 0, 40, 0)
cardFormViewBinding.cardMultilineWidgetContainer.background = MaterialShapeDrawable(
ShapeAppearanceModel()
.toBuilder()
.setAllCorners(CornerFamily.ROUNDED, (borderRadius * 2).toFloat())
.setAllCorners(CornerFamily.ROUNDED, PixelUtil.toPixelFromDIP(borderRadius.toDouble()))
.build()
).also { shape ->
shape.strokeWidth = 0.0f
shape.strokeColor = ColorStateList.valueOf(Color.parseColor("#000000"))
shape.fillColor = ColorStateList.valueOf(Color.parseColor("#FFFFFF"))
borderWidth?.let {
shape.strokeWidth = (it * 2).toFloat()
shape.strokeWidth = PixelUtil.toPixelFromDIP(it.toDouble())
}
borderColor?.let {
shape.strokeColor = ColorStateList.valueOf(Color.parseColor(it))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ class CollectBankAccountLauncherFragment(
}

companion object {
const val TAG = "collect_bank_account_launcher_fragment"
internal const val TAG = "collect_bank_account_launcher_fragment"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ class FinancialConnectionsSheetFragment : Fragment() {
private fun commitFragmentAndStartFlow(currentActivity: AppCompatActivity) {
try {
currentActivity.supportFragmentManager.beginTransaction()
.add(this, "financial_connections_sheet_launch_fragment")
.add(this, TAG)
.commit()
} catch (error: IllegalStateException) {
promise.resolve(createError(ErrorType.Failed.toString(), error.message))
}
}

companion object {
internal const val TAG = "financial_connections_sheet_launch_fragment"

private fun createTokenResult(result: FinancialConnectionsSheetForTokenResult.Completed): WritableMap {
return WritableNativeMap().also {
it.putMap("session", mapFromSession(result.financialConnectionsSession))
Expand Down Expand Up @@ -237,7 +239,9 @@ class FinancialConnectionsSheetFragment : Fragment() {
FinancialConnectionsAccount.Permissions.BALANCES -> "balances"
FinancialConnectionsAccount.Permissions.OWNERSHIP -> "ownership"
FinancialConnectionsAccount.Permissions.TRANSACTIONS -> "transactions"
FinancialConnectionsAccount.Permissions.ACCOUNT_NUMBERS -> "accountNumbers"
FinancialConnectionsAccount.Permissions.UNKNOWN -> "unparsable"
FinancialConnectionsAccount.Permissions.ACCOUNT_NUMBERS -> "accountNumbers"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,6 @@ class GooglePayFragment(private val initPromise: Promise) : Fragment() {
}

companion object {
const val TAG = "google_pay_launch_fragment"
internal const val TAG = "google_pay_launch_fragment"
}
}

0 comments on commit 6302f0d

Please sign in to comment.