Skip to content

Conversation

thymikee
Copy link
Member

@thymikee thymikee commented Feb 16, 2025

Summary

Experimental support for Continuous Native Generation (CNG) and Expo Config Plugins, based on an approach adopted from RNTA.

Expo Config Plugins are great and the ecosystem is huge. By supporting the patterns already defined by them, most libraries that provide Expo Config Plugins should work out of the box, with the exception of the ones that use dangerous mods (since these depend on specific lines of code that might be different in our templates).

That means that apps will be able to use app.json keys in the same convention already defined by Expo, as well as the plugins array for third-party libraries.

What's nice is that this setup doesn't require expo installed and we can use config plugins to modify our own templates, which opens path to CNG and prebuilds.

This PR adds 2 new commands:

  • rock apply-config-plugins: reads app.json keys and applies both internal Expo Config Plugins as well as third-party libraries (app.config.ts not yet supported)
  • rock prebuild: deletes and regenerates the native iOS and Android directories, and then applies config plugins

Test plan

In pluginExpoConfigPlugins.test.ts, we've added tests for most of Expo's default iOS and Android config plugins (e.g. name, ios.bundleIdentifier, android.package, etc) and they work well, but there's still improvements to be made to the test suite in order to guarantee more reliability.

The automated test suite uses the new test app at apps/expo-config-plugins-test-app, copies to a TMP dir, runs the Expo Config Plugins modifiers, and check for the expected changes in the template.

To test manually:

  1. Create new Rock project: pnpm create rock@latest
  2. Add @expo/config-plugins to sample project dependencies
  3. Add pluginExpoConfigPlugins() to rnef.config.js:
import { pluginExpoConfigPlugins } from '@rock-js/plugin-expo-config-plugins';

export default {
  plugins: [pluginExpoConfigPlugins()],
  ...
};
  1. Create an app.json file and add properties
  2. Run rock prebuild to regen native dirs and apply plugins or rock apply-config-plugins to apply config plugins directly without regenerating directories

Note

Add apps/* to pnpm-workspace.yaml and introduce TS path mapping for @rock-js/plugin-expo-config-plugins.

  • Monorepo:
    • Update pnpm-workspace.yaml to include apps/*.
  • TypeScript:
    • Add path alias for @rock-js/plugin-expo-config-plugins in tsconfig.base.json.

Written by Cursor Bugbot for commit 860dfd5. This will update automatically on new commits. Configure here.

@thymikee thymikee force-pushed the main branch 2 times, most recently from f25b722 to c5e0a0c Compare April 3, 2025 10:00
@thymikee thymikee force-pushed the feat/expo-config-plugins branch from 203ea34 to c8bf0c3 Compare July 21, 2025 14:07
Copy link

vercel bot commented Jul 21, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rnef Ignored Ignored Preview Sep 28, 2025 9:47pm
rock Ignored Ignored Preview Sep 28, 2025 9:47pm

Copy link

changeset-bot bot commented Sep 6, 2025

⚠️ No Changeset found

Latest commit: 860dfd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@thiagobrez thiagobrez changed the title WIP: initial support for expo config plugins Experimental support for Expo Config Plugins Sep 13, 2025
@thiagobrez thiagobrez changed the title Experimental support for Expo Config Plugins Experimental support for CNG and Expo Config Plugins Sep 14, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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