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

[Paywalls V2] Optionalizing padding, margin, and corner radius properties for safety #4644

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

joshdholtz
Copy link
Member

Motivation

Removing hard requirement for properties that can/should easily default to zero (just for safety)

Description

Made properties optional for:

  • Padding
  • CornerRadiuses

@@ -14,7 +14,7 @@ protocol AvailableConfigItems {

// CI system adds keys here
extension AvailableConfigItems {
static var apiKey: String { "appl_fpIYNnFHeCcvJRZqibQfQOTUusd" }
static var apiKey: String { "" }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops

Copy link

emerge-tools bot commented Jan 9, 2025

1 build increased size

Name Version Download Change Install Change Approval
Paywalls
com.revenuecat.PaywallsTester
1.0 (1) 10.9 MB ⬆️ 25.8 kB (0.24%) 40.5 MB ⬆️ 131.3 kB (0.33%) N/A

Paywalls 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 131.3 kB (0.33%)
Total download size change: ⬆️ 25.8 kB (0.24%)

Largest size changes

Item Install Size Change
RevenueCatUI.TextComponentViewModel.TextComponentViewModel ⬆️ 5.8 kB
RevenueCatUI.StackComponentViewModel.StackComponentViewModel ⬆️ 5.3 kB
RevenueCatUI.StickyFooterComponentViewModel.StickyFooterComponent... ⬆️ 4.0 kB
RevenueCat.OfferingsFactory.OfferingsFactory ⬆️ 3.8 kB
Code Signature ⬆️ 3.4 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:!

Just a question that may be obvious.

Comment on lines +223 to +226
EdgeInsets(top: top ?? 0,
leading: leading ?? 0,
bottom: bottom ?? 0,
trailing: trailing ?? 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used? Is this a JSON model? Should there be a test for this? (Sorry if obvious, I'm so deep in the rabbit hole. 😅)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, EdgeInsets are passed into the SwiftUI views to add padding and margin (so it was being used in SwiftU Previews / Snapshots)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, so what PaddingValues is in Compose I guess. Thanks for explaining!

@joshdholtz joshdholtz merged commit 0e37a9c into main Jan 9, 2025
10 checks passed
@joshdholtz joshdholtz deleted the paywalls-v2/optional-paddding-for-safety branch January 9, 2025 18:06
}
"""

_ = try JSONDecoder.default.decode(
Copy link
Member

@ajpallares ajpallares Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For asserting that an optional is not nil in a test, there's the XCTUnwrap.

XCTUnwrap(try JSONDecoder.default.decode(...))

(I'm late to the party, but... could still be useful to know)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants