chore: Clean up worklet directive usage#447
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates the 'worklet' directive placement by moving it to the top of files that contain only worklet functions, improving code organization and consistency.
- Moved
'worklet'directive from individual functions to file-level scope - Converted some function declarations to arrow functions for consistency
- Removed redundant
'worklet'directives from individual functions within files
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-sortables/src/utils/operations.ts | Moved worklet directive to top and converted to arrow function |
| packages/react-native-sortables/src/utils/misc.ts | Moved worklet directive from function to file level |
| packages/react-native-sortables/src/utils/logs.ts | Moved worklet directive to top and converted functions to arrow functions |
| packages/react-native-sortables/src/utils/layout.ts | Moved worklet directive to top and converted functions to arrow functions |
| packages/react-native-sortables/src/utils/equality.ts | Moved worklet directive to top and converted functions to arrow functions |
| packages/react-native-sortables/src/utils/dimensions.ts | Moved worklet directive to top and converted functions to arrow functions |
| packages/react-native-sortables/src/utils/arrays.ts | Moved worklet directive to top and converted function to arrow function |
| packages/react-native-sortables/src/providers/shared/utils.ts | Moved worklet directive from function to file level |
| packages/react-native-sortables/src/providers/shared/AutoScrollProvider/utils.ts | Moved worklet directive to top and removed from individual functions |
| packages/react-native-sortables/src/providers/grid/layout/utils/helpers.ts | Moved worklet directive to top and removed from individual functions |
| packages/react-native-sortables/src/providers/flex/layout/utils/layout.ts | Moved worklet directive to top and removed from individual functions |
| packages/react-native-sortables/src/providers/flex/layout/updates/insert/utils.ts | Moved worklet directive to top and removed from individual functions |
| packages/react-native-sortables/src/integrations/reanimated/utils/animatedTimeout.ts | Moved worklet directive to top and removed from individual functions |
| packages/react-native-sortables/src/constants/layoutAnimations.ts | Moved worklet directive to top and removed from individual functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Owner
Author
|
🎉 This issue has been resolved in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR moves the
'worklet'directive to the top of the file where possible (in files which contain only worklet functions).