Skip to content

add RFC 4400000 for extensible enums in federated plugins - #44

Merged
Piinks merged 5 commits into
flutter:mainfrom
Mairramer:rfc-440.000
Nov 9, 2026
Merged

Piinks merged 5 commits into
flutter:mainfrom
Mairramer:rfc-440.000

Conversation

@Mairramer

@Mairramer Mairramer commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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 class with value equality, fromString, and knownValues), validates it against the camera package's ImageFormatGroup (PR flutter/packages#11765), and surveys applications across other official plugins in flutter/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

  • I read RFC 000.0001: Taxonomy and followed the file and path naming and metadata standards.
  • I read RFC 000.0002: Process and confirmed this proposal meets the threshold for a full RFC.
  • I read and agree to the Code of Conduct.
  • I signed the CLA.
  • I have linked an issue from flutter/flutter with the label design doc.
  • All existing and new tests are passing.
  • I have enabled "Allow edits from maintainers" on this PR so the bot can automatically assign an RFC number (or I will run dart run bin/assign_rfc_number.dart locally when instructed).

If you need help, consider asking for advice on the #hackers channel on Discord.

@Mairramer
Mairramer marked this pull request as ready for review November 4, 2026 13:09
@bparrishMines

Copy link
Copy Markdown

@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 flutter/packages and flutter/flutter can share a style doc based on the use cases.

@dcharkes dcharkes mentioned this pull request Nov 4, 2026
7 tasks

@dcharkes dcharkes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I already reviewed the original design doc which was converted now to this RFC. 👍

@jtmcdole

jtmcdole commented Nov 4, 2026

Copy link
Copy Markdown
Member

If the original design doc was already approved / accepted, we can move forward with this. @dcharkes for info.

@Piinks

Piinks commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

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 Piinks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM - assigning rfc number as this was a previously approved proposal being ported over.

@Piinks Piinks added the assign-rfc-number Triggers workflow to assign a number to the RFC. label Nov 6, 2026
@github-actions github-actions Bot added rfc-assigned AAA.NNN number assigned by the `rfc-assigned` action and removed assign-rfc-number Triggers workflow to assign a number to the RFC. labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Assigned RFC 440.0001.

@Piinks
Piinks added this pull request to the merge queue Nov 9, 2026
Merged via the queue into flutter:main with commit 53b4631 Nov 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfc-assigned AAA.NNN number assigned by the `rfc-assigned` action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants