Skip to content

Conversation

@V3RON
Copy link
Contributor

@V3RON V3RON commented Dec 20, 2025

Description

This PR introduces a unified Metro config transformer system that provides a consistent, composable way to modify Metro configurations across different export formats (objects, promises, functions, async functions, and promises of functions).

The new system includes:
createMetroConfigTransformer() - A factory function that creates transformers compatible with all Metro config export patterns
composeMetroConfigTransformers() - A Babel-like composition utility for chaining multiple transformers with optional configuration

All existing Metro plugins have been updated to use this unified system, providing better type safety and composability.

Context

Metro configuration in React Native projects can be exported in multiple formats, and existing transformer patterns were inconsistent across plugins. This unified system solves the problem by providing a single abstraction that preserves the "shape" of any Metro config export while applying transformations.
The system is designed to be reusable beyond the Rozenite ecosystem - any Metro-based bundling setup can benefit from this composable transformer pattern.

Testing

A test suite covers all transformer functions. It validates different Metro config export patterns and composition scenarios. The implementation has also been tested in practice by using the playground app with multiple transformers composed together.

@vercel
Copy link

vercel bot commented Dec 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rozenite Ready Ready Preview, Comment Dec 20, 2025 7:25pm

@V3RON V3RON merged commit fcde704 into main Dec 20, 2025
3 checks passed
@V3RON V3RON deleted the feat/unified-metro-mutators branch December 20, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants