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] Remove/replace PAYWALL_COMPONENTS compiler flag and fix OS/platform compile issues #4727

Merged
merged 28 commits into from
Jan 29, 2025

Conversation

joshdholtz
Copy link
Member

@joshdholtz joshdholtz commented Jan 28, 2025

Motivation

Let it be public!

Description

  • RevenueCat module
    • Removed all #if PAYWALL_COMPONENTS
  • RevenueCatUI module
    • Replace the rest of #if PAYWALL_COMPONENTS with #if !os(watchOS) && !os(macOS) // For Paywalls V2
      • Added the comment for easy finding in the future
    • Fixed compile errors in macOS and watchOS
  • Fixed a BUNCH of compile issues with older OS versions and platforms

@joshdholtz joshdholtz force-pushed the paywalls-v2/remove-compiler-flag-TAKE-2 branch 3 times, most recently from 8a06164 to 4fd3cc9 Compare January 29, 2025 00:12
@joshdholtz
Copy link
Member Author

@RCGitBot please test

3 similar comments
@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz joshdholtz force-pushed the paywalls-v2/remove-compiler-flag-TAKE-2 branch from 63b7b52 to 82ca8d5 Compare January 29, 2025 11:08
@joshdholtz
Copy link
Member Author

@RCGitBot please test

2 similar comments
@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz joshdholtz marked this pull request as ready for review January 29, 2025 15:22
@joshdholtz joshdholtz requested review from a team January 29, 2025 15:22
@joshdholtz joshdholtz changed the title [Paywalls V2] Remove PAYWALL_COMPONENTS compiler flag [Paywalls V2] Remove/replace PAYWALL_COMPONENTS compiler flag and fix OS/platform compile issues Jan 29, 2025
@@ -42,6 +42,7 @@ struct ShadowModifier: ViewModifier {
let shape: (any Shape)?

func body(content: Content) -> some View {
#if !os(watchOS)
Copy link
Member Author

Choose a reason for hiding this comment

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

Executive decision to not support watchOS (right now) in ShadowModifier because we don't support watchOS in Paywalls V2 yet anyway

Comment on lines +18 to +22
public protocol PaywallPartialComponent: PaywallComponentBase {}

public extension PaywallComponent {

protocol PartialComponent: PaywallComponentBase {}
typealias ComponentOverrides<T: PaywallPartialComponent> = [ComponentOverride<T>]
Copy link
Member Author

Choose a reason for hiding this comment

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

Older Swift got angry about this being inside of an extension

Copy link
Member

Choose a reason for hiding this comment

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

Older Swift:
☁️

@facumenzella
Copy link
Contributor

Probably a good idea to get more eyes on this

@@ -14,7 +14,7 @@
import RevenueCat
import SwiftUI

#if PAYWALL_COMPONENTS
#if !os(macOS) && !os(tvOS) // For Paywalls V2
Copy link
Contributor

Choose a reason for hiding this comment

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

I am commenting here because this is where GitHub let's me.
I updated on my other PR line 33 self.fill() because it wasn't compiling either. MAYBE we can see if it works now without it?

@MarkVillacampa

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@@ -6725,7 +6724,6 @@
88A543E12C37A4820039C6A5 /* TemplateView+MultiTier.swift in Sources */,
3523048A2D0A0F30003971A4 /* ErrorView.swift in Sources */,
887A60B72C1D037000E1A461 /* WatchTemplateView.swift in Sources */,
4D3BA4CD2D37D15E00668AFC /* PaywallTimelineComponent.swift in Sources */,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just double checking we want this removed from here, I see in the other change it was duplicated, but I don't see PaywallTimelineComponent in this section?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah yeah! It was added to both RevenueCat and RevenueCatUI targets which was wrong 😅 So I removed the RevenueCatUI one since this file is part of the offerings response codable stuff

But thanks for checking 🙏

Copy link
Contributor

@vegaro vegaro left a comment

Choose a reason for hiding this comment

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

There are still some references to the flag in the fastfile build_paywalls_tester_for_emerge and in two ci_pre_xcodebuild.sh

PaywallComponent.MaskShape.self,
from: json.data(using: .utf8)!
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is this removal intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah yeah! pill type is no longer supported and the test were behind compiler flag so it didn't get caught by CI for a while 🫠

@joshdholtz
Copy link
Member Author

@RCGitBot please test

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -13,10 +13,12 @@

// swiftlint:disable file_length

import SwiftUI
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we need to move this outside the #if?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahhh yeah, for the applyIf that are at the bottom of the file 😅 Its not clear and those should probably get moved somewhere else at some point 🤷‍♂️

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.

What a milestone!

withAnimation(.smooth(duration: 0.2)) {
withAnimation(.easeInOut(duration: 0.2)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended? (Maybe smooth is not supported on older versions?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah yeah, intended 😊 Had issues with smooth on older OS versions so just moved to easeInOut 🤷‍♂️

Comment on lines +18 to +22
public protocol PaywallPartialComponent: PaywallComponentBase {}

public extension PaywallComponent {

protocol PartialComponent: PaywallComponentBase {}
typealias ComponentOverrides<T: PaywallPartialComponent> = [ComponentOverride<T>]
Copy link
Member

Choose a reason for hiding this comment

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

Older Swift:
☁️

Comment on lines -260 to -266
public init(
identifier: String,
serverDescription: String,
metadata: [String: Any] = [:],
paywall: PaywallData? = nil,
availablePackages: [Package]
) {
Copy link
Member

Choose a reason for hiding this comment

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

Just double checking if this is intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup yup! The part we kept above just added paywallComponents: PaywallComponents? = nil, as additional parameter

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

LGTM

@joshdholtz
Copy link
Member Author

@RCGitBot please test

@joshdholtz joshdholtz merged commit 3d86d7d into main Jan 29, 2025
38 checks passed
@joshdholtz joshdholtz deleted the paywalls-v2/remove-compiler-flag-TAKE-2 branch January 29, 2025 17:53
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.

7 participants