Init: Custom replacements in template / allow Hermes flag
See original GitHub issueDescribe the Feature
Want to be able to do something like:
npx react-native init MYPROJECT --replace HERMES_PLACEHOLDER:true
or if that’s too involved, can we just add a hermes flag?
The use-case for this is helping to improve the release tester script. Right now to test Hermes on the template app, it’s a manual change to the Podfile / build.gradle
Possible Implementations
- We add something to
template.config.js
to allow specification of placeholders it supports:
module.exports = {
placeholderName: 'HelloWorld',
titlePlaceholder: 'Hello App Display Name',
templateDir: './template',
placeholders: [
'HERMES_PLACEHOLDER',
], // or maybe an object if we need more information
};
Then we can validate the placeholders against placeholder values passed in via cli
and just do string replace – similar to how we’re doing placeholderName
, placeholderTitle
: code pointer
Related Issues
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top Results From Across the Web
How to resolve the error on 'react-native start' - Stack Overflow
Run CLI with --verbose flag for more details. SyntaxError: Invalid regular expression: /(.\fixtures.|node_modules[]react[]dist[].
Read more >StringSubstitutor (Apache Commons Text 1.10.0 API)
Create and initialize a StringSubstitutor with the map that contains the values for ... Returns a flag whether substitution is disabled in variable...
Read more >API - esbuild
This API call is used by the command-line interface if there is at least one input file provided or the --bundle flag is...
Read more >Expo CLI - Expo Documentation
You can run any command with the --help or -h flag to learn more about it: ... J, Open Chrome Dev Tools for...
Read more >React Native end-to-end testing with Detox - LogRocket Blog
Let's go through the steps: Create an instance of an emulator on an Android or iOS device; Install the application; Initialize the application ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thymikee I think Bob is a bit difficult since there are several templates with different combinations which makes things complex. But for CLI with one template & placeholders, I think it should be pretty good. It’d also be useful to init from the template on CI and do a lint/typecheck to make sure it’s not malformed.
Thank you! Take your time and ask when you need anything 😃