Skip to content

fix: add compiler conditional to hover style - #43331

Closed
okwasniewski wants to merge 1 commit into
react:mainfrom
okwasniewski:fix/hoverstyle-conditionals
Closed

fix: add compiler conditional to hover style#43331
okwasniewski wants to merge 1 commit into
react:mainfrom
okwasniewski:fix/hoverstyle-conditionals

Conversation

@okwasniewski

@okwasniewskiokwasniewski commented Mar 5, 2024

Copy link
Copy Markdown
Contributor

Summary:

Commit 73664f5 broke two jobs in CircleCI that we run using Xcode 14.3.1 because the commit introduced some types that are available only to iOS 17.
The code was wrapped around if(@available()) statement, but this does not compile out the code. It is a runtime check and the code needs to build anyway.

This takes effect at compile time as well. However, unlike with #available, the method must type check and compile. The code will always be emitted into your binary: however, it will only be used when the binary is executed on platforms that meet the availability requirements.

source: forums.swift.org/t/if-vs-available-vs-if-available/40266/2

This change should fix it, introducing some compile time pragmas that removes the code if we build with older versions of Xcode

Changelog:

[IOS] [ADDED] - Compiler conditionals for hover style (cursor: pointer)

Test Plan:

CI Green

@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner labels Mar 5, 2024
@facebook-github-botfacebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 5, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi merged this pull request in 1387725.

@facebook-github-botfacebook-github-bot added the Merged This PR has been merged. label Mar 5, 2024
@Saadnajmi

Copy link
Copy Markdown
Contributor

Sorry :( I had thought main didn't need to test Xcode 14.3 anymore. Guess not.

layer.shadowPath = nil;
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be defined for visionOS too right? Checking real quick...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems so 👍🏽

huntie pushed a commit that referenced this pull request Mar 11, 2024
Summary:
Commit 73664f5 broke two jobs in CircleCI that we run using Xcode 14.3.1 because the commit introduced some types that are available only to iOS 17.
The code was wrapped around if(available()) statement, but this does not compile out the code. It is a runtime check and the code needs to build anyway.
This takes effect at compile time as well. However, unlike with #available, the method must type check and compile. The code will always be emitted into your binary: however, it will only be used when the binary is executed on platforms that meet the availability requirements.
source: [forums.swift.org/t/if-vs-available-vs-if-available/40266/2](https://forums.swift.org/t/if-vs-available-vs-if-available/40266/2)
This change should fix it, introducing some compile time pragmas that removes the code if we build with older versions of Xcode
## Changelog:
[IOS] [ADDED] - Compiler conditionals for hover style (cursor: pointer)
Pull Request resolved: #43331
Test Plan: CI Green
Reviewed By: dmytrorykun
Differential Revision: D54540520
Pulled By: cipolleschi
fbshipit-source-id: 943ac479062e11969efa7645ec0ead26c6866374
This was referenced Jun 28, 2024
@cipolleschicipolleschi mentioned this pull request Jul 22, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.p: CallstackPartner: CallstackPartnerShared with MetaApplied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@okwasniewski@facebook-github-bot@Saadnajmi