Skip to content

Fix CodegenSchema Enum type to not export array#47324

Closed
elicwhite wants to merge 2 commits into
facebook:mainfrom
elicwhite:export-D65259014
Closed

Fix CodegenSchema Enum type to not export array#47324
elicwhite wants to merge 2 commits into
facebook:mainfrom
elicwhite:export-D65259014

Conversation

@elicwhite
Copy link
Copy Markdown
Member

Summary:
I need to reference this type somewhere else, but not an array of the type.

Generally we prefer that all exported types are the object itself, and it used as a member type of arrays when used.

Changelog: [Internal]

Differential Revision: D65259014

Summary:

This change adds support for number literals as a type.

The codegen already has parsing support for these types
```
  +passNumber: (arg: number) => void;
  +passString: (arg: string) => void;
  +passStringLiteral: (arg: 'A String Literal') => void;
```

This change now also supports
```
  +passNumberLiteral: (arg: 4) => void;
```

On the native side this is treated the same as `number`. It could be strengthened in the future.

This is a pre-requisite for number literal unions and enums.

Changelog: [Internal]

Differential Revision: D65249334
Summary:
I need to reference this type somewhere else, but not an array of the type.

Generally we prefer that all exported types are the object itself, and it used as a member type of arrays when used.

Changelog: [Internal]

Differential Revision: D65259014
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 31, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D65259014

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 35f0e1c.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants