Socket
Socket
Sign inDemoInstall

expo-dev-launcher

Package Overview
Dependencies
Maintainers
25
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-dev-launcher - npm Package Compare versions

Comparing version 0.8.4 to 0.9.0

android/src/main/java/expo/modules/devlauncher/launcher/errors/DevLauncherUncaughtExceptionHandler.kt

14

CHANGELOG.md

@@ -13,2 +13,14 @@ # Changelog

## 0.9.0 — 2021-12-03
### 🎉 New features
- Added support for th React Native `0.66.X`. ([#15242](https://github.com/expo/expo/pull/15242) by [@lukmccall](https://github.com/lukmccall))
### 🐛 Bug fixes
- Fix `No native splash screen registered for given view controller` error happening when project is using both `expo-dev-client` and `expo-splash-screen` packages. ([#14745](https://github.com/expo/expo/pull/14745) by [@kudo](https://github.com/kudo))
- Fix cannot load url that starts with exp. (by [@lukmccall](https://github.com/lukmccall))
- [plugin] Fix config plugin compatibility with expo-screen-orientation. ([#14752](https://github.com/expo/expo/pull/14752) by [@esamelson](https://github.com/esamelson))
## 0.8.4 — 2021-10-21

@@ -18,3 +30,3 @@

- Fix crash in SDK 42 Android projects.
- Fix crash in SDK 42 Android projects. (by [@esamelson](https://github.com/esamelson))

@@ -21,0 +33,0 @@ ## 0.8.3 — 2021-10-15

6

package.json
{
"name": "expo-dev-launcher",
"title": "Expo Development Launcher",
"version": "0.8.4",
"version": "0.9.0",
"description": "Pre-release version of the Expo development launcher package for testing.",

@@ -39,5 +39,5 @@ "main": "build/DevLauncher.js",

"react": "17.0.1",
"react-native": "0.64.2"
"react-native": "0.64.3"
},
"gitHead": "4fa0497a180ae707fa860cb03858630ab7af19f4"
"gitHead": "33c06f161723dc5b6099b9d7eded686bd92c7bbf"
}

@@ -11,3 +11,3 @@ "use strict";

function resolveExpoUpdatesVersion(projectRoot) {
const expoUpdatesBuildPath = resolve_from_1.default(projectRoot, 'expo-updates');
const expoUpdatesBuildPath = (0, resolve_from_1.default)(projectRoot, 'expo-updates');
if (!expoUpdatesBuildPath) {

@@ -14,0 +14,0 @@ return null;

@@ -85,3 +85,3 @@ "use strict";

const withDevLauncherApplication = (config) => {
return config_plugins_1.withDangerousMod(config, [
return (0, config_plugins_1.withDangerousMod)(config, [
'android',

@@ -91,3 +91,3 @@ async (config) => {

mainApplication = addJavaImports(mainApplication, [DEV_LAUNCHER_ANDROID_IMPORT]);
mainApplication = utils_1.addLines(mainApplication, 'initializeFlipper\\(this', 0, [
mainApplication = (0, utils_1.addLines)(mainApplication, 'initializeFlipper\\(this', 0, [
` ${DEV_LAUNCHER_ANDROID_INIT}`,

@@ -97,3 +97,3 @@ ]);

try {
expoUpdatesVersion = resolveExpoUpdatesVersion_1.resolveExpoUpdatesVersion(config.modRequest.projectRoot);
expoUpdatesVersion = (0, resolveExpoUpdatesVersion_1.resolveExpoUpdatesVersion)(config.modRequest.projectRoot);
}

@@ -105,6 +105,6 @@ catch (e) {

mainApplication = addJavaImports(mainApplication, [DEV_LAUNCHER_UPDATES_ANDROID_IMPORT]);
mainApplication = utils_1.addLines(mainApplication, 'initializeFlipper\\(this', 0, [
mainApplication = (0, utils_1.addLines)(mainApplication, 'initializeFlipper\\(this', 0, [
` ${DEV_LAUNCHER_UPDATES_ANDROID_INIT}`,
]);
mainApplication = utils_1.replaceLine(mainApplication, 'return BuildConfig.DEBUG;', ` ${DEV_LAUNCHER_UPDATES_DEVELOPER_SUPPORT}`);
mainApplication = (0, utils_1.replaceLine)(mainApplication, 'return BuildConfig.DEBUG;', ` ${DEV_LAUNCHER_UPDATES_DEVELOPER_SUPPORT}`);
}

@@ -118,3 +118,3 @@ return mainApplication;

const withDevLauncherActivity = (config) => {
return config_plugins_1.withMainActivity(config, (config) => {
return (0, config_plugins_1.withMainActivity)(config, (config) => {
if (config.modResults.language === 'java') {

@@ -144,3 +144,3 @@ let content = addJavaImports(config.modResults.contents, [

const withDevLauncherPodfile = (config) => {
return config_plugins_1.withDangerousMod(config, [
return (0, config_plugins_1.withDangerousMod)(config, [
'ios',

@@ -157,3 +157,3 @@ async (config) => {

const relativePath = path_1.default.relative(config.modRequest.platformProjectRoot, packagePath);
podfile = utils_1.addLines(podfile, 'use_react_native', 0, [
podfile = (0, utils_1.addLines)(podfile, 'use_react_native', 0, [
` pod 'expo-dev-launcher', path: '${relativePath}', :configurations => :debug`,

@@ -182,4 +182,4 @@ ]);

// Note: after the first execution, the second one won't change anything.
config = config_plugins_1.withDangerousMod(config, ['android', injectErrorHandlers]);
config = config_plugins_1.withDangerousMod(config, ['ios', injectErrorHandlers]);
config = (0, config_plugins_1.withDangerousMod)(config, ['android', injectErrorHandlers]);
config = (0, config_plugins_1.withDangerousMod)(config, ['ios', injectErrorHandlers]);
return config;

@@ -191,6 +191,6 @@ };

config = withDevLauncherPodfile(config);
config = withDevLauncherAppDelegate_1.withDevLauncherAppDelegate(config);
config = (0, withDevLauncherAppDelegate_1.withDevLauncherAppDelegate)(config);
config = withErrorHandling(config);
return config;
};
exports.default = config_plugins_1.createRunOncePlugin(withDevLauncher, pkg.name, pkg.version);
exports.default = (0, config_plugins_1.createRunOncePlugin)(withDevLauncher, pkg.name, pkg.version);

@@ -214,3 +214,3 @@ "use strict";

});
appDelegate = utils_1.addLines(appDelegate, '@implementation AppDelegate', 1, [
appDelegate = (0, utils_1.addLines)(appDelegate, '@implementation AppDelegate', 1, [
DEV_LAUNCHER_INITIALIZE_REACT_NATIVE_APP_FUNCTION_DEFINITION(viewControllerInit),

@@ -241,7 +241,7 @@ ]);

const withDevLauncherAppDelegate = (config) => {
return config_plugins_1.withAppDelegate(config, (config) => {
return (0, config_plugins_1.withAppDelegate)(config, (config) => {
if (config.modResults.language === 'objc') {
let expoUpdatesVersion;
try {
expoUpdatesVersion = resolveExpoUpdatesVersion_1.resolveExpoUpdatesVersion(config.modRequest.projectRoot);
expoUpdatesVersion = (0, resolveExpoUpdatesVersion_1.resolveExpoUpdatesVersion)(config.modRequest.projectRoot);
}

@@ -248,0 +248,0 @@ catch (e) {

# expo-dev-launcher
`expo-dev-launcher` is an npm package installable in any Expo or React Native project. Once installed, any Debug builds of your application will gain the ability to load projects from Expo CLI. Release builds of your application will not change other than the addition of a few header files. This package is intended to be included in your project through [`expo-dev-client`](https://docs.expo.io/clients/introduction/).
`expo-dev-launcher` is an npm package installable in any Expo or React Native project. Once installed, any Debug builds of your application will gain the ability to load projects from Expo CLI. Release builds of your application will not change other than the addition of a few header files. This package is intended to be included in your project through [`expo-dev-client`](https://docs.expo.dev/clients/introduction/).
# ⚙️ Installation
## Documentation
Firstly, you need to add the `expo-dev-launcher` package to your project.
<details>
<summary>yarn</summary>
```bash
yarn add expo-dev-launcher expo-dev-menu-interface
```
</details>
<details>
<summary>npm</summary>
```bash
npm install expo-dev-launcher expo-dev-menu-interface
```
</details>
<br>
Then you can start to configure the native projects using steps below.
## 🤖 Android
1. Initialize the `DevLauncherController`.
Open your `MainApplication.{java|kt}` and add the following lines:
<details>
<summary>Java</summary>
```java
...
// You need to import the `DevLauncherController` class
import expo.modules.devlauncher.DevLauncherController;
...
public class MainApplication extends Application implements ReactApplication {
...
@Override
public void onCreate() {
super.onCreate();
...
DevLauncherController.initialize(this, mReactNativeHost); // Initialize the `DevLauncherController` with the `ReactNativeHost`
}
}
```
</details>
<details>
<summary>Kotlin</summary>
```kotlin
...
// You need to import the `DevLauncherController` class
import expo.modules.devlauncher.DevLauncherController;
...
public class MainApplication : Application(), ReactApplication {
...
override public fun onCreate() {
super.onCreate();
...
DevLauncherController.initialize(this, mReactNativeHost); // Initialize the `DevLauncherController` with the `ReactNativeHost`
}
}
```
</details>
<br>
2. Wrap the default `ReactActivityDelegate` with the one from `DevLauncher`.
Open your `MainActivity.{java|kt}` and add the following lines:
<details>
<summary>Java</summary>
```java
...
// You need to import the `DevLauncherController` class
import expo.modules.devlauncher.DevLauncherController;
...
public class MainActivity extends DevMenuAwareReactActivity {
...
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return DevLauncherController.wrapReactActivityDelegate(
this,
() -> new ReactActivityDelegate(this, getMainComponentName()) // Here you can pass your custom `ReactActivityDelegate`
);
}
}
```
</details>
<details>
<summary>Kotlin</summary>
```kotlin
...
// You need to import the `DevLauncherController` class
import expo.modules.devlauncher.DevLauncherController;
...
public class MainActivity : DevMenuAwareReactActivity() {
...
protected override fun ReactActivityDelegate createReactActivityDelegate(): ReactActivityDelegate {
return DevLauncherController.wrapReactActivityDelegate(this) {
ReactActivityDelegate(this, getMainComponentName()) // Here you can pass your custom `ReactActivityDelegate`
});
}
}
```
</details>
<br>
3. Pass new intents to the `DevLauncherController`.
> **Note:** This step is not required but without it, **deep-link** handling **won't work**.
Open your `MainActivity.{java|kt}` and add the following method:
<details>
<summary>Java</summary>
```java
...
public class MainActivity extends DevMenuAwareReactActivity {
...
@Override
public void onNewIntent(Intent intent) {
if (DevLauncherController.tryToHandleIntent(this, intent)) {
return;
}
super.onNewIntent(intent);
}
}
```
</details>
<details>
<summary>Kotlin</summary>
```kotlin
...
public class MainActivity : DevMenuAwareReactActivity() {
...
public override fun onNewIntent(intent: Intent) {
if (DevLauncherController.tryToHandleIntent(this, intent)) {
return;
}
super.onNewIntent(intent);
}
}
```
</details>
## 🍏 iOS
1. Run `npx pod-install` after installing the npm package.
2. Set up the `EXDevLauncherControllerDelegate`.
<details>
<summary>Objective-C</summary>
Open your `AppDelegate.h` and implement `EXDevLauncherControllerDelegate`.
```objc
...
// You need to import the `EXDevLauncherController` and `EXDevLauncherControllerDelegate.
#import <EXDevLauncherController.h>
...
@interface AppDelegate : UMAppDelegateWrapper <RCTBridgeDelegate, EXDevLauncherControllerDelegate> // Here you're implementing the `EXDevLauncherControllerDelegate`
@end
```
Open your `AppDelegate.m` and add the following method:
```objc
...
@implementation AppDelegate
...
- (void)developmentClientController:(EXDevLauncherController * )devLauncherController
didStartWithSuccess:(BOOL)success
{
devLauncherController.appBridge = [self initializeReactNativeApp];
}
...
@end
```
</details>
<details>
<summary>Swift</summary>
Open your `AppDelegate.swift` and implement `EXDevLauncherControllerDelegate`.
```swift
...
@UIApplicationMain
class AppDelegate: UMAppDelegateWrapper, EXDevLauncherControllerDelegate { // You need to implement the `EXDevLauncherControllerDelegate`
...
func developmentClientController(_ devLauncherController: EXDevLauncherController!, didStartWithSuccess success: Bool) {
devLauncherController.appBridge = initializeReactNativeBridge()
}
...
}
```
</details>
<br>
3. Start the `EXDevLauncherController`.
Open your `AppDelegate.{m|swift}` and add the following lines:
<details>
<summary>Objective-C</summary>
```objc
@implementation AppDelegate
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Remove [self initializeReactNativeApp];
// and instead add:
EXDevLauncherController *controller = [EXDevLauncherController sharedInstance];
[controller startWithWindow:self.window delegate:self launchOptions:launchOptions];
}
...
@end
```
</details>
<details>
<summary>Swift</summary>
```swift
...
@UIApplicationMain
class AppDelegate: UMAppDelegateWrapper {
...
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Remove
// [self initializeReactNativeApp];
// and instead add:
let controller = EXDevLauncherController.sharedInstance()
controller?.start(with: window, delegate: self, launchOptions: launchOptions);
}
...
}
```
</details>
<br>
4. Change the source URL.
Open your `AppDelegate.{m|swift}` and add the following lines:
<details>
<summary>Objective-C</summary>
```objc
...
@implementation AppDelegate
...
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
{
// Remove
// return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
// and instead add:
return [[EXDevLauncherController sharedInstance] sourceUrl];
}
...
@end
```
</details>
<details>
<summary>Swift</summary>
```swift
...
@UIApplicationMain
class AppDelegate: UMAppDelegateWrapper {
...
func sourceURL(for bridge: RCTBridge!) -> URL! {
// Remove
// return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil)
// and instead add:
return EXDevLauncherController.sharedInstance()?.sourceUrl()
}
...
}
```
</details>
<br>
5. Handle deep links.
Open your `AppDelegate.{m|swift}` and add the following lines:
<details>
<summary>Objective-C</summary>
```objc
...
#import <React/RCTLinkingManager.h>
...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([EXDevLauncherController.sharedInstance onDeepLink:url options:options]) {
return true;
}
return [RCTLinkingManager application:application openURL:url options:options];
}
...
@end
```
</details>
<details>
<summary>Swift</summary>
```swift
...
class AppDelegate: UMAppDelegateWrapper {
...
func initializeReactNativeBridge() -> RCTBridge? {
// change
// RCTBridge(delegate: self, launchOptions: self.launchOptions)
// to
// RCTBridge(delegate: self, launchOptions: EXDevelopmentClientController.sharedInstance()!.getLaunchOptions())
// the final version looks like this:
if let bridge = RCTBridge(delegate: self, launchOptions: EXDevelopmentClientController.sharedInstance()!.getLaunchOptions()) {
...
}
}
...
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if (useDevClient && EXDevLauncherController.sharedInstance()!.onDeepLink(url, options: options)) {
return true;
}
return RCTLinkingManager.application(app, open: url, options: options)
}
...
}
```
</details>
You can find the documentation under [https://docs.expo.dev/clients/introduction](https://docs.expo.dev/clients/introduction).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc