-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow different flavors JS and App (#5404)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary tl;dr ## Test plan ### To make DEBUG bundle in RELEASE app in `metro/Server.js` add ```js transformOptions.dev = true; ``` below ```js async build(options) { const { entryFile, graphOptions, onProgress, resolverOptions, serializerOptions, transformOptions, } = splitBundleOptions(options); ``` and add `RCT_DEV=1` flag to pods in XCode ### To make RELEASE bundle in DEBUG app ``` Manually create release bundle with Metro, put it as e.g. `CUSTOM_BUNDLE.jsbundle` in `ios` and load it from file in AppDelegate.mm like this: ```mm //#if DEBUG // return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; //#else return [[NSBundle mainBundle] URLForResource:@"CUSTOM_BUNDLE" withExtension:@"jsbundle"]; //#endif ``` ``` --------- Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>
- Loading branch information
1 parent
133c55c
commit 96823e6
Showing
22 changed files
with
83 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
#ifndef NDEBUG | ||
|
||
#include "JSLogger.h" | ||
#include <memory> | ||
|
||
namespace reanimated { | ||
|
||
void JSLogger::warnOnJS(const std::string &warning) const { | ||
#ifndef NDEBUG | ||
jsScheduler_->scheduleOnJS([warning](jsi::Runtime &rt) { | ||
auto console = rt.global().getPropertyAsObject(rt, "console"); | ||
auto warn = console.getPropertyAsFunction(rt, "warn"); | ||
warn.call(rt, jsi::String::createFromUtf8(rt, warning)); | ||
}); | ||
#endif // NDEBUG | ||
} | ||
|
||
} // namespace reanimated | ||
|
||
#endif // NDEBUG |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#pragma once | ||
|
||
#include <jsi/jsi.h> | ||
#include <memory> | ||
#include <string> | ||
#include "JSLogger.h" | ||
|
||
using namespace facebook; | ||
|
||
namespace reanimated { | ||
|
||
std::string getReanimatedCppVersion(); | ||
|
||
#ifndef NDEBUG | ||
bool matchVersion(const std::string &, const std::string &); | ||
void checkJSVersion(jsi::Runtime &); | ||
#endif // NDEBUG | ||
void checkJSVersion(jsi::Runtime &, const std::shared_ptr<JSLogger> &); | ||
|
||
}; // namespace reanimated |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.