Skip to content

Migrate StyleSheet/*.js to use export statements#48609

Closed
iwoplaza wants to merge 1 commit into
facebook:mainfrom
iwoplaza:export-D68017325
Closed

Migrate StyleSheet/*.js to use export statements#48609
iwoplaza wants to merge 1 commit into
facebook:mainfrom
iwoplaza:export-D68017325

Conversation

@iwoplaza
Copy link
Copy Markdown
Contributor

Summary:

Motivation

This is an attempt at modernizing the export syntax in some of the files in Libraries/StyleSheet/. It will allow these files to get properly ingested by modern Flow tooling.

This diff

  • Migrates the use of module.exports into export default for files located in Libraries/StyleSheet/*.js. Some files were omitted due to ballooning complexity, but will be addressed in other Diffs.
  • Updating internal requires to use ".default", no product code seems to be affected.
  • Migrating requires into imports where applicable, taking into account the performance implications (context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3638114866420225/)

Changelog:
[General][Breaking] - Deep imports from some files in StyleSheet/ can break when using the require() syntax, but can be easily fixed by appending .default

Differential Revision: D68017325

@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 Jan 10, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

1 similar comment
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

Summary:

# Motivation
This is an attempt at modernizing the export syntax in some of the files in `Libraries/StyleSheet/`. It will allow these files to get properly ingested by modern Flow tooling.

# This diff
- Migrates the use of `module.exports` into `export default` for files located in `Libraries/StyleSheet/*.js`. Some files were omitted due to ballooning complexity, but will be addressed in other Diffs.
- Updating internal *require*s to use ".default", no product code seems to be affected.
- Migrating `require`s into `import`s where applicable, taking into account the performance implications (context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3638114866420225/)
- Updates the current iteration of API snapshots (intended).
- Updates `react-native-codegen`'s require of processColorArray, analogous to D42346452.

Changelog:
[General][Breaking] - Deep imports from some files in `StyleSheet/` can break when using the `require()` syntax, but can be easily fixed by appending `.default`

Reviewed By: javache

Differential Revision: D68017325
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in e4d969a.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @iwoplaza in e4d969a

When will my fix make it into a release? | How to file a pick request?

@iwoplaza iwoplaza deleted the export-D68017325 branch January 14, 2025 13:39
@iwoplaza iwoplaza restored the export-D68017325 branch January 14, 2025 15:41
@iwoplaza iwoplaza deleted the export-D68017325 branch January 14, 2025 16:46
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been reverted by 0f1d470.

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 Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants