Skip to content

Commit

Permalink
[docs] random docs fixes to close old PRs (expo#8749)
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzach authored Jun 9, 2020
1 parent 67a7bf2 commit bcd39f6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 31 deletions.
28 changes: 14 additions & 14 deletions docs/pages/introduction/managed-vs-bare.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ sidebar_title: Workflows

The two approaches to building applications with Expo tools are called the "managed" and "bare" workflows.

- With the managed workflow you only write JavaScript / TypeScript and Expo tools and services take care of the rest for you.
- In the bare workflow you have full control over every aspect of the native project, and Expo tools can't help quite as much.
- With the _managed workflow_ you only write JavaScript / TypeScript and Expo tools and services take care of everything else for you.
- In the _bare workflow_ you have full control over every aspect of the native project, and Expo tools and services are a little more limited.

> 💡 **If you've used React Native without any Expo tools** then you have used the "bare workflow", but the name probably doesn't sound familiar. We call this "bare" somewhat in jest and because of the term "bare metal" which and it's easier to talk about something when it has a name. If you have direct access to the native code, it's a bare project. The ["Already used React Native?"](../../workflow/already-used-react-native/) page might be useful for you to quickly understand where Expo fits in.
> 💡 **If you've used React Native without any Expo tools** then you have used the "bare workflow", but the name probably doesn't sound familiar. It's easier to talk about something when it has a name, so we call this "bare" somewhat in jest, and because of the existing term "bare metal". If you have direct access to the native code it's a _bare_ project. The ["Already used React Native?"](../../workflow/already-used-react-native/) page might be useful for you to quickly understand where Expo fits in.
## Managed workflow

The managed workflow is kind of like "[Rails](https://rubyonrails.org/)" and "[Create React App](https://github.com/facebook/create-react-app)" for React Native.
The managed workflow is kind of like [Rails](https://rubyonrails.org/) and [Create React App](https://github.com/facebook/create-react-app), but for React Native.

Apps are built with the managed workflow using the [expo-cli](../../workflow/expo-cli/), the Expo client on your mobile device, and our various services: [push notifications](../../guides/push-notifications/), the [build service](../../distribution/building-standalone-apps/), and [over-the-air (OTA) updates](../../guides/configuring-ota-updates/). **Expo tries to manage as much of the complexity of building apps for you as we can, which is why we call it the managed workflow**. A developer using the managed workflow doesn't use Xcode or Android Studio, they just write JavaScript code and manage configuration for things like the app icon and splash screen through [app.json](../../workflow/configuration/). The Expo SDK exposes an increasingly comprehensive set of APIs that give you the power to access device capabilities like the camera, biometric authentication, file system, haptics, and so on.

Expand All @@ -32,16 +32,16 @@ In the bare workflow the developer has complete control, along with the complexi

## Workflow comparison

| Feature | Managed workflow | Bare workflow |
| ------------------------------------------------------ | ---------------- | ------------------------------------------- |
| Develop apps with **only** JavaScript/TypeScript || |
| Use Expo build service to create your iOS and Android builds || ⏱ (in progress) |
| Use Expo's push notification service |||
| Use Expo's over the air updates features |||
| Develop with the Expo client app || ✅ (if you follow [these guidlines](../../bare/using-expo-client/)) |
| Access to Expo SDK |||
| Add custom native code and manage native dependencies | ||
| Develop in Xcode and Android Studio | ||
| Feature | Managed workflow | Bare workflow |
| ------------------------------------------------------------ | ---------------- | ------------------------------------------------------------------- |
| Develop apps with **only** JavaScript/TypeScript || |
| Use Expo build service to create your iOS and Android builds || ⏱ (in progress) |
| Use Expo's push notification service || |
| Use Expo's over the air updates features || |
| Develop with the Expo client app || ✅ (if you follow [these guidlines](../../bare/using-expo-client/)) |
| Access to Expo SDK || |
| Add custom native code and manage native dependencies | | |
| Develop in Xcode and Android Studio | | |

## Which workflow is right for me?

Expand Down
18 changes: 7 additions & 11 deletions docs/pages/tutorial/sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ You can install expo-sharing in the same way as you installed expo-image-picker:
import React from 'react';
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import * as ImagePicker from 'expo-image-picker';
/* @info As always, we must import it to use it */import * as Sharing from 'expo-sharing';/* @end */

/* @info As always, we must import it to use it */ import * as Sharing from 'expo-sharing'; /* @end */

export default function App() {
const [selectedImage, setSelectedImage] = React.useState(null);
Expand All @@ -40,20 +39,18 @@ export default function App() {
return;
}

Sharing.shareAsync(selectedImage.localUri);
};/* @end */

await Sharing.shareAsync(selectedImage.localUri);
}; /* @end */

if (selectedImage !== null) {
return (
<View style={styles.container}>
<Image source={{ uri: selectedImage.localUri }} style={styles.thumbnail} />

/* @info Add a button to call the new share function */
<TouchableOpacity onPress={openShareDialogAsync} style={styles.button}>
<Text style={styles.buttonText}>Share this photo</Text>
</TouchableOpacity>/* @end */

</TouchableOpacity>
/* @end */
</View>
);
}
Expand Down Expand Up @@ -88,7 +85,7 @@ export default function App() {

<p>

Sharing didn't work here because the desktop Chrome browser doesn't yet implement the [Web Share API](https://web.dev/web-share/). *"But wait,"* you say, *"aren't we using expo-sharing, not the Web Share API?"* You can you can think of the Expo SDK libraries as translators for different platforms. They speak the language of Expo and turn it into the language of iOS, Android, and web. It isn't always possible to translate from Expo's language to the platform that you're working with. In other words, if the platform doesn't implement a feature, Expo can't tell it to invoke that feature. In some cases Expo can attempt to [polyfill](https://en.wikipedia.org/wiki/Polyfill_(programming)) the feature for you, but this isn't always possible. Invoking your operating system's built-in share dialog to share content with other applications needs to be implemented by the platform itself &mdash; Chrome in this case.
Sharing didn't work here because the desktop Chrome browser doesn't yet implement the [Web Share API](https://web.dev/web-share/). _"But wait,"_ you say, _"aren't we using expo-sharing, not the Web Share API?"_ You can you can think of the Expo SDK libraries as translators for different platforms. They speak the language of Expo and turn it into the language of iOS, Android, and web. It isn't always possible to translate from Expo's language to the platform that you're working with. In other words, if the platform doesn't implement a feature, Expo can't tell it to invoke that feature. In some cases Expo can attempt to [polyfill](<https://en.wikipedia.org/wiki/Polyfill_(programming)>) the feature for you, but this isn't always possible. Invoking your operating system's built-in share dialog to share content with other applications needs to be implemented by the platform itself &mdash; Chrome in this case.

</p>
</details>
Expand All @@ -97,7 +94,6 @@ Sharing didn't work here because the desktop Chrome browser doesn't yet implemen

In the next section we are going to look at how we can handle this and another important platform difference. [Continue to "Handling platform differences"](../../tutorial/platform-differences/).


<!-- TODO(brentvatne): when we have a better workflow for https in expo-cli and a way to open Snack web on mobile we should revisit this -->

<!-- ### Getting it working with another browser
Expand All @@ -107,4 +103,4 @@ Sharing is supported on the following browsers at the time of writing:
- Recent versions of mobile and desktop Safari.
- Recent versions of Chrome for Android.
There is just one small catch &mdash; we need to use `https`. Close `expo-cli` and run it again with `expo start --https`. Now we can copy and paste the URL into Safari and try again. -->
There is just one small catch &mdash; we need to use `https`. Close `expo-cli` and run it again with `expo start --https`. Now we can copy and paste the URL into Safari and try again. -->
2 changes: 0 additions & 2 deletions docs/pages/versions/unversioned/react-native/asyncstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ id: asyncstorage
title: AsyncStorage
---

> **Deprecated.** Use [react-native-community/react-native-async-storage](https://github.com/react-native-community/react-native-async-storage) instead.
`AsyncStorage` is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage.

It is recommended that you use an abstraction on top of `AsyncStorage` instead of `AsyncStorage` directly for anything more than light usage since it operates globally.
Expand Down
6 changes: 4 additions & 2 deletions docs/pages/workflow/android-studio-emulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ If you don't have an Android device available to test with, we recommend using t

![Android SDK location](/static/images/android-studio-sdk-location.png)

- If you are on macOS or Linux, add the Android SDK location to your PATH using `~/.bash_profile` or `~/.bash_rc`. You can do this by adding a line like `export ANDROID_SDK=/Users/myuser/Library/Android/sdk`.
- If you are on macOS or Linux, add the Android SDK location to your PATH using `~/.bash_profile` or `~/.bashrc`. You can do this by adding a line like `export ANDROID_SDK=/Users/myuser/Library/Android/sdk`.

- On macOS, you will also need to add `platform-tools` to your `~/.bash_profile` or `~/.bash_rc.`, by adding a line like `export PATH=/Users/myuser/Library/Android/sdk/platform-tools:$PATH`
- On macOS, you will also need to add `platform-tools` to your `~/.bash_profile` or `~/.bashrc.`, by adding a line like `export PATH=/Users/myuser/Library/Android/sdk/platform-tools:$PATH`

> Note that later versions of macOS, such as Catalina, use `zsh` instead of `bash`, so you will update `.zsh_profile` or `.zshrc` instead.
- Make sure that you can run `adb` from your terminal.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function App() {
return;
}

Sharing.shareAsync(selectedImage.localUri);
await Sharing.shareAsync(selectedImage.localUri);
};

if (selectedImage !== null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/static/examples/v37.0.0/tutorial/sharing-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function App() {
return;
}

Sharing.shareAsync(selectedImage.localUri);
await Sharing.shareAsync(selectedImage.localUri);
};

if (selectedImage !== null) {
Expand Down

0 comments on commit bcd39f6

Please sign in to comment.