| #
210d3757 |
| 30-May-2023 |
Łukasz Kosmaty <[email protected]> |
[menu][Android] Rewrite safe area view using new API (#21609)
|
| #
42d798a0 |
| 23-May-2023 |
Gabriel Donadel Dall'Agnol <[email protected]> |
[dev-client][android] Add support for the new architecture (#22607)
# Why
Closes ENG-7955
# How
Implement the missing `getJSIModulePackage` methods to both
`ReactNativeHost`s in order to s
[dev-client][android] Add support for the new architecture (#22607)
# Why
Closes ENG-7955
# How
Implement the missing `getJSIModulePackage` methods to both
`ReactNativeHost`s in order to support the new architecture.
`ReactPackageTurboModuleManagerDelegate` was already implemented on
https://github.com/expo/expo/pull/19931
# Test Plan
Run `fabric-tester` and `bare-expo` apps on Android
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->
- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
show more ...
|
| #
c516e737 |
| 19-May-2023 |
Łukasz Kosmaty <[email protected]> |
[menu][Android] Start using new modules API (#21582)
# Why
Rewrite some menu modules to use the new API.
# Test Plan
- bare-expo ✅
|
| #
5ec39b77 |
| 18-May-2023 |
Kudo Chien <[email protected]> |
[dev-launcher][dev-menu] fix nightlies build error 0.73.0-nightly-20230515-066f0b76d (#22503)
# Why
fix react-native nightlies build error (0.73.0-nightly-20230515-066f0b76d) which was caused mai
[dev-launcher][dev-menu] fix nightlies build error 0.73.0-nightly-20230515-066f0b76d (#22503)
# Why
fix react-native nightlies build error (0.73.0-nightly-20230515-066f0b76d) which was caused mainly by [`DevInternalSettings` updated as package-private](https://github.com/facebook/react-native/commit/1a9e444b616300666)
# How
- move `DevLauncherInternalSettings` and `DevMenuDevSettings` into `com.facebook.react.devsupport` package, so that we can inherit the package-private `DevInternalSettings`.
- introducing `DevLauncherInternalSettingsWrapper` and `DevMenuInternalSettingsWrapper` allows us to access the package-private `DevInternalSettings`
- some misc changes i will leave in pr inline comments
# Test Plan
- test suite ci passed
- test suite nightlies ci passed
show more ...
|
| #
f7abd545 |
| 05-Apr-2023 |
Gabriel Donadel Dall'Agnol <[email protected]> |
[dev-menu] Fix JS entry file in development builds (#21984)
# Why
When using `.expo/.virtual-metro-entry` as an entry file the `rewriteExpoRequestUrl` detects the expected entry file by checking th
[dev-menu] Fix JS entry file in development builds (#21984)
# Why
When using `.expo/.virtual-metro-entry` as an entry file the `rewriteExpoRequestUrl` detects the expected entry file by checking the `package.json`, which does not work in the case of `dev-menu` due to it primarily being a library and having it's `"main"` field inside `package.json` point to `build/DevMenu.js` instead of the necessary "index"
# How
Revert the entry file in dev-menu to `index`
# Test Plan
Run bare-expo with `override fun getUseDeveloperSupport() = true` and `export EX_DEV_LAUNCHER_URL=http://localhost:8090`
# Checklist
- [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
show more ...
|
| #
036e9444 |
| 28-Mar-2023 |
Evan Bacon <[email protected]> |
feat(metro-config): support any entry file in development builds that don't use Expo dev client (#21643)
# Why
- React Native enforces that apps must use `index.js` as the entry file,
this is hi
feat(metro-config): support any entry file in development builds that don't use Expo dev client (#21643)
# Why
- React Native enforces that apps must use `index.js` as the entry file,
this is highly inconvenient and forces us to change the app entry on
`expo prebuild` (cite: [prebuild side
effects](https://github.com/expo/expo/blob/4d2795e/docs/pages/workflow/prebuild.mdx#side-effects)
(`index.js` and `package.json` `scripts`)).
- In #14964 I added support for production Android apps to use any entry
point.
- In #18381 I added the same support to iOS apps in production.
- Development builds using `expo-dev-client` and Expo Go both use a
manifest which support arbitrary entry points.
- This just leaves development builds that don't have Expo code-loading
support (e.g. no manifest/index.html where the script can be changed
dynamically).
# How
- This PR introduces the virtual entry file `.expo/.virtual-metro-entry`
which should never physically exist. When this endpoint is pinged, Expo
CLI will rewrite the the URL to the correct entry point based on the
project configuration. This enables us to fully drop the prebuild
side-effect as no case will require an `index.js` (`index.bundle`) as
the entry file.
- The rewrite means Metro will never support a physical file located at
`.expo/.virtual-metro-entry.js` as this will always be ignored. We could
support forwarding the request if this file exists but we'll probably go
the other way and assert if this file exists to mitigate possible
confusion.
- The name `.expo/.virtual-metro-entry.js` was chosen to be clear and
long enough that users wouldn't try to actually create this file.
- I originally tried using a middleware to perform the redirect but this
wouldn't work with the HMR server which emulates pinging the endpoint
in-memory. Because of this, I went with the metro
`server.rewriteRequestUrl` function.
> This feature is implemented in Expo's Metro configuration, meaning it
should apply to `npx react-native start` (but this is untested and not
officially supported).
## New Setup Instructions for non-prebuild users
Non-prebuild projects will need to modify their `AppDelegate.mm` as
follows:
```diff
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
```
And their `android/app/src/main/java/***/MainApplication.java`:
```diff
@Override
protected String getJSMainModuleName() {
- return "index";
+ return ".expo/.virtual-metro-entry";
}
```
This is of course in addition to the `android/app/build.gradle`:
```groovy
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
```
And iOS production change:
```
shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" $PROJECT_ROOT ios relative | tail -n 1)\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n";
```
# Test Plan
### Continuous(-ish)
- Updated the templates to use this new format.
### Quick test
- Start the dev server and ping the entry URL directly:
-
`http://localhost:8081/.expo/.virtual-metro-entry.bundle?platform=web&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true`
- The redirected URL should show in the `sourceURL` at the end of the
file.
### E2E
- Prebuild, then apply the native changes in a local projects
- Use the following `metro.config.js` (you don't need to use the latest
Expo CLI for this to work):
```js
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("../../expo/packages/@expo/metro-config");
// const { getDefaultConfig } = require('expo/metro-config');
module.exports = getDefaultConfig(__dirname);
```
- `npx expo run:ios` and `npx expo run:android` should point to
`index.bundle`
- Changing the `main` field in the package.json or deleting `index.js`
should continue to work when you reload the app.
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->
- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).
---------
Co-authored-by: Expo Bot <[email protected]>
show more ...
|
| #
1171baab |
| 22-Mar-2023 |
Łukasz Kosmaty <[email protected]> |
[client] Remove vendored gesture handler (#21502)
# Why
Removes vendored gesture handler.
Another step to support Fabric by the dev-client.
> Note: To support fabric in the dev-client, we nee
[client] Remove vendored gesture handler (#21502)
# Why
Removes vendored gesture handler.
Another step to support Fabric by the dev-client.
> Note: To support fabric in the dev-client, we need to rewrite the safe area context, but that won't be difficult, because that module is pretty straightforward and we can use our API to support both renderers.
# How
- Removed vendored code.
- Mocked functions required by react-navigation.
- Disabled gesture in the stack navigator.
The swipe gesture won't longer close a screen, but I think it's something that we can sacrifice. Also, most of our screens are rendered inside the bottom tab navigator.
# Test Plan
- bare-expo on both platforms ✅
- ensures that the stack navigator works correctly ✅
show more ...
|
| #
e870aeee |
| 24-Feb-2023 |
Łukasz Kosmaty <[email protected]> |
[menu] Reimplement the bottom sheet using native languages (#21268)
# Why
Closes ENG-7280.
Reimplemented the bottom sheet using native languages and removed reanimated from vendored modules.
B
[menu] Reimplement the bottom sheet using native languages (#21268)
# Why
Closes ENG-7280.
Reimplemented the bottom sheet using native languages and removed reanimated from vendored modules.
By doing that we improve the build speed.
# How
- On Android, I've used the material design bottom sheet. We may want to copy the implementation from the original repo to ours to avoid extra dependency.
- On iOS, I've copied the implementation from https://github.com/applidium/OverlayContainer. I managed to test a couple of different libraries and that one works the best with RN.
# Test Plan
- bare-expo on both platforms ✅
show more ...
|
| #
b0ad0912 |
| 08-Nov-2022 |
Kudo Chien <[email protected]> |
[dev-client][splash-screen] Fix error when running with new arch mode on android (#19931)
# Why
when turning on new architecture mode with dev-client, there is a runtime crash:
```
java.lang.As
[dev-client][splash-screen] Fix error when running with new arch mode on android (#19931)
# Why
when turning on new architecture mode with dev-client, there is a runtime crash:
```
java.lang.AssertionError: TurboModules are enabled, but mTurboModuleRegistry hasn't been set.
```
fixes #19866
# How
- react-native has a singleton flag `ReactFeatureFlags.useTurboModules`. even though we have the `ReactNativeHost` with old architecture mode in dev-menu and dev-launcher, [the underlying `CatalystInstanceImpl` will still fail at the check](https://github.com/facebook/react-native/blob/dac6806559c49b267ce6eb2722c9ff3b9108ead1/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java#L473-L477). the `ReactPackageTurboModuleManagerDelegate.Builder` requires some c++ code, considering we don't support new architecture mode in dev-menu and dev-launcher, this pr uses a workaround to pass the `ReactPackageTurboModuleManagerDelegate.Builder` from MainApplication.
- when running on new architecture mode, there is a NPE in [`FrameLayout.onMeasure`](https://android.googlesource.com/platform/frameworks/base/+/4d07687915b39dd4c241f5d22e1f0bd02e41bff8/core/java/android/widget/FrameLayout.java#193). since splash screen view remove itself in `ViewGroup.OnHierarchyChangeListener`. the child iteration will get null from `getChildAt()`. the pr tries to remove the splash screen view from the next run loop.
# Test Plan
- https://github.com/evelant/test_fabric_eas_build + this pr's patch
show more ...
|
| #
50e5afb2 |
| 28-Sep-2022 |
Łukasz Kosmaty <[email protected]> |
[expo-dev-menu] Make internal runtime undebuggable (#19269)
# Why
Takes advantage of https://github.com/facebook/react-native/pull/34489.
It'll improve our integration with Hermes inspector - us
[expo-dev-menu] Make internal runtime undebuggable (#19269)
# Why
Takes advantage of https://github.com/facebook/react-native/pull/34489.
It'll improve our integration with Hermes inspector - users don't have to reload their app anymore to see correct sources.
# How
Set `enable debugger` on internal runtimes.
# Test Plan
I couldn't test it properly because our basic template crashes with RN `0.70`.
show more ...
|
| #
53977629 |
| 13-Jul-2022 |
Łukasz Kosmaty <[email protected]> |
[dev-menu] Update `react-native-reanimated` to `2.9.1` (#18182)
# Why
Closes ENG-5411.
Closes ENG-5685.
# How
Run:
```
et vendor -c "[dev-menu] reanimated"
```
and adjust the vendoring
[dev-menu] Update `react-native-reanimated` to `2.9.1` (#18182)
# Why
Closes ENG-5411.
Closes ENG-5685.
# How
Run:
```
et vendor -c "[dev-menu] reanimated"
```
and adjust the vendoring script.
# Test Plan
- bare-expo with NCL ✅
- bare-expo with sandbox ✅
show more ...
|