History log of /expo/packages/expo-modules-autolinking/src/ExpoModuleConfig.ts (Results 1 – 10 of 10)
Revision Date Author Comments
# 4470f942 02-Mar-2023 Kudo Chien <[email protected]>

[autolinking] Introduce gradle plugin autolinking (#21377)

# Why

for #21327 because it introduces a gradle plugin inside expo-dev-launcher

# How

add android gradle plugin autolinking suppor

[autolinking] Introduce gradle plugin autolinking (#21377)

# Why

for #21327 because it introduces a gradle plugin inside expo-dev-launcher

# How

add android gradle plugin autolinking support. ~for security reasons, currently only support expo-dev-launcher.~ updates: we will have a highlighted log:

# Test Plan

ci passed

show more ...


# feef0cca 04-May-2022 Łukasz Kosmaty <[email protected]>

[autolinking][ios] Add support for debug only modules (#17331)

# Why

Needed to close https://github.com/expo/expo/issues/17246.

# How

Adds support for debug only modules. Those modules will

[autolinking][ios] Add support for debug only modules (#17331)

# Why

Needed to close https://github.com/expo/expo/issues/17246.

# How

Adds support for debug only modules. Those modules will only be added to the debug configuration.
- Added a `debugOnly` field in the `iOS` section in the `expo-modules-config.json`
- Ensured that debug modules are wrapped using the `#if DEBUG` directive inside of the ExpoModulesProvider

# Test Plan

- bare-expo ✅

ExpoModulesProvider without `debugOnly` modules:
```swift
/**
* Automatically generated by expo-modules-autolinking.
*
* This autogenerated class provides a list of classes of native Expo modules,
* but only these that are written in Swift and use the new API for creating Expo modules.
*/

import ExpoModulesCore
import ExpoCellular
import ExpoClipboard
import ExpoCrypto
import EXDevLauncher
import EXDevMenu
import EASClient
import ExpoHaptics
import ExpoImageManipulator
import ExpoImagePicker
import ExpoKeepAwake
import ExpoLinearGradient
import ExpoLocalization
import ExpoRandom
import EXScreenOrientation
import ExpoSystemUI
import EXTrackingTransparency
import ExpoWebBrowser


@objc(ExpoModulesProvider)
public class ExpoModulesProvider: ModulesProvider {
public override func getModuleClasses() -> [AnyModule.Type] {
return [
CellularModule.self,
ClipboardModule.self,
CryptoModule.self,
EASClientModule.self,
HapticsModule.self,
ImageManipulatorModule.self,
ImagePickerModule.self,
KeepAwakeModule.self,
LinearGradientModule.self,
LocalizationModule.self,
RandomModule.self,
ExpoSystemUIModule.self,
TrackingTransparencyModule.self,
WebBrowserModule.self
]
}

public override func getAppDelegateSubscribers() -> [ExpoAppDelegateSubscriber.Type] {
return [
ExpoDevLauncherAppDelegateSubscriber.self,
ScreenOrientationAppDelegate.self
]
}

public override func getReactDelegateHandlers() -> [ExpoReactDelegateHandlerTupleType] {
return [
(packageName: "expo-dev-launcher", handler: ExpoDevLauncherReactDelegateHandler.self),
(packageName: "expo-dev-menu", handler: ExpoDevMenuReactDelegateHandler.self),
(packageName: "expo-screen-orientation", handler: ScreenOrientationReactDelegateHandler.self)
]
}
}
```

ExpoModulesProvider with two `debugOnly` modules:
```swift
/**
* Automatically generated by expo-modules-autolinking.
*
* This autogenerated class provides a list of classes of native Expo modules,
* but only these that are written in Swift and use the new API for creating Expo modules.
*/

import ExpoModulesCore
import ExpoCellular
import ExpoClipboard
import ExpoCrypto
import EASClient
import ExpoHaptics
import ExpoImageManipulator
import ExpoImagePicker
import ExpoKeepAwake
import ExpoLinearGradient
import ExpoLocalization
import ExpoRandom
import EXScreenOrientation
import ExpoSystemUI
import EXTrackingTransparency
import ExpoWebBrowser

#if DEBUG
import EXDevLauncher
import EXDevMenu
#endif

@objc(ExpoModulesProvider)
public class ExpoModulesProvider: ModulesProvider {
public override func getModuleClasses() -> [AnyModule.Type] {
return [
CellularModule.self,
ClipboardModule.self,
CryptoModule.self,
EASClientModule.self,
HapticsModule.self,
ImageManipulatorModule.self,
ImagePickerModule.self,
KeepAwakeModule.self,
LinearGradientModule.self,
LocalizationModule.self,
RandomModule.self,
ExpoSystemUIModule.self,
TrackingTransparencyModule.self,
WebBrowserModule.self
]
}

public override func getAppDelegateSubscribers() -> [ExpoAppDelegateSubscriber.Type] {
#if DEBUG
return [
ScreenOrientationAppDelegate.self,
ExpoDevLauncherAppDelegateSubscriber.self
]
#else
return [
ScreenOrientationAppDelegate.self
]
#endif
}

public override func getReactDelegateHandlers() -> [ExpoReactDelegateHandlerTupleType] {
#if DEBUG
return [
(packageName: "expo-screen-orientation", handler: ScreenOrientationReactDelegateHandler.self),
(packageName: "expo-dev-launcher", handler: ExpoDevLauncherReactDelegateHandler.self),
(packageName: "expo-dev-menu", handler: ExpoDevMenuReactDelegateHandler.self)
]
#else
return [
(packageName: "expo-screen-orientation", handler: ScreenOrientationReactDelegateHandler.self)
]
#endif
}
}
```

show more ...


# 7aeb2b0c 14-Mar-2022 Kudo Chien <[email protected]>

[autolinking] Support multiple podspecs and gradle projects in a package (#16511)

# Why

- support the case where a package has multiple podspecs, e.g. [react-native-maps](https://github.com/reac

[autolinking] Support multiple podspecs and gradle projects in a package (#16511)

# Why

- support the case where a package has multiple podspecs, e.g. [react-native-maps](https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#enabling-google-maps)
- being less intrusive to 3rd party libraries when we proposing expo integration. for example, current integration to [reanimated add one line to existing code](https://github.com/software-mansion/react-native-reanimated/blob/a870aa28092322b627695f8cf2ea0dce4db34a53/android-npm/build.gradle#L111) and [turn reanimated gradle project to a different form](https://github.com/software-mansion/react-native-reanimated/blob/a870aa28092322b627695f8cf2ea0dce4db34a53/android-npm/expo/linking.gradle#L15-L45).
- expo reanimated integration had introduced some issues as following. based on this, i think we should have a dedicated gradle project.
- https://github.com/software-mansion/react-native-reanimated/issues/2711
- https://github.com/software-mansion/react-native-reanimated/pull/2713#issuecomment-1024341773

# How

- support multiple podspec linking - `*/*.podspec`
- support multiple build.gradle linking - `*/build.gradle`
- ~introduce special expo adapter integration where we can put all stuffs including `expo-module.config.json` in `expo/` folder
in this case, rn-cli's autolinking will link `RNThirdParty.podspec` and `android/build.gradle`. expo autolinking will link `RNThirdPartyExpoAdapter.podspec` and `expo/android/build.gradle`~
- add expo-module.config.js `android.gradlePath` support to specify custom gradle file paths.

# Test Plan

## Unit Tests

```
PASS src/platforms/__tests__/android-test.ts
resolveModuleAsync
✓ should resolve android/build.gradle (2 ms)
✓ should resolve multiple gradle files (1 ms)
convertPackageNameToProjectName
✓ should strip invalid characters (1 ms)
✓ should convert scoped package name to dash
✓ should have differentiated name for multiple projects
✓ should support expo adapter name

PASS src/autolinking/__tests__/findModules-test.ts
findModulesAsync
✓ should link top level package (2 ms)
✓ should link scoped level package (1 ms)

PASS src/platforms/__tests__/ios-test.ts
resolveModuleAsync
✓ should resolve podspec in ios/ folder
✓ should resolve multiple podspecs (1 ms)
```

## Integration Tests

- create extra `ios2/EXApplication2.podspec` in expo-application
- create extra `android2/build.gradle` in expo-application
- check rn-cli autolinking and expo autolinking co-existence compatibility
- move `use_native_modules!` before `use_expo_modules!` in Podfile
- create extra `ios2/RNReanimated2.podspec` in reanimated and check whether it's linked.


Co-authored-by: Tomasz Sapeta <[email protected]>

show more ...


# 196825b3 14-Feb-2022 Eric Samelson <[email protected]>

[expo-modules-autolinking] add ios.swiftModuleName to expo-module config (#16260)


# d3f57431 11-Jan-2022 Tomasz Sapeta <[email protected]>

[autolinking] Rename "modulesClassNames" to "modules" (#15852)


# aa14fe40 15-Dec-2021 Łukasz Kosmaty <[email protected]>

[autolinking] Add `podspecPath` option to config (#15578)

# Why

A better implementation of https://github.com/expo/expo/pull/15564.

# How

We don't want to link an RN module that has an `exp

[autolinking] Add `podspecPath` option to config (#15578)

# Why

A better implementation of https://github.com/expo/expo/pull/15564.

# How

We don't want to link an RN module that has an `expo-module.config.json` like `reanimated`. That's why we can't just extend a search region. So I've added a new option to the `expo-module config` that indicates where the podspec is located.

# Test Plan

- run `node --eval "require('expo-modules-autolinking')(process.argv.slice(1))" -- resolve --platform ios` and check if the podspec path changes.

show more ...


# 0f5f192f 01-Dec-2021 Kudo Chien <[email protected]>

[core] Introduce iOS ReactDelegate for React related instances creation (#15138)

# Why

original modularized AppDelegateWrapper isn't ideal for expo-updates. we had some bad side effect, e.g. doub

[core] Introduce iOS ReactDelegate for React related instances creation (#15138)

# Why

original modularized AppDelegateWrapper isn't ideal for expo-updates. we had some bad side effect, e.g. double bridge creation on startup.

close ENG-2299

# How

## For module authors

introduce `EXReactDelegate` dedicated for react related instances creation. so far we covered:

- RCTBridge
- RCTRootView
- RootViewController (for expo-screen-orientation)

if a module wants to handle these creation, there's 2 steps:

1. add `reactDelegateHandlers` in `expo-module.config.json`, e.g.

```
"ios": {
"reactDelegateHandlers": ["ScreenOrientationReactDelegateHandler"]
}
```

2. create `EXReactDelegateHandler` derived swift class, e.g.

```swift
// ScreenOrientationReactDelegateHandler.swift
public class ScreenOrientationReactDelegateHandler: ExpoReactDelegateHandler {
public override func createRootViewController(reactDelegate: ExpoReactDelegate) -> UIViewController? {
return EXScreenOrientationViewController()
}
}
```

since the order of whom to create the instance did matter, we also introduce `ModulePriorities.swift` similar to what we did on android.

## For app developers

the change to template is minimal, so codemod by `npx install-expo-modules` is also feasible.

```diff
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
- RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
+ RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];
+ RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:nil];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
- UIViewController *rootViewController = [UIViewController new];
+ UIViewController *rootViewController = [self.reactDelegate createRootViewController];
```

show more ...


# 0fb97ace 29-Oct-2021 Tomasz Sapeta <[email protected]>

[ios] New ExpoAppDelegate independent of singleton modules (#14867)


# d63c278a 19-Oct-2021 Łukasz Kosmaty <[email protected]>

[sweet-api][kotlin] Foundation of the sweet api on Android (#14778)

# Why

A follow up to the https://github.com/expo/expo/pull/13272

# How

- Changed the auto-linking script to generate a li

[sweet-api][kotlin] Foundation of the sweet api on Android (#14778)

# Why

A follow up to the https://github.com/expo/expo/pull/13272

# How

- Changed the auto-linking script to generate a list of modules using the new API.
- Added new abstraction over the old module registry.
- Created a DSL API (not finished, but the final version should look very similar to the current state).
- Integrate the new abstraction with the old `NativeModuleProxy`.

# Current version

In the current version you can:
- export constants
- export methods
- method arguments are cast from the dynamic to the type expected by method implementation
- module definition is static - that will be changed in the future

> Note:
The way, I convert types is not final. It'll be changed. The current implementation is more POC than the final product.

# Test Plan

- unit tests ✅
- rewritten one module to use the new API - not included in that PR ✅

show more ...


# 52637015 22-Jun-2021 Tomasz Sapeta <[email protected]>

[autolinking] Generating Swift modules providers on iOS (#13315)