Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn SwiftPM

Swift Package Manager plugin migration checklist for Flutter — hướng dẫn Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi What iOS/macOS plugin authors must ship after SwiftPM became the default. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate inten...

Swift Package Manager là mặc định iOS/macOS — rời CocoaPods

CocoaPods đang ở chế độ maintenance. Flutter 3.44 đặt Swift Package Manager làm mặc định cho dependency iOS và macOS. CLI migrate Xcode project ở lần flutter run / flutter build kế tiếp. App developer thấy gì Happy path không cần cài Ruby/CocoaPods. Add-to-App có flutter build swift-package để đóng gói module thành Swift Package. Plugin còn bắt buộc CocoaPods sẽ bị CLI cảnh báo và fallback tạm. Plugin author cần ship gì Thêm Package.swift . Depend FlutterFramework nếu đã migrate pilot 2024. Nâng constraint Flutter tối thiểu lên 3.44 khi chuyển. Plugin chưa migrate bị trừ điểm pub.dev và sẽ không resolve được nữa. Opt-out tạm # pubspec.yaml flutter : enable-swift-package-manager : false Hoặc --no-enable-swift-package-manager trên CLI. Opt-out sẽ bị gỡ; mở issue kèm Xcode project nếu SwiftPM làm hỏng tích hợp thật. Checklist trước khi xóa Podfile flutter clean rồi build iOS đầy đủ CI không còn cài CocoaPods cho app này Mọi plugin trong tree resolve bằ...

Swift Package Manager plugin migration checklist for Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What iOS/macOS plugin authors must ship after SwiftPM became the default. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, su...

Swift Package Manager is the iOS/macOS default — leave CocoaPods behind

CocoaPods is in maintenance mode. Flutter 3.44 makes Swift Package Manager the default for iOS and macOS dependency resolution. The CLI migrates the Xcode project on the next flutter run / flutter build . What app developers see No Ruby/CocoaPods install required for the happy path. Add-to-App gains flutter build swift-package to emit a Swift Package for native hosts. Plugins that still require CocoaPods trigger a CLI warning and temporary fallback. What plugin authors must ship If you maintain an iOS/macOS plugin: Add a Package.swift . Depend on FlutterFramework if you migrated in the 2024 pilot. Raise the minimum Flutter constraint to 3.44 when you switch. Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Temporary opt-out # pubspec.yaml flutter : # temporary escape hatch — file a bug if you need it enable-swift-package-manager : false Or pass --no-enable-swift-package-manager on the command line. Opt-outs will be removed; op...

Swift Package Manager plugin migration checklist for Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What iOS/macOS plugin authors must ship after SwiftPM became the default. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, su...

Swift Package Manager là mặc định iOS/macOS — rời CocoaPods

CocoaPods đang ở chế độ maintenance. Flutter 3.44 đặt Swift Package Manager làm mặc định cho dependency iOS và macOS. CLI migrate Xcode project ở lần flutter run / flutter build kế tiếp. App developer thấy gì Happy path không cần cài Ruby/CocoaPods. Add-to-App có flutter build swift-package để đóng gói module thành Swift Package. Plugin còn bắt buộc CocoaPods sẽ bị CLI cảnh báo và fallback tạm. Plugin author cần ship gì Thêm Package.swift . Depend FlutterFramework nếu đã migrate pilot 2024. Nâng constraint Flutter tối thiểu lên 3.44 khi chuyển. Plugin chưa migrate bị trừ điểm pub.dev và sẽ không resolve được nữa. Opt-out tạm # pubspec.yaml flutter : enable-swift-package-manager : false Hoặc --no-enable-swift-package-manager trên CLI. Opt-out sẽ bị gỡ; mở issue kèm Xcode project nếu SwiftPM làm hỏng tích hợp thật. Checklist trước khi xóa Podfile flutter clean rồi build iOS đầy đủ CI không còn cài CocoaPods cho app này Mọi plugin trong tree resolve bằ...

Swift Package Manager is the iOS/macOS default — leave CocoaPods behind

CocoaPods is in maintenance mode. Flutter 3.44 makes Swift Package Manager the default for iOS and macOS dependency resolution. The CLI migrates the Xcode project on the next flutter run / flutter build . What app developers see No Ruby/CocoaPods install required for the happy path. Add-to-App gains flutter build swift-package to emit a Swift Package for native hosts. Plugins that still require CocoaPods trigger a CLI warning and temporary fallback. What plugin authors must ship If you maintain an iOS/macOS plugin: Add a Package.swift . Depend on FlutterFramework if you migrated in the 2024 pilot. Raise the minimum Flutter constraint to 3.44 when you switch. Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Temporary opt-out # pubspec.yaml flutter : # temporary escape hatch — file a bug if you need it enable-swift-package-manager : false Or pass --no-enable-swift-package-manager on the command line. Opt-outs will be removed; op...