Repository navigation
Conversation
The method was documented as deprecated, but it had no attribute, so the compiler could not warn callers. Add __deprecated_msg so that callers get -Wdeprecated-declarations. Suppress -Wdeprecated-implementations around the implementation. Claude-Session: https://claude.ai/code/session_01Do8XDDkHi4bGs3ZHQcWcAH
tjzel
marked this pull request as ready for review
October 12, 2026 15:18
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D124967062. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR description is AI-generated.
Summary:
-[RCTSurfacePresenter addObserver:]is documented as deprecated in favor ofRCTMountingTransactionObserverCoordinator, but it has no attribute, so the compiler cannot warn callers. I added__deprecated_msgto the declaration, the same idiom as-[RCTViewManager customBubblingEventTypes]. I suppressed-Wdeprecated-implementationsaround the implementation, the same wayRCTUITextField.mmdoes. I keptremoveObserver:undeprecated, because callers that still useaddObserver:must balance it, and they should not get a second warning for the cleanup call. The in-repo caller,RCTNativeAnimatedTurboModule, calls throughid<RCTSurfacePresenterStub>, whose declaration is not deprecated, so it gets no warning and needs no change.Changelog:
[IOS] [DEPRECATED] - Mark
-[RCTSurfacePresenter addObserver:]as deprecated for the compiler. UseRCTMountingTransactionObserverCoordinatorinstead.Test Plan:
clang++ -fsyntax-onlyon a small Objective-C++ file that includesRCTSurfacePresenter.h. A call onRCTSurfacePresenter *giveswarning: 'addObserver:' is deprecated: Use RCTMountingTransactionObserverCoordinator instead.Calls toremoveObserver:and calls throughid<RCTSurfacePresenterStub>give no warning.RCTSurfacePresenter.mmpassesclang++ -fsyntax-only -Werror=deprecated-declarations -Werror=deprecated-implementations.node scripts/clang-format.js --checkpasses on both files.https://claude.ai/code/session_01Do8XDDkHi4bGs3ZHQcWcAH