| #
e9e0e3eb |
| 27-Jun-2023 |
Kudo Chien <[email protected]> |
[bare-expo][templates] add gradle.properties to disable runtime scheduler (#23117)
# Why
we found some regression in sdk 49 for `useEffect` due to the `unstable_useRuntimeSchedulerAlways` change.
[bare-expo][templates] add gradle.properties to disable runtime scheduler (#23117)
# Why
we found some regression in sdk 49 for `useEffect` due to the `unstable_useRuntimeSchedulerAlways` change. though it is unclear how is it going in the meantime. let's add the workaround to disable to `unstable_useRuntimeSchedulerAlways`.
# How
since it is a workaround, i don't want to add the expo-build-properties support. if people come across the useEffect regression and want to test for `unstable_useRuntimeSchedulerAlways=false`. they could have an inline config-plugin
```js
# app.config.js
const { withGradleProperties } = require("expo/config-plugins");
function disableUnstableRuntimeScheduler(config) {
const KEY = "reactNative.unstable_useRuntimeSchedulerAlways";
return withGradleProperties(config, (config) => {
config.modResults = config.modResults.filter(
(item) => !(item.type === "property" && item.key === KEY)
);
config.modResults.push({
type: "property",
key: KEY,
value: "false",
});
return config;
});
}
export default ({ config }) => {
config.plugins = [...(config.plugins ?? []), disableUnstableRuntimeScheduler];
return config;
};
```
# Test Plan
ci passed
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 ...
|
| #
84f418d7 |
| 17-Jan-2023 |
Kudo Chien <[email protected]> |
[1/3] upgrade react-native 0.71 (#20799)
# Why
upgrade react-native 0.71 for sdk 48
close ENG-7192
# How
- update package versions
- `react: 18.1.0 -> 18.2.0`
- `react-native 0.70.5
[1/3] upgrade react-native 0.71 (#20799)
# Why
upgrade react-native 0.71 for sdk 48
close ENG-7192
# How
- update package versions
- `react: 18.1.0 -> 18.2.0`
- `react-native 0.70.5 -> 0.71.0`
- `react-dom: 18.1.0 -> 18.2.0`
- `react-test-renderer: 18.1.0 -> 18.2.0`
- `react-native-web: 0.18.9 -> 0.18.10`
- `babel-plugin-react-native-web: 0.18.9 -> 0.18.10`
- `metro-react-native-babel-preset: 0.72.3 -> 0.73.5`
- upgrade three project templates based on [upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.71.0)
- bare-expo
- expo-template-bare-minimum
- fabric-tester (this is based on `npx expo prebuild --clean --no-install --template /path/to/expo-template-bare-minimum.tgz`) so it includes some inconsistent changes
- [@expo/config-plugins]: support 0.71 template transform. the `namespace` in build.gradle and the files in `release` build variants
- [fbjni] upgrade 0.3.0 to align 0.71 (also ndk version)
- [expo-updates] move the `EX_UPDATES_NATIVE_DEBUG` `bundleInDebug` setup to templates. unfortunately, because RNGP setups the task dependencies pretty early. the original setup in expo-updates build.gradle is too late. note that the change doesn't reference any files from templates to expo-updates package. somehow it's not tightly coupled.
- [native-tests / expo-modules-test-core / expo-modules-autolinking] fix ios unit test build error because jsc now in a dedicated podspec. in theory, the ios native unit test could now run on hermes as well.
- for other details, please check commit histories one by one.
# Test Plan
- bare-expo ios / android
- fabric ios / android
- ci passed (except ios)
- test-suite ios is broken for unknown reasons. it breaks only on github actions and hermes. for nightlies testing, i also [changed it to jsc](https://github.com/expo/expo/blob/1e029c89c4247802cc4880e27e116a6b4c71c502/tools/src/commands/SetupReactNativeNightly.ts#L287-L293) to make ci green. i'll try to follow up and investigate the root cause.
show more ...
|
| #
b41c14cc |
| 02-Apr-2022 |
Kudo Chien <[email protected]> |
[android][ios] Upgrade to react-native 0.68 (#16532)
# Why
targeting react-native 0.68 in sdk 45 even though it's rc now.
# How
- [x] upgrade package.json
- [x] migrate bare-expo
- [x] mi
[android][ios] Upgrade to react-native 0.68 (#16532)
# Why
targeting react-native 0.68 in sdk 45 even though it's rc now.
# How
- [x] upgrade package.json
- [x] migrate bare-expo
- [x] migrate expo-template-bare-minimum
- [x] migrate bare-sandbox
❗️ reanimated build error because our previous integration is broken on AGP 7. solution in [the pr](https://github.com/software-mansion/react-native-reanimated/pull/3113). since the pr is not landed yet, i have a [temporarily workaround to patch reanimated](https://github.com/expo/expo/pull/16532/commits/8e5662bec377ea11edc21ec6114c39f6580cb56a).
# Test Plan
- android bare-expo launch test
- ios bare-expo launch test
show more ...
|
| #
38181698 |
| 09-Dec-2021 |
Brent Vatne <[email protected]> |
[templates] Update for latest SDK 44 and remove reanimated from bare template
|
| #
9781212e |
| 20-Sep-2021 |
Kudo Chien <[email protected]> |
[templates] Update templates for the next SDK (#14409)
# Why
Update templates for the next SDK
# How
- `et update-project-templates`
- manually updated some dependencies like `react`, `rea
[templates] Update templates for the next SDK (#14409)
# Why
Update templates for the next SDK
# How
- `et update-project-templates`
- manually updated some dependencies like `react`, `react-dom`, `react-native`, `react-native-web`, `@types/react`
- migrated bare template from unimodules to expo modules
- [android] migrate unimodules to expo-modules
- [android] integrate ReactNativeHostWrapper / ReactActivityDelegateWrapper
- replace splash screen integration by in-module setup
- replace expo-updates integration by in-module setup
- add Podfile.properties.json with hermes support
- fix other `node_modules` resolution where breaking monorepo support, e.g. hermes-engine or maven repo.
- use mavenCentral before jcenter because [jcenter will be a read-only mirror repository](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)
Co-authored-by: Tomasz Sapeta <[email protected]>
Co-authored-by: Cedric van Putten <[email protected]>
# Test Plan
```sh
expo init -t /path/to/templates/expo-template-bare-minimum sdk43
cd sdk43
expo run:android
expo run:android --variant release
expo run:ios
expo run:ios --configuration Release
```
show more ...
|
| #
63b5a92b |
| 23-Jun-2021 |
Brent Vatne <[email protected]> |
[templates] Remove unnecessary imports
|
| #
d4666f63 |
| 01-Apr-2021 |
Brent Vatne <[email protected]> |
[reanimated] Bump to 2.1.0 on JS side - should be runtime compatible with 2.0.1 (#12393)
* [reanimated] Bump to 2.1.0 on JS side - should be runtime compatible with 2.0.1
* [templates] Update for
[reanimated] Bump to 2.1.0 on JS side - should be runtime compatible with 2.0.1 (#12393)
* [reanimated] Bump to 2.1.0 on JS side - should be runtime compatible with 2.0.1
* [templates] Update for [email protected]
show more ...
|
| #
4a1ceed6 |
| 26-Oct-2020 |
Colton McCormack <[email protected]> |
[templates] Fixes flipper namespace (#10749)
|
| #
9ce58959 |
| 27-Jun-2020 |
Eric Samelson <[email protected]> |
[templates][bare] fix expo-updates installation compatibility with Flipper on Android
|
| #
4c712bd3 |
| 24-Jun-2020 |
Brent Vatne <[email protected]> |
[templates] Update bare templates to React Native 62
|
| #
bdcd7c24 |
| 06-Apr-2020 |
Hein Rutjes <[email protected]> |
[templates] Upgrade bare templates to react-native 0.61.5 (#7634)
* [templates] Update expo-template-bare-minimum to rn 0.61.5
* [templates][android] Update expo-template-bare-typescript to rn 0.
[templates] Upgrade bare templates to react-native 0.61.5 (#7634)
* [templates] Update expo-template-bare-minimum to rn 0.61.5
* [templates][android] Update expo-template-bare-typescript to rn 0.61.5
* [templates] Upgrade gradle for bare templates
* [templates] Fix bare templates after upgrade
* [templates] Update bare-templates debug keystore
* [templates] Clean up babel files in bare templates
* [templates] Revert bare templates to Android targetSdkVersion 27
Tried using `targetSdkVersion = 28` because this was also used for RN61.5. However the android app wont start correctly as it doesn’t seem to be able to connect to the metro bundler
* [templates] Update expo deps in bare templates
* Revert "[templates] Revert bare templates to Android targetSdkVersion 27"
This reverts commit 9dff8b4cbe6beac1176d338b0f58631aeafd1e47.
show more ...
|
| #
84a49fb3 |
| 31-Mar-2020 |
Michał Czernek <[email protected]> |
[react-native-unimodules] Add one parameter constructor to ReactModuleRegistryProvider.
* [expo-task-manager] Fix task manager dependencies.
* [react-native-unimodules] Add one parameter construc
[react-native-unimodules] Add one parameter constructor to ReactModuleRegistryProvider.
* [expo-task-manager] Fix task manager dependencies.
* [react-native-unimodules] Add one parameter constructor to ReactModuleRegistryProvider.
show more ...
|
| #
a39eedb5 |
| 17-Mar-2020 |
Eric Samelson <[email protected]> |
[expo-template-bare-minimum][expo-template-bare-typescript] add expo-updates
|
| #
0c403cd6 |
| 14-Jan-2020 |
Stanisław Chmiela <[email protected]> |
[bare] Enable singleton modules creation (#6751)
This is a reapplication of https://github.com/expo/expo/pull/6575 + changes of `templates`.
---
# Why
I'll add singleton modules in `expo-no
[bare] Enable singleton modules creation (#6751)
This is a reapplication of https://github.com/expo/expo/pull/6575 + changes of `templates`.
---
# Why
I'll add singleton modules in `expo-notifications` PR and, since I'm testing the new library in `bare-expo` project, it needs to handle singleton modules well.
# How
If we pass `null` in place of `singletonModules` argument, when `ReactModuleRegistryProvider` calls `getSingletonModules()` they'll get created:
https://github.com/expo/expo/blob/9c60cc74437760fafe100fee9cbccf204fc1baf7/packages/%40unimodules/react-native-adapter/android/src/main/java/org/unimodules/adapters/react/ReactModuleRegistryProvider.java#L58-L69
# Test Plan
`bare-expo` created singleton modules and passed them to module registry, letting exported modules query them by name.
show more ...
|
| #
b8e06d27 |
| 07-Jan-2020 |
Brent Vatne <[email protected]> |
[bare][templates] Add rncli autolinking, remove jetifier, lock screens version
|
| #
2b23d6fc |
| 03-Sep-2019 |
Brent Vatne <[email protected]> |
[templates] Add react-native-screens to bare templates
|
| #
fc5b24b5 |
| 10-Jul-2019 |
Brent Vatne <[email protected]> |
Add reanimated to bare template as well
|
| #
ed546445 |
| 09-Jul-2019 |
Brent Vatne <[email protected]> |
[expo] Remove most expo-* packages from expo package (#4815)
# Why
In SDK33 we deprecated imports from the Expo package, instead users install them separately, eg: `expo install expo-sensors`. Th
[expo] Remove most expo-* packages from expo package (#4815)
# Why
In SDK33 we deprecated imports from the Expo package, instead users install them separately, eg: `expo install expo-sensors`. This has many benefits that we're already aware of that I'm not going to repeat here for brevity.
# How
I removed the dependencies and tested in a local bare project to ensure that the project would build and run in Xcode and also that it would work in the Expo client.
I had to keep some of the unimodule dependencies around because they are used by parts of the expo package in a way we can't remove (globals, for example).
# Test Plan
You can install `[email protected]` to a bare project and give it a try!
# Checklist
- [x] Verify it works as expected in bare on iOS and Android
- [x] Verify it works as expected in managed on iOS and Android
- [x] Verify it works for web
- [x] Add docs for community native modules we include now that they can't be imported from the expo package
- [x] Create a package for the `Google.ts` file so it doesn't need to live in the `expo` package and force a dependency on `expo-app-auth`
- [x] Update new project template to include RNGH
# Followup
- @EvanBacon is planning on removing maps related code from the package and into something like `expo-maps`
show more ...
|
| #
5405e058 |
| 29-Apr-2019 |
Brent Vatne <[email protected]> |
[templates] Update bare template to latest unimodules
|
| #
932eebb6 |
| 14-Mar-2019 |
Brent Vatne <[email protected]> |
[templates] @unimodules/core -> react-native-unimodules
|
| #
ade898b0 |
| 05-Mar-2019 |
Ville Immonen <[email protected]> |
Move expo-template-bare-minimum to correct folder
|