KEMBAR78
[compiler] Export `PluginOptions` as a type that can be used in input positions by eps1lon · Pull Request #34550 · facebook/react · GitHub
Skip to content

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Sep 21, 2025

PluginOptions previously typed all its properties as (deeply required). This is unergonomic for users who'd have to wrap it in Partial<PluginOptions>. However, this is not even sufficient to properly type environment. The correct type would've been Partial<Omit<PluginOptions, 'environment'>> & {environment: Partial<EnvironmentConfig>}.

This is no longer a trivial type construction so it warrants a dedicated type. Now the compiler distinguishes between PluginOptions (the options you pass into the Compiler) and ParsedPluginOptions which the Compiler uses internally and has all its properties defaultized.

@meta-cla meta-cla bot added the CLA Signed label Sep 21, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 21, 2025
@eps1lon eps1lon force-pushed the sebbie/09-21-_compiler_export_pluginoptions_as_a_type_that_can_be_used_in_input_positions branch from 1f999f9 to 79aca40 Compare September 21, 2025 11:33
@react-sizebot
Copy link

The size diff is too large to display in a single comment. The GitHub action for this pull request contains an artifact called 'sizebot-message.md' with the full message.

Generated by 🚫 dangerJS against 79aca40

@eps1lon eps1lon marked this pull request as ready for review September 21, 2025 11:39
@eps1lon eps1lon merged commit 720bb13 into facebook:main Sep 22, 2025
259 checks passed
@eps1lon eps1lon deleted the sebbie/09-21-_compiler_export_pluginoptions_as_a_type_that_can_be_used_in_input_positions branch September 22, 2025 16:28
github-actions bot pushed a commit that referenced this pull request Sep 22, 2025
github-actions bot pushed a commit that referenced this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants