Repository navigation
add RFC 4400000 for extensible enums in federated plugins - #44
Conversation
|
@Mairramer Thanks for converting this document. We are currently reviewing #32, which will create a consistent style across Flutter repos. I think we forgot to link this RFC in the PR yesterday. I linked your doc in #32 (comment), but feel free to leave more comments. I think |
dcharkes
left a comment
There was a problem hiding this comment.
I already reviewed the original design doc which was converted now to this RFC. 👍
|
If the original design doc was already approved / accepted, we can move forward with this. @dcharkes for info. |
|
I agree with @bparrishMines to keep both, aligned & cross-linked. PR #32 (710.0000) establishing the concise repo-wide flutter/flutter style-guide & breaking-change policy, and this (440.0000) the federated-plugin architecture companion covering cross-package SemVer compatibility, platform-specific extension constants, channel string serialization, knownValues, and plugin migration strategy, while harmonizing their class templates. |
Piinks
left a comment
There was a problem hiding this comment.
LGTM - assigning rfc number as this was a previously approved proposal being ported over.
|
Assigned RFC 440.0001. |
This PR proposes a standardized Extensible Constant Pattern for Flutter federated plugins.
Historically, platform-specific constant domains (such as camera pixel formats, biometric authentication types, media surface formats, and store modes) have been modeled as standard Dart
enums. Because standard enums represent closed sets, adding a new constant when an underlying OS introduces a feature triggers a compile-time breaking change for downstream consumers due to Dart's exhaustiveness checks.This RFC outlines the architectural trade-offs, specifies the canonical class pattern (
final classwith value equality,fromString, andknownValues), validates it against thecamerapackage'sImageFormatGroup(PR flutter/packages#11765), and surveys applications across other official plugins influtter/packages(local_auth,video_player,file_selector,in_app_purchase).Converting the document Extensible Enums for Plugins and expanding it with more details.
Tracking issue: flutter/flutter#189696
Pre-launch Checklist
design doc.dart run bin/assign_rfc_number.dartlocally when instructed).If you need help, consider asking for advice on the #hackers channel on Discord.