Skip to content

Commit

Permalink
Replace DevInternalSettings with DeveloperSettings for react-native 0…
Browse files Browse the repository at this point in the history
….73.0 (#2617)

* Replace DevInternalSettings with DeveloperSettings

DevInternalSettings was enclosed in ReactNative 0.73.0-rc.2, so we need to replace it with public class DeveloperSettings.
facebook/react-native#37256

* auto install cocoapods in tests

---------

Co-authored-by: velimir-jankovic <84719115+velimir-jankovic@users.noreply.github.com>
Co-authored-by: JiglioNero <mikhail.suendukov@akvelon.com>
  • Loading branch information
3 people authored Jan 17, 2024
1 parent 5ab89da commit 99c8c4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.devsupport.DevInternalSettings;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
import com.facebook.react.uimanager.ViewManager;

import org.json.JSONException;
Expand Down Expand Up @@ -152,12 +152,12 @@ private boolean isLiveReloadEnabled(ReactInstanceManager instanceManager) {
if (instanceManager != null) {
DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
if (devSupportManager != null) {
DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
Method[] methods = devInternalSettings.getClass().getMethods();
DeveloperSettings devSettings = devSupportManager.getDevSettings();
Method[] methods = devSettings.getClass().getMethods();
for (Method m : methods) {
if (m.getName().equals("isReloadOnJSChangeEnabled")) {
try {
return (boolean) m.invoke(devInternalSettings);
return (boolean) m.invoke(devSettings);
} catch (Exception x) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class RNProjectManager extends ProjectManager {
}
mkdirp.sync(projectDirectory);

return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.71.3", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.71.3 --install-pods", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
.then((e) => { console.log(`"npx react-native init ${appName}" success. cwd=${projectDirectory}`); return e; })
.then(this.copyTemplate.bind(this, templatePath, projectDirectory))
.then<void>(TestUtil.getProcessOutput.bind(undefined, TestConfig.thisPluginInstallString, { cwd: path.join(projectDirectory, TestConfig.TestAppName) }))
Expand Down

0 comments on commit 99c8c4e

Please sign in to comment.