Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: babel-plugin exports static methods type #102

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Conversation

nonzzz
Copy link
Contributor

@nonzzz nonzzz commented Dec 8, 2023

Make @stylexjs/babel-plugin types happy.The pr exports method styleXTransform static methods types.

@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 Dec 8, 2023
@nonzzz nonzzz marked this pull request as draft December 8, 2023 03:57
@nonzzz nonzzz marked this pull request as ready for review December 8, 2023 06:48
Comment on lines +306 to +311
export type StyleXTransformObj = {
(): PluginObj<>,
withOptions: typeof styleXTransform.withOptions,
processStylexRules: typeof processStylexRules,
...
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type StyleXTransformObj = {
(): PluginObj<>,
withOptions: typeof styleXTransform.withOptions,
processStylexRules: typeof processStylexRules,
...
};
export type StyleXTransformObj = $ReadOnly<{
(): PluginObj<>,
withOptions: typeof styleXTransform.withOptions,
processStylexRules: typeof processStylexRules,
...
}>;

Copy link
Contributor

Choose a reason for hiding this comment

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

Would prefer the type to be read-only if possible.

Copy link
Contributor

@nmn nmn left a comment

Choose a reason for hiding this comment

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

This is a nice improvement. Thanks!

@nmn nmn merged commit 1c90481 into facebook:main Dec 8, 2023
9 checks passed
@nonzzz nonzzz deleted the perf/types branch January 19, 2024 20:43
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants