fix: expo plugin breaking due to override keyword needing to be public in version 54#95
Conversation
WalkthroughcomputeMethodPrefix now parses only the major SDK version (segment before the first dot) and returns no prefix for major 53, "public override" for majors > 53; tests were updated to use semantic version strings and a new SDK 54 test plus snapshot assertions were added. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Tests
participant Updater as swiftFileUpdater
participant Prefix as computeMethodPrefix
Note over Test,Updater: Test supplies originalContents + sdkVersion
Test->>Updater: call swiftFileUpdater(originalContents, sdkVersion)
Updater->>Prefix: computeMethodPrefix(sdkVersion)
alt sdkVersion missing or malformed
Prefix-->>Updater: ""
else major === 53
Prefix-->>Updater: ""
else major > 53
Prefix-->>Updater: "public override"
end
Updater-->>Test: modified Swift file contents (with selected prefix)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)plugin/__tests__/withRNOrientationAppDelegate.spec.ts (3)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
plugin/__tests__/__snapshots__/withRNOrientationAppDelegate.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
plugin/__tests__/withRNOrientationAppDelegate.spec.ts(1 hunks)plugin/src/withRNOrientationAppDelegate.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
plugin/__tests__/withRNOrientationAppDelegate.spec.ts (3)
plugin/src/withRNOrientationAppDelegate.ts (1)
swiftFileUpdater(58-102)plugin/__tests__/fixtures/AppDelegate52.swift (2)
AppDelegate(6-30)application(8-17)plugin/__tests__/fixtures/AppDelegate53.swift (1)
AppDelegate(5-53)
🔇 Additional comments (1)
plugin/src/withRNOrientationAppDelegate.ts (1)
86-101: The implementation is correct; test case names are misleading but snapshots reflect the correct behavior.The snapshot verification reveals the original review comment misinterpreted the test case names. While the descriptions are backwards:
- SDK 52 test says "having public override" but actually shows NO override (line 100:
func application(...))- SDK 53+ tests say "without override" but actually show "public override" (lines 157, 238:
public override func application(...))The actual snapshot content is correct and matches the implementation logic:
- SDK < 53: empty prefix (no override keyword)
- SDK ≥ 53: "public override" prefix
This correctly addresses the original issue #93 where SDK 54 requires the override keyword.
Likely an incorrect or invalid review comment.
This PR fixes #93.
Summary by CodeRabbit
Bug Fixes
Tests