Experimental support for CNG and Expo Config Plugins#166
Open
Experimental support for CNG and Expo Config Plugins#166
Conversation
f25b722 to
c5e0a0c
Compare
203ea34 to
c8bf0c3
Compare
20 tasks
|
|
Really awesome framework @thiagobrez. Do we have any estimate on when this changes would be released? The CNG support is the one of major thing holding from introducing the Rock. |
Contributor
|
Thanks @andriyslyusar! No estimate yet, but soon enough :D |
3d96b7a to
22c004e
Compare
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.
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.jsonkeys in the same convention already defined by Expo, as well as thepluginsarray for third-party libraries.What's nice is that this setup doesn't require
expoinstalled 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: readsapp.jsonkeys and applies both internal Expo Config Plugins as well as third-party libraries (app.config.tsnot yet supported)rock prebuild: deletes and regenerates the native iOS and Android directories, and then applies config pluginsTest 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:
pnpm create rock@latest@expo/config-pluginsto sample project dependenciespluginExpoConfigPlugins()to rnef.config.js:app.jsonfile and add propertiesrock prebuildto regen native dirs and apply plugins orrock apply-config-pluginsto apply config plugins directly without regenerating directoriesNote
Add
apps/*topnpm-workspace.yamland introduce TS path mapping for@rock-js/plugin-expo-config-plugins.pnpm-workspace.yamlto includeapps/*.@rock-js/plugin-expo-config-pluginsintsconfig.base.json.Written by Cursor Bugbot for commit 860dfd5. This will update automatically on new commits. Configure here.