Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/actions/detect-platform-change/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Detect Platform Change'
description: 'Detects whether to run Android, iOS, or both based on changed files'
inputs:
android-paths:
description: 'Paths that trigger only Android tests'
required: true
ios-paths:
description: 'Paths that trigger only iOS tests'
required: true
common-paths:
description: 'Paths that trigger both platform tests'
required: true
shared-ignores:
description: 'Paths to ignore for all platforms'
required: false
default: >-
"!{**/*.md,**/LICENSE*,**/.gitignore,**/CHANGELOG*,**/.npmignore,**/.eslintrc*,**/.prettierrc*,**/.gitattributes,**/.watchmanconfig,**/.fingerprintignore}"

outputs:
should_run_android:
value: ${{ steps.changes.outputs.android_any_changed == 'true' || steps.changes.outputs.common_any_changed == 'true' }}
should_run_ios:
value: ${{ steps.changes.outputs.ios_any_changed == 'true' || steps.changes.outputs.common_any_changed == 'true' }}

runs:
using: 'composite'
steps:
- name: 👀 Checkout
uses: actions/checkout@v5
with:
fetch-depth: 1000
filter: 'blob:none'
- name: 🧐 Check changes categories
id: changes
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
with:
# If the number of commits from actions/checkout is not sufficient to find a base commit,
# tj-actions/changed-files tries 10 times to fetch more commits by this amount:
fetch_depth: 1000
files_yaml: |
ios: [ ${{ inputs.ios-paths }}, ${{ inputs.shared-ignores }} ]
android: [ ${{ inputs.android-paths }}, ${{ inputs.shared-ignores }} ]
common: [ ${{ inputs.common-paths }}, ${{ inputs.shared-ignores }} ]
33 changes: 33 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,39 @@ concurrency:
cancel-in-progress: true

jobs:
detect-platform-for-e2e:
runs-on: ubuntu-24.04
outputs:
should_run_ios: ${{ steps.changes.outputs.should_run_ios }}
should_run_android: ${{ steps.changes.outputs.should_run_android }}
steps:
- name: 👀 Checkout
uses: actions/checkout@v5
- name: 🧐 Detect platform change
id: changes
uses: ./.github/actions/detect-platform-change
with:
android-paths: >-
"packages/**/android/**",
"apps/bare-expo/**/android/**"

ios-paths: >-
"packages/**/ios/**",
"apps/bare-expo/**/ios/**"

common-paths: >-
.github/workflows/test-suite.yml,
.github/actions/use-android-emulator/action.yml,
"apps/bare-expo/**",
"apps/test-suite/**",
"packages/**",
yarn.lock,
"!packages/**/{ios,android}/**",
"!apps/bare-expo/**/{ios,android}/**"
ios-build:
runs-on: macos-15
needs: detect-platform-for-e2e
if: needs.detect-platform-for-e2e.outputs.should_run_ios == 'true'
permissions:
# REQUIRED: Allow updating fingerprint in action caches
actions: write
Expand Down Expand Up @@ -213,6 +244,8 @@ jobs:

android-build:
runs-on: ubuntu-24.04
needs: detect-platform-for-e2e
if: needs.detect-platform-for-e2e.outputs.should_run_android == 'true'
permissions:
# REQUIRED: Allow updating fingerprint in action caches
actions: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.core.net.toUri
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import expo.modules.core.utilities.VRUtilities
import expo.modules.devmenu.DevMenuPreferences
import host.exp.exponent.generated.ExponentBuildConstants
import host.exp.exponent.services.ThemeSetting
Expand Down Expand Up @@ -300,17 +301,20 @@ fun DeveloperMenuSection(
iconPainter = painterResource(R.drawable.three_finger_long_press)
)

HorizontalDivider()

SwitchRow(
text = "Action button",
checked = showFab,
onCheckedChange = { newValue ->
showFab = newValue
devMenuPreference.showFab = newValue
},
iconPainter = painterResource(R.drawable.fab)
)
// Hide FAB toggle on Quest devices since FAB is always on there
if (!VRUtilities.isQuest()) {
HorizontalDivider()

SwitchRow(
text = "Action button",
checked = showFab,
onCheckedChange = { newValue ->
showFab = newValue
devMenuPreference.showFab = newValue
},
iconPainter = painterResource(R.drawable.fab)
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import android.content.Context
import android.content.Intent
import android.content.Intent.ACTION_VIEW
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContract
import androidx.appcompat.app.AppCompatActivity
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.net.toUri
import expo.modules.core.utilities.VRUtilities
import host.exp.exponent.home.HomeAppTheme
import host.exp.exponent.services.ThemeSetting
import java.net.URLEncoder

private const val SESSION_SECRET_KEY = "session_secret"
Expand Down Expand Up @@ -53,6 +57,14 @@ class AuthActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
HomeAppTheme(themeSetting = ThemeSetting.Automatic) {
AuthIndicatorScreen(
onCancel = { cancelAuth() }
)
}
}

val authRequestType = intent.getStringExtra(AUTH_REQUEST_TYPE_KEY)
?: throw IllegalStateException("AuthActivity started without AuthRequestType extra")

Expand All @@ -65,6 +77,11 @@ class AuthActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()

// Due to multi-window nature of Quest (and lack of proper support for Custom Tabs) resuming the activity shouldn't cancel the auth
if (VRUtilities.isQuest()) {
return
}

// onNewIntent will handle the response from the web browser
if (intent?.data?.host == REDIRECT_HOST) {
return
Expand All @@ -76,9 +93,7 @@ class AuthActivity : AppCompatActivity() {
return
}

val resultIntent = Intent()
setResult(RESULT_CANCELED, resultIntent)
finish()
cancelAuth()
}

override fun onNewIntent(intent: Intent) {
Expand Down Expand Up @@ -107,6 +122,12 @@ class AuthActivity : AppCompatActivity() {
}
}

private fun cancelAuth() {
val resultIntent = Intent()
setResult(RESULT_CANCELED, resultIntent)
finish()
}

private fun openWebBrowserAsync(startUrl: String) {
val intent = createCustomTabsIntent().apply {
data = startUrl.toUri()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package host.exp.exponent.home.auth

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

@Composable
fun AuthIndicatorScreen(
onCancel: () -> Unit,
modifier: Modifier = Modifier
) {
Box(
modifier = modifier
.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = Modifier.padding(32.dp)
) {
CircularProgressIndicator(
color = MaterialTheme.colorScheme.primary
)
Spacer(modifier = Modifier.height(24.dp))
Text(
text = "Authenticating in the browser...",
style = MaterialTheme.typography.bodyLarge
)
Spacer(modifier = Modifier.height(32.dp))
Button(
onClick = onCancel
) {
Text("Cancel Login")
}
}
}
}
2 changes: 1 addition & 1 deletion apps/expo-go/ios/Client/SwiftUI/HomeRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum HomeTab: Hashable {
case settings
}

public struct HomeRootView: View {
struct HomeRootView: View {
@ObservedObject var viewModel: HomeViewModel
@State private var showingUserProfile = false
@State private var selectedTab: HomeTab = .home
Expand Down
2 changes: 2 additions & 0 deletions apps/expo-go/ios/Exponent.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import UserNotifications
import ExpoNotifications

public class EXScopedNotificationSerializer {
class EXScopedNotificationSerializer {

public static func serializedNotification(_ notification: UNNotification) -> NotificationRecord {
let scopedSerializedNotification = NotificationRecord(from: notification)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ExpoModulesCore
import ExpoNotifications

public final class ExpoGoNotificationsCategoriesModule: CategoriesModule {
final class ExpoGoNotificationsCategoriesModule: CategoriesModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ExpoModulesCore
import ExpoNotifications

public final class ExpoGoNotificationsEmitterModule: EmitterModule {
final class ExpoGoNotificationsEmitterModule: EmitterModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ExpoModulesCore
import ExpoNotifications

public final class ExpoGoNotificationsHandlerModule: HandlerModule {
final class ExpoGoNotificationsHandlerModule: HandlerModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ExpoModulesCore
import ExpoNotifications

public final class ExpoGoNotificationsPresentationModule: PresentationModule {
final class ExpoGoNotificationsPresentationModule: PresentationModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ExpoModulesCore
import ExpoNotifications

public final class ExpoGoNotificationsSchedulerModule: SchedulerModule {
final class ExpoGoNotificationsSchedulerModule: SchedulerModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ExpoModulesCore
import ExpoNotifications

// swiftlint:disable:next type_name
public final class ExpoGoNotificationsServerRegistrationModule: ServerRegistrationModule {
final class ExpoGoNotificationsServerRegistrationModule: ServerRegistrationModule {
private let scopeKey: String
// swiftlint:disable:next unavailable_function
required init(appContext: AppContext) {
Expand Down
2 changes: 1 addition & 1 deletion apps/expo-go/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4724,7 +4724,7 @@ SPEC CHECKSUMS:
GoogleAppMeasurement: 8a82b93a6400c8e6551c0bcd66a9177f2e067aed
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
hermes-engine: 452f2dd7422b2fd7973ae9ca103898d28d7744f0
hermes-engine: 2853aea4922d43f84b721631947e9b25da43eabd
libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7
libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
Expand Down
6 changes: 2 additions & 4 deletions docs/pages/eas/hosting/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can also test this workflow by triggering it manually:

## Create a PR preview workflow

Add the following file to **.eas/workflows/pr-preview.yml**. This will automatically deploy a preview of your website whenever a pull request is created or updated, and post a comment to the PR with the preview URL.
Add the following file to **.eas/workflows/pr-preview.yml**. This will automatically deploy a preview of your website whenever a pull request is created or updated, and post a comment to the PR with the deployment details.

```yaml .eas/workflows/pr-preview.yml
name: PR Preview
Expand All @@ -55,8 +55,6 @@ jobs:
comment:
needs: [deploy]
type: github-comment
params:
message: 'Preview URL: ${{ needs.deploy.outputs.deploy_url }}'
```

This workflow will run whenever a pull request is opened, reopened, or synchronized. The `comment` job will automatically post the preview URL to the pull request, making it easy for reviewers to test your changes.
This workflow will run whenever a pull request is opened, reopened, or synchronized. The `comment` job will automatically discover the deployment and post its details to the pull request, making it easy for reviewers to test your changes.
Loading
Loading