Skip to content

Commit 3d9cd9a

Browse files
committed
Exponent -> Expo
1 parent 2d36f3b commit 3d9cd9a

File tree

18 files changed

+100
-102
lines changed

18 files changed

+100
-102
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ You'll specify a CLI config file in your test project's app.json:
5656

5757
```
5858
{
59-
"exponent": {
59+
"expo": {
6060
"sdkVersion": "12.0.0",
6161
"packagerOpts": {
6262
"config": "rn-cli.config.js"

EJECTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you see the reason you'd like to eject, click the link for a short explanatio
1212

1313
Create React Native App makes it easy to start working on React Native apps by removing native code build tools from the equation. However, many apps want functionality that comes from interfacing directly with mobile platform APIs via Java, Objective-C, Swift, C, etc. As of right now, the only way to get direct access to these APIs from your app is by "ejecting" from CRNA and building the native code yourself.
1414

15-
You may also want to distribute your app to coworkers, friends, or customers (shocking!). Right now you can do so by either making use of a service to host or build your CRNA app or by ejecting. At the moment, Exponent is the only provider we're aware of that offers [hosting](https://docs.getexponent.com/versions/latest/guides/how-exponent-works.html#publishing-deploying-an-exponent-app-in-production) and [build services](https://docs.getexponent.com/versions/latest/guides/building-standalone-apps.html) for CRNA apps, but we'll definitely update this section as we become aware of others.
15+
You may also want to distribute your app to coworkers, friends, or customers (shocking!). Right now you can do so by either making use of a service to host or build your CRNA app or by ejecting. At the moment, Expo is the only provider we're aware of that offers [hosting](https://docs.expo.io/versions/latest/guides/how-exponent-works.html#publishingdeploying-an-exponent-app-in-production) and [build services](https://docs.expo.io/versions/latest/guides/building-standalone-apps.html) for CRNA apps, but we'll definitely update this section as we become aware of others.
1616

1717
If you do need to eject to build your own distribution package or to include your own native code, there are two options at this time. To use either option, make sure to have the appropriate [Xcode and/or Android Studio environment](https://facebook.github.io/react-native/docs/getting-started.html) configured.
1818

@@ -26,19 +26,19 @@ npm i -g react-native-cli
2626
yarn global add react-native-cli
2727
```
2828

29-
Also, please note that if you did make use of any Exponent APIs before ejecting, you'll need to remove or replace them.
29+
Also, please note that if you did make use of any Expo APIs before ejecting, you'll need to remove or replace them.
3030

31-
### Ejecting to ExponentKit
31+
### Ejecting to ExpoKit
3232

33-
Using ExponentKit will allow you to continue using Exponent APIs along with building your own native code, but it requires an Exponent account and use of Exponent developer tools.
33+
Using ExpoKit will allow you to continue using Expo APIs along with building your own native code, but it requires an Expo account and use of Expo developer tools.
3434

