question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Init: Custom replacements in template / allow Hermes flag

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
satya164commented, Feb 7, 2022

@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.

2reactions
thymikeecommented, Feb 4, 2022

Thank you! Take your time and ask when you need anything 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found