-
Notifications
You must be signed in to change notification settings - Fork 992
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
Dark Mode style configuration API and Example app toggle #4509
Conversation
|
Name | Version | Download | Change | Install | Change | Approval |
---|---|---|---|---|---|---|
StripeSize com.stripe.StripeSize |
1.0 (1) | 2.1 MB | ⬇️ 1.1 kB (-0.05%) | 6.9 MB | ⬇️ 328 B | N/A |
StripePaymentsSize com.stripe.StripePaymentsSize |
1.0 (1) | 1.2 MB | ⬇️ 2.2 kB (-0.18%) | 4.2 MB | ⬇️ 336 B | N/A |
StripePaymentsUISize com.stripe.StripePaymentsUISize |
1.0 (1) | 1.9 MB | ⬇️ 2.0 kB (-0.1%) | 6.4 MB | ⬇️ 336 B | N/A |
StripePaymentSheetSize com.stripe.StripePaymentSheetSize |
1.0 (1) | 3.7 MB | ⬇️ 6.9 kB (-0.18%) | 11.1 MB | ⬇️ 20.3 kB (-0.18%) | N/A |
StripeIdentitySize com.stripe.StripeIdentitySize |
1.0 (1) | 1.4 MB | ⬇️ 2.3 kB (-0.17%) | 4.4 MB | ⬆️ 1.4 kB (0.03%) | N/A |
StripeApplePaySize com.stripe.StripeApplePaySize |
1.0 (1) | 486.8 kB | ⬇️ 1.9 kB (-0.38%) | 1.7 MB | ⬆️ 5.2 kB (0.31%) | N/A |
StripeFinancialConnectionsSize com.stripe.StripeFinancialConnectionsSize |
1.0 (1) | 1.5 MB | ⬆️ 403 B (0.03%) | 4.8 MB | ⬆️ 13.2 kB (0.28%) | N/A |
StripeConnectSize com.stripe.StripeConnectSize |
1.0 (1) | 1.7 MB | ⬆️ 1.1 kB (0.07%) | 5.4 MB | ⬆️ 9.0 kB (0.17%) | N/A |
StripeSize 1.0 (1)
com.stripe.StripeSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 328 B
Total download size change: ⬇️ 1.1 kB (-0.05%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
Other | ⬆️ 3.8 kB |
StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 336 B
Total download size change: ⬇️ 2.2 kB (-0.18%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
Other | ⬆️ 3.8 kB |
StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 336 B
Total download size change: ⬇️ 2.0 kB (-0.1%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
Other | ⬆️ 3.8 kB |
StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 20.3 kB (-0.18%)
Total download size change: ⬇️ 6.9 kB (-0.18%)
Largest size changes
Item | Install Size Change |
---|---|
🗑 StripePaymentSheet.EmbeddedPaymentElementViewModel | ⬇️ -5.6 kB |
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
DYLD.Exports | ⬇️ -1.3 kB |
DYLD.Fixups | ⬇️ -960 B |
DYLD.String Table | ⬇️ -904 B |
StripeIdentitySize 1.0 (1)
com.stripe.StripeIdentitySize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 1.4 kB (0.03%)
Total download size change: ⬇️ 2.3 kB (-0.17%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
Other | ⬆️ 5.5 kB |
StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 5.2 kB (0.31%)
Total download size change: ⬇️ 1.9 kB (-0.38%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
Other | ⬆️ 9.3 kB |
StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 13.2 kB (0.28%)
Total download size change: ⬆️ 403 B (0.03%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
DYLD.Exports | ⬆️ 1.3 kB |
📝 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬆️ 1.0 kB |
🗑 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬇️ -1.0 kB |
Other | ⬆️ 16.0 kB |
StripeConnectSize 1.0 (1)
com.stripe.StripeConnectSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 9.0 kB (0.17%)
Total download size change: ⬆️ 1.1 kB (0.07%)
Largest size changes
Item | Install Size Change |
---|---|
StripeCore.STPAnalyticEvent.init(rawValue) | ⬇️ -4.2 kB |
DYLD.Exports | ⬆️ 1.3 kB |
📝 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬆️ 1.0 kB |
🗑 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬇️ -1.0 kB |
Other | ⬆️ 11.8 kB |
🛸 Powered by Emerge Tools
f953126
to
5842402
Compare
// Save to user defaults | ||
Self.useAsyncAPIClientStorage = newValue | ||
// Save to experiment store | ||
ExperimentStore.shared.useAsyncAPIClient = newValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to using a singleton-based experiment store instead of directly storing on UserDefaults
. The underlying values are still read from and written to UserDefaults via configurationStore
.
@@ -79,10 +117,13 @@ final public class FinancialConnectionsSheet { | |||
|
|||
private var wrapperViewController: ModalPresentationWrapperViewController? | |||
|
|||
// Any additional Elements context useful for the Financial Connections SDK. | |||
/// Contains all configurable properties of Financial Connections. | |||
@_spi(STP) public var configuration: FinancialConnectionsSheet.Configuration = .init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal API (for now)
6ab0810
to
9bedd68
Compare
9bedd68
to
f0ee717
Compare
...ancialConnections/Source/FinancialConnectionsSDK/FinancialConnectionsSDKImplementation.swift
Show resolved
Hide resolved
StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkPaymentController.swift
Outdated
Show resolved
Hide resolved
...StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift
Outdated
Show resolved
Hide resolved
…nto ElementsSessionContext.StyleConfig
Summary
Commit 1:
Creates a
Configuration
API for theFinancialConnectionsSheet
, which is internal-only (for now). The configuration API allows consumers specify their preference for styling the sheet, with these options;automatic
: Appearance will reflect the device's theme, and dynamically switch accordingly.alwaysLight
: Appearance will always use colors appropriate for a light theme.automatic
once we release this API.alwaysDark
: Appearance will always use colors appropriate for a dark theme.Usage of this API follows the same approach as the configuration API in MPE (docs). Here's what that looks like:
Important
Reminder that the API described here is internal-only until a proper API review takes places. Anything mentioned here is subject to change between now and the public release.
Commit 2:
Adds a toggle and style picker in the Financial Connections Example app to test the API mentioned above. Unless the
Use dynamic style
toggle is enabled, the FC flow should always use a light theme. Otherwise, it should reflect the value in the style pickerCommit 3:
Passes along the value set in the MPE
PaymentSheet.Configuration.UserInterfaceStyle
along to the FC configuration API, whenever FC is launched from payment sheet. This will ensure users integrating both MPE and FC won't need to make any integration changes to get their desired style configuration.Important
Reminder that this will have no functional changes until this API is released. FC will continue to always present in "light mode" until we publicize the
Configuration
API, and remove theExperimentStore
guardrails we have in place.Motivation
https://docs.google.com/document/d/1bGRPh8J8dvie-JEG4q43DycIBr5zY1GoGF-0RFf0L_Q/edit?usp=sharing
Testing
Simulator.Screen.Recording.-.iPhone.16.-.2025-01-29.at.11.29.53.mp4
Changelog
N/a