35-
Because this ejection process essentially produces a custom build of the Exponent client app, you don't need to modify any of your app's code, but you do still need to have an Xcode/Android Studio environment, along with `react-native-cli` and either [Exponent XDE](https://docs.getexponent.com/versions/latest/introduction/installation.html) or [`exp`](https://docs.getexponent.com/versions/latest/guides/exp-cli.html).
35+
Because this ejection process essentially produces a custom build of the Expo client app, you don't need to modify any of your app's code, but you do still need to have an Xcode/Android Studio environment, along with `react-native-cli` and either [Expo XDE](https://docs.expo.io/versions/latest/introduction/installation.html) or [`exp`](https://docs.expo.io/versions/latest/guides/exp-cli.html).
3636

3737
## Specific Motivations
3838

3939
### React Native Link
4040

41-
If you need to include a library which includes `react-native link` in its install instructions, there's a good chance you need to eject from CRNA. That said, there are JavaScript-only options available for a number of tasks, including some that are [built into the Exponent app](https://docs.getexponent.com/versions/latest/sdk/index.html) that CRNA uses to run your project.
41+
If you need to include a library which includes `react-native link` in its install instructions, there's a good chance you need to eject from CRNA. That said, there are JavaScript-only options available for a number of tasks, including some that are [built into the Expo app](https://docs.expo.io/versions/latest/sdk/index.html) that CRNA uses to run your project.
4242

4343
TODO write a table of common needs in RN apps that can be done from JS
4444

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ $ cd my-app/
1818
$ npm start
1919
```
2020

21-
Install the [Exponent](https://getexponent.com) app on your iOS or Android phone, and use the QR code in the terminal to open your app. When you're ready to share your project with others (for example, by deploying to an app store), read the [Sharing & Deployment](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#sharing-deployment) section of the User Guide.
21+
Install the [Expo](https://expo.io) app on your iOS or Android phone, and use the QR code in the terminal to open your app. When you're ready to share your project with others (for example, by deploying to an app store), read the [Sharing & Deployment](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#sharing-deployment) section of the User Guide.
2222

23-
Create React Native App allows you to work with all of the [Components and APIs](https://facebook.github.io/react-native/docs/getting-started.html) in React Native, as well as most of the [JavaScript APIs](https://docs.getexponent.com/versions/latest/sdk/index.html) that the Exponent App provides.
23+
Create React Native App allows you to work with all of the [Components and APIs](https://facebook.github.io/react-native/docs/getting-started.html) in React Native, as well as most of the [JavaScript APIs](https://docs.expo.io/versions/latest/sdk/index.html) that the Expo App provides.
2424

2525
## Sections
2626

@@ -63,7 +63,7 @@ If you're familiar with React Native already, you won't find any `ios` or `andro
6363

6464
Runs your app in development mode.
6565

66-
Open it in the [Exponent app](https://getexponent.com) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.
66+
Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.
6767

6868
#### `npm test`
6969

@@ -100,11 +100,11 @@ The main limitation of a CRNA project is that it must be written in pure JavaScr
100100

101101
Apps made with Create React Native App support everything in the Components and APIs sections of the [React Native Documentation](https://facebook.github.io/react-native/docs/getting-started.html).
102102

103-
Apps made with Create React Native App also support most of the JavaScript-to-Native APIs provided by the [Exponent SDK](https://docs.getexponent.com/versions/latest/sdk/index.html), since they are loaded by the Exponent app.
103+
Apps made with Create React Native App also support most of the JavaScript-to-Native APIs provided by the [Expo SDK](https://docs.expo.io/versions/latest/sdk/index.html), since they are loaded by the Expo app.
104104

105105
If you're sure that you need custom native code, please read the [ejecting guide](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md).
106106

107-
If you need to build IPAs and APKs for publishing to the App Store and/or Play Store, you can either eject (see above guide) and build them yourself using Xcode and Android Studio, or you can use a service like [Exponent's standalone app builds](https://docs.getexponent.com/versions/v13.0.0/guides/building-standalone-apps.html) to publish your pure JS app.
107+
If you need to build IPAs and APKs for publishing to the App Store and/or Play Store, you can either eject (see above guide) and build them yourself using Xcode and Android Studio, or you can use a service like [Expo's standalone app builds](https://docs.expo.io/versions/v13.0.0/guides/building-standalone-apps.html) to publish your pure JS app.
108108

109109
## Support and Contact
110110

VERSIONS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Apps built with Create React Native App rely on three project dependencies:
44

55
* `react-native` provides the core React Native functionality
66
* `react` is a peer dependency of `react-native`
7-
* `exponent` makes CRNA projects compatible with the Exponent client app, and also provides access to several native APIs through JavaScript
7+
* `expo` makes CRNA projects compatible with the Expo client app, and also provides access to several native APIs through JavaScript
88

9-
The `app.json` file in a CRNA project also specifies `sdkVersion` which is necessary for the Exponent client to provide the correct native API versions.
9+
The `app.json` file in a CRNA project also specifies `sdkVersion` which is necessary for the Expo client to provide the correct native API versions.
1010

1111
Each version of these dependencies is only compatible with a narrow version range of the other two. See the below table for the correct versions to use with each other:
1212

13-
| `react-native` | `react` | `exponent` | `sdkVersion` in app.json |
14-
|----------------|---------|------------|--------------------------|
15-
| 0.41.x | 15.4.x | 14.x.x | `"14.0.0"` |
16-
| | | | |
17-
| | | | |
13+
| `react-native` | `react` | `expo` | `sdkVersion` in app.json |
14+
|----------------|---------|--------|--------------------------|
15+
| 0.41.x | 15.4.x | 14.x.x | `"14.0.0"` |
16+
| | | | |
17+
| | | | |

create-react-native-app/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function checkAppName(appName: string, packageName: string): void {
205205
const allDependencies = [
206206
'react-native-scripts',
207207
'exponent',
208+
'expo',
208209
'vector-icons',
209210
'react',
210211
'react-native',

react-native-scripts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-scripts",
3-
"version": "0.0.13",
3+
"version": "0.0.14",
44
"description": "Configuration and scripts for Create React Native App.",
55
"license": "BSD-3-Clause",
66
"keywords": [
@@ -32,7 +32,7 @@
3232
"match-require": "^2.0.0",
3333
"path-exists": "^3.0.0",
3434
"qrcode-terminal": "^0.11.0",
35-
"xdl": "^32.0.0"
35+
"xdl": "^33.0.0"
3636
},
3737
"devDependencies": {
3838
"babel-plugin-add-module-exports": "^0.2.1",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Exponent from 'exponent';
1+
import Expo from 'expo';
22
import App from '../../../../App';
33

4-
Exponent.registerRootComponent(App);
4+
Expo.registerRootComponent(App);

react-native-scripts/src/scripts/android.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ async function startAndroidAndPrintInfo() {
2525

2626
qr.generate(address, qrCode => {
2727
console.log(
28-
`To view your app with live reloading, point the Exponent app to this QR code. You'll find the QR scanner on the Projects tab of the app, under the '+' menu.
28+
`To view your app with live reloading, point the Expo app to this QR code. You'll find the QR scanner on the Projects tab of the app, under the '+' menu.
2929
3030
${indent(qrCode, 2)}
3131
32-
Or enter this address in the Exponent app's search bar:
32+
Or enter this address in the Expo app's search bar:
3333
3434
${chalk.underline(chalk.cyan(address))}
3535
3636
Your phone will need to be on the same local network as this computer.
3737
38-
For links to install the Exponent app, please visit ${chalk.underline(chalk.cyan('https://getexponent.com'))}.
38+
For links to install the Expo app, please visit ${chalk.underline(chalk.cyan('https://expo.io'))}.
3939
4040
Logs from serving your app will appear here. Press Ctrl+C at any time to stop.
4141
`

react-native-scripts/src/scripts/eject.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ import matchRequire from 'match-require';
77
import path from 'path';
88
import spawn from 'cross-spawn';
99

10-
import { detach } from '../util/exponent';
10+
import { detach } from '../util/expo';
1111

1212
async function eject() {
1313
try {
14-
const filesWithExponent = await filesUsingExponentSdk();
15-
const usingExponent = filesWithExponent.length > 0;
14+
const filesWithExpo = await filesUsingExpoSdk();
15+
const usingExpo = filesWithExpo.length > 0;
1616

17-
let exponentSdkWarning;
18-
if (usingExponent) {
19-
exponentSdkWarning = `${chalk.bold('Warning!')} We found at least one file where your project imports the Exponent SDK:
17+
let expoSdkWarning;
18+
if (usingExpo) {
19+
expoSdkWarning = `${chalk.bold('Warning!')} We found at least one file where your project imports the Expo SDK:
2020
`;
2121

22-
for (let filename of filesWithExponent) {
23-
exponentSdkWarning += ` ${chalk.cyan(filename)}\n`;
22+
for (let filename of filesWithExpo) {
23+
expoSdkWarning += ` ${chalk.cyan(filename)}\n`;
2424
}
2525

26-
exponentSdkWarning += `
26+
expoSdkWarning += `
2727
${chalk.yellow.bold('If you choose the "plain" React Native option below, these imports will stop working.')}`;
2828
} else {
29-
exponentSdkWarning = `\
30-
We didn't find any uses of the Exponent SDK in your project, so you should be fine to eject to
29+
expoSdkWarning = `\
30+
We didn't find any uses of the Expo SDK in your project, so you should be fine to eject to
3131
"Plain" React Native. (This check isn't very sophisticated, though.)`;
3232
}
3333

3434
console.log(
3535
`
36-
${exponentSdkWarning}
36+
${expoSdkWarning}
3737
3838
We ${chalk.italic('strongly')} recommend that you read this document before you proceed:
3939
${chalk.cyan('https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md')}
@@ -47,15 +47,15 @@ Ejecting is permanent! Please be careful with your selection.
4747
type: 'list',
4848
name: 'ejectMethod',
4949
message: 'How would you like to eject from create-react-native-app?',
50-
default: usingExponent ? 'exponentKit' : 'raw',
50+
default: usingExpo ? 'expoKit' : 'raw',
5151
choices: [
5252
{
5353
name: "React Native: I'd like a regular React Native project.",
5454
value: 'raw',
5555
},
5656
{
57-
name: "ExponentKit: I'll create or log in with an Exponent account to use React Native and the Exponent SDK.",
58-
value: 'exponentKit',
57+
name: "ExpoKit: I'll create or log in with an Expo account to use React Native and the Expo SDK.",
58+
value: 'expoKit',
5959
},
6060
{
6161
name: "Cancel: I'll continue with my current project structure.",
@@ -74,7 +74,7 @@ Ejecting is permanent! Please be careful with your selection.
7474
let {
7575
name: newName,
7676
displayName: newDisplayName,
77-
exponent: { name: expName },
77+
expo: { name: expName },
7878
} = appJson;
7979

8080
// we ask user to provide a project name (default is package name stripped of dashes)
@@ -174,10 +174,10 @@ If you have a .babelrc in your project, make sure to change the preset to \`reac
174174

175175
delete pkgJson.main;
176176

177-
// NOTE: exponent won't work after performing a raw eject, so we should delete this
177+
// NOTE: expo won't work after performing a raw eject, so we should delete this
178178
// it will be a better error message for the module to not be found than for whatever problems
179179
// missing native modules will cause
180-
delete pkgJson.dependencies.exponent;
180+
delete pkgJson.dependencies.expo;
181181
delete pkgJson.devDependencies['react-native-scripts'];
182182

183183
pkgJson.scripts.start = 'react-native start';
@@ -196,7 +196,7 @@ If you have a .babelrc in your project, make sure to change the preset to \`reac
196196
// FIXME now we need to provide platform-specific entry points until upstream uses a single one
197197
console.log(chalk.blue(`Adding platform-specific entry points...`));
198198

199-
const lolThatsSomeComplexCode = `import { AppRegistry } from 'react-native';
199+
const lolThatsSomeComplexCode = `import { AppRegistry } from 'react-native';
200200
import App from './App';
201201
AppRegistry.registerComponent('${newName}', () => App);
202202
`;
@@ -220,7 +220,7 @@ to ensure that the changes we made to package.json persist correctly.
220220
`
221221
)
222222
);
223-
} else if (ejectMethod === 'exponentKit') {
223+
} else if (ejectMethod === 'expoKit') {
224224
await detach();
225225
} else {
226226
// we don't want to print the survey for cancellations
@@ -238,7 +238,7 @@ Please consider letting us know why you ejected in this survey:
238238
}
239239
}
240240

241-
async function filesUsingExponentSdk(): Promise<Array<string>> {
241+
async function filesUsingExpoSdk(): Promise<Array<string>> {
242242
const projectJsFiles = await findJavaScriptProjectFilesInRoot(process.cwd());
243243

244244
const jsFileContents = (await Promise.all(
@@ -250,19 +250,19 @@ async function filesUsingExponentSdk(): Promise<Array<string>> {
250250
};
251251
});
252252

253-
const filesUsingExponent = [];
253+
const filesUsingExpo = [];
254254

255255
for (let { filename, contents } of jsFileContents) {
256256
const requires = matchRequire.findAll(contents);
257257

258-
if (requires.includes('exponent')) {
259-
filesUsingExponent.push(filename);
258+
if (requires.includes('expo')) {
259+
filesUsingExpo.push(filename);
260260
}
261261
}
262262

263-
filesUsingExponent.sort();
263+
filesUsingExpo.sort();
264264

265-
return filesUsingExponent;
265+
return filesUsingExpo;
266266
}
267267

268268
function stripDashes(s: string): string {
@@ -308,7 +308,7 @@ async function findJavaScriptProjectFilesInRoot(root: string): Promise<Array<str
308308

309309
eject()
310310
.then(() => {
311-
// the exponent local github auth server leaves a setTimeout for 5 minutes
311+
// the expo local github auth server leaves a setTimeout for 5 minutes
312312
// so we need to explicitly exit (for now, this will be resolved in the nearish future)
313313
process.exit(0);
314314
})

react-native-scripts/src/scripts/init.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import spawn from 'cross-spawn';
88

99
// UPDATE DEPENDENCY VERSIONS HERE
1010
const DEFAULT_DEPENDENCIES = {
11-
exponent: '14.0.0',
11+
expo: '14.0.2',
1212
react: '~15.4.0',
1313
'react-native': '0.41.2',
1414
};
1515

1616
// TODO figure out how this interacts with ejection
1717
const DEFAULT_DEV_DEPENDENCIES = {
18-
'jest-exponent': '^0.2.0',
18+
'jest-expo': '^0.2.1',
1919
};
2020

2121
module.exports = async (appPath: string, appName: string, verbose: boolean) => {
@@ -42,7 +42,7 @@ module.exports = async (appPath: string, appName: string, verbose: boolean) => {
4242
};
4343

4444
appPackage.jest = {
45-
preset: 'jest-exponent',
45+
preset: 'jest-expo',
4646
};
4747

4848
if (!appPackage.dependencies) {
@@ -124,14 +124,14 @@ Success! Created ${appName} at ${appPath}
124124
Inside that directory, you can run several commands:
125125
126126
${chalk.cyan(command + ' start')}
127-
Starts the development server so you can open your app in the Exponent
127+
Starts the development server so you can open your app in the Expo
128128
app on your phone.
129129
130130
${chalk.cyan(command + ' run ios')}
131131
(Mac only, requires Xcode)
132132
Starts the development server and loads your app in an iOS simulator.
133133
134-
${chalk.cyan(command + 'run android')}
134+
${chalk.cyan(command + ' run android')}
135135
(Requires Android build tools)
136136
Starts the development server and loads your app on a connected Android
137137
device or emulator.

0 commit comments

Comments
 (0)