Skip to content

Commit e8d8056

Browse files
Trim React Native Expo migration scope
Assisted-By: devx/c25009c8-5a1d-4cb8-aee9-2dcf64902080
1 parent bad6dac commit e8d8056

8 files changed

Lines changed: 28 additions & 179 deletions

File tree

.github/workflows/rn-build-ios.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,6 @@ jobs:
4949
bundler-cache: true
5050
working-directory: platforms/react-native/sample
5151

52-
- name: Verify iOS lockfile uses published native SDK
53-
run: scripts/check_published_podfile_lock sample/ios/Podfile.lock
54-
55-
- name: Cache cocoapods
56-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
57-
with:
58-
path: platforms/react-native/sample/ios/Pods
59-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }}
60-
61-
- name: Install cocoapods
62-
working-directory: platforms/react-native/sample
63-
run: |
64-
set -euo pipefail
65-
bundle install
66-
cd ios
67-
bundle exec pod install --deployment --repo-update
68-
6952
- name: Build module
7053
run: pnpm module build
7154

.github/workflows/rn-test-ios.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ jobs:
2626
echo "Xcode Path: $(xcode-select -p)"
2727
echo "Xcode Version: $(xcrun xcodebuild -version)"
2828
29-
- name: Setup iOS Simulator
30-
run: |
31-
xcrun simctl list runtimes
32-
xcrun simctl list devicetypes | grep iPhone
33-
xcrun simctl delete all
34-
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro")
35-
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> "$GITHUB_ENV"
36-
3729
- name: Setup Node.js, pnpm, and install dependencies
3830
uses: ./.github/actions/setup
3931
with:
@@ -42,30 +34,6 @@ jobs:
4234
package-json-file: platforms/react-native/package.json
4335
working-directory: platforms/react-native
4436

45-
- name: Setup Ruby
46-
uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0
47-
with:
48-
ruby-version: 3.3.6
49-
bundler-cache: true
50-
working-directory: platforms/react-native/sample
51-
52-
- name: Verify iOS lockfile uses published native SDK
53-
run: scripts/check_published_podfile_lock sample/ios/Podfile.lock
54-
55-
- name: Cache cocoapods
56-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
57-
with:
58-
path: platforms/react-native/sample/ios/Pods
59-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }}
60-
61-
- name: Install cocoapods
62-
working-directory: platforms/react-native/sample
63-
run: |
64-
set -euo pipefail
65-
bundle install
66-
cd ios
67-
bundle exec pod install --deployment --repo-update
68-
6937
- name: Build module
7038
run: pnpm module build
7139

platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutButtons.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ import UIKit
77

88
// MARK: - AcceleratedCheckout Components
99

10+
@available(iOS 16.0, *)
11+
class AcceleratedCheckoutConfiguration {
12+
static let shared = AcceleratedCheckoutConfiguration()
13+
var configuration: ShopifyAcceleratedCheckouts.Configuration?
14+
var applePayConfiguration: ShopifyAcceleratedCheckouts.ApplePayConfiguration?
15+
16+
var available: Bool {
17+
if #available(iOS 16.0, *) {
18+
return configuration != nil
19+
} else {
20+
return false
21+
}
22+
}
23+
24+
var applePayAvailable: Bool {
25+
if #available(iOS 16.0, *) {
26+
return applePayConfiguration != nil
27+
} else {
28+
return false
29+
}
30+
}
31+
}
32+
1033
@objc(RCTAcceleratedCheckoutButtonsManager)
1134
class RCTAcceleratedCheckoutButtonsManager: RCTViewManager {
1235
/// Internal property used in tests to simulate legacy devices

platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/AcceleratedCheckoutConfiguration.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/ShopifyCheckoutKit.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Foundation
22
import PassKit
3-
#if canImport(React)
4-
import React
5-
#endif
3+
import React
64
import ShopifyCheckoutKit
75
import SwiftUI
86
import UIKit
@@ -260,7 +258,7 @@ class RCTShopifyCheckoutKit: NSObject {
260258
@available(iOS 16.0, *)
261259
private func contactFieldsToRequiredContactFields(_ contactFields: [String]) throws -> [ShopifyAcceleratedCheckouts.RequiredContactFields] {
262260
return try contactFields.compactMap {
263-
guard let field = ShopifyAcceleratedCheckouts.RequiredContactFields(rawValue: $0) else {
261+
guard let field = ShopifyAcceleratedCheckouts.RequiredContactFields(rawValue: $0), field != nil else {
264262
let message = "Unknown contactField option: \(String(describing: $0))"
265263
print("[ShopifyCheckoutKit] \(message)")
266264
throw NSError(domain: "ShopifyCheckoutKit", code: 1, userInfo: ["message": message])
@@ -327,9 +325,7 @@ extension RCTShopifyCheckoutKit: CheckoutDelegate {
327325

328326
extension RCTShopifyCheckoutKit {
329327
private func emitDispatchEvent(_ json: String) {
330-
let selector = NSSelectorFromString("emitOnDispatchFromSwift:")
331-
guard responds(to: selector) else { return }
332-
perform(selector, with: json)
328+
perform(NSSelectorFromString("emitOnDispatchFromSwift:"), with: json)
333329
}
334330

335331
/// Builds a `{ "type": ..., "payload": ... }` envelope and forwards

platforms/react-native/sample/src/__tests__/env.test.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

platforms/react-native/sample/src/auth/__tests__/tokenStorage.test.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

platforms/react-native/sample/src/auth/customerAccountManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class CustomerAccountManager {
211211
throw new Error(`Token exchange failed: ${errorText}`);
212212
}
213213

214-
const data = (await response.json()) as TokenResponse;
214+
const data: TokenResponse = await response.json();
215215

216216
const tokens: OAuthTokenResult = {
217217
accessToken: data.access_token,
@@ -261,7 +261,7 @@ export class CustomerAccountManager {
261261
throw new Error(`Token refresh failed: ${errorText}`);
262262
}
263263

264-
const data = (await response.json()) as TokenResponse;
264+
const data: TokenResponse = await response.json();
265265

266266
const tokens: OAuthTokenResult = {
267267
accessToken: data.access_token,

0 commit comments

Comments
 (0)