react-native bundle
on this Composite project to create the JS bundle and assets to store in the Container.react-native start
on this Composite)..babelrc
file at the root of the MiniApp, containing the Babel configuration. Electrode Native doesn't support babel.config.js
which is appropriate for a top level babel configuration, but given that the MiniApps will end up inside a Composite, they won't be top level anymore.useBabelRc
to true
in the ern
section of the MiniApp package.json
, as follow :dependencies
sections of the package.json
rather than devDependencies
. This is not the standard, and can look unclean, however it won't have any nasty side effects. The reason for this constraint is that when Electrode Native generates a Composite with one or more MiniApp(s) it yarn add
(npm install
) each of the MiniApps in the Composite project, which does not install any devDependencies
of the the MiniApps. Therefore, if Babel plugins are kept inside devDependencies
they won't be installed during Composite generation, and bundling/packaging will fail when trying to resolve babel plugins..babelrc
) the cwd
option should be set to babelrc
. This is needed, otherwise the base directory for root
will resolve to top level composite rather than the MiniApp root directory.BABEL_ENV
environment variable during transpilation to one out of only two values : development
or production
. Keep that in mind if using the env
option in a Babel configuration. Whatever value is manually set for BABEL_ENV
will be overwritten during transpilation by Metro bundler.development
will be set for any development bundle (local packager for example) and production
will be set for any production bundle (bundle that we store in Container).compositeGenerator
config in the Cauldron. It can also be supplied directly to some commands such as run-android
/run-ios
or create-container
via the --extra
object option. The resolutions
field is a 1:1 mapping to the resolutions
field that will be added to the package.json
of the composite. Refer to the selective dependency resolutions documentation for more information.resolutions
to the package.json
of the custom composite.extraNodeModules
in Metro configresolver.extraNodeModules
property in metro.config.json
can be added via the metroExtraNodeModules
field. It supports both relative and absolute paths. Relative paths will resolve to node_modules
inside the Composite project.metro.config.json
should be modified directly..npmrc
.npmrc
file present in the root of a MiniApp. This is due to the fact that when generating a Composite project, Electrode Native just yarn add
every MiniApp to the Composite project. Each MiniApp becomes a dependency of the Composite project and is not a top level app anymore. Therefore, when needing a custom .npmrc
configuration, the .npmrc
should be global rather than local, or be part of a custom Composite project (see below).rn-cli.config.js
/ metro.config.js
/babel.config.js
).index.js
is required. This will be the entry file used when runningreact-native bundle
/react-native start
.composite-imports.js
will be generated by Electrode Native. It will contain all of the MiniApps / JS API Impls imports. You have to import this file in index.js
at some point, otherwise your MiniApps won't be packaged in the bundle. Keep in mind that this file, if present in the repo, will be overwitten by Electrode Native during composite generation, so don't put custom imports or code in this one.name
/version
in the package.json
and other fields that only matter for npm publication can be left to dumnmy values. This Composite project is not meant to be published to npm but solely used to create the Composite JS bundle.custom-composite
stored in GitHub under user username
, your compositeGenerator
configuration should be as follow :mybranch
, the configuration will be the following :ern
commands. You should manually edit your Cauldron. Also, as a reminder, config
objects can be stored at different levels in the Cauldron, respectively :MyApp:android:1.0.0
, Electrode Native will first look for a config
object at the native application version level, and if not found will bubble up the levels until it finds it (or doesn't).baseComposite
option being either a valid git repository path or a local path on the workstation to a custom composite project. Please note that using this option will take precedence over any baseComposite
configuration stored in Cauldron. If you are using a Cauldron, there is very limited use to explicitly providing the baseComposite
to these command./etc/custom-composite
you can easily try it out with some of the commands above, before committing it to git / setting it up in Cauldron.yarn add
for all MiniApps / JS API Implementations part of the Composite (this will update the package.json
of the Composite)composite-imports.js
file, containing all MiniApps/JS API Implementations imports.react-native bundle
or react-native start
will be invoked with index.js
as entry-file
based on the platform being targeted.