From bcd39f604f308ac146e3dcf12b14661a9e1ab7bf Mon Sep 17 00:00:00 2001 From: Charlie Cruzan <35579283+cruzach@users.noreply.github.com> Date: Tue, 9 Jun 2020 17:56:18 -0400 Subject: [PATCH] [docs] random docs fixes to close old PRs (#8749) --- docs/pages/introduction/managed-vs-bare.md | 28 +++++++++---------- docs/pages/tutorial/sharing.md | 18 +++++------- .../unversioned/react-native/asyncstorage.md | 2 -- .../pages/workflow/android-studio-emulator.md | 6 ++-- .../unversioned/tutorial/sharing-simple.js | 2 +- .../v37.0.0/tutorial/sharing-simple.js | 2 +- 6 files changed, 27 insertions(+), 31 deletions(-) diff --git a/docs/pages/introduction/managed-vs-bare.md b/docs/pages/introduction/managed-vs-bare.md index 8acf2f104b255e..f040916ed24098 100644 --- a/docs/pages/introduction/managed-vs-bare.md +++ b/docs/pages/introduction/managed-vs-bare.md @@ -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. @@ -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? diff --git a/docs/pages/tutorial/sharing.md b/docs/pages/tutorial/sharing.md index 91a7925501422d..a4fa5ab42d0184 100644 --- a/docs/pages/tutorial/sharing.md +++ b/docs/pages/tutorial/sharing.md @@ -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); @@ -40,20 +39,18 @@ export default function App() { return; } - Sharing.shareAsync(selectedImage.localUri); - };/* @end */ - + await Sharing.shareAsync(selectedImage.localUri); + }; /* @end */ if (selectedImage !== null) { return ( - /* @info Add a button to call the new share function */ Share this photo - /* @end */ - + + /* @end */ ); } @@ -88,7 +85,7 @@ export default function App() {

-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 — 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]() 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 — Chrome in this case.

@@ -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/). - \ No newline at end of file +There is just one small catch — 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. --> diff --git a/docs/pages/versions/unversioned/react-native/asyncstorage.md b/docs/pages/versions/unversioned/react-native/asyncstorage.md index de7df29e6c10db..51e1cc20aa0124 100644 --- a/docs/pages/versions/unversioned/react-native/asyncstorage.md +++ b/docs/pages/versions/unversioned/react-native/asyncstorage.md @@ -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. diff --git a/docs/pages/workflow/android-studio-emulator.md b/docs/pages/workflow/android-studio-emulator.md index 0d384f9347a849..17162683e1a121 100644 --- a/docs/pages/workflow/android-studio-emulator.md +++ b/docs/pages/workflow/android-studio-emulator.md @@ -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. diff --git a/docs/static/examples/unversioned/tutorial/sharing-simple.js b/docs/static/examples/unversioned/tutorial/sharing-simple.js index 3c44fdc63e1282..792ca0222f363c 100644 --- a/docs/static/examples/unversioned/tutorial/sharing-simple.js +++ b/docs/static/examples/unversioned/tutorial/sharing-simple.js @@ -28,7 +28,7 @@ export default function App() { return; } - Sharing.shareAsync(selectedImage.localUri); + await Sharing.shareAsync(selectedImage.localUri); }; if (selectedImage !== null) { diff --git a/docs/static/examples/v37.0.0/tutorial/sharing-simple.js b/docs/static/examples/v37.0.0/tutorial/sharing-simple.js index 3c44fdc63e1282..792ca0222f363c 100644 --- a/docs/static/examples/v37.0.0/tutorial/sharing-simple.js +++ b/docs/static/examples/v37.0.0/tutorial/sharing-simple.js @@ -28,7 +28,7 @@ export default function App() { return; } - Sharing.shareAsync(selectedImage.localUri); + await Sharing.shareAsync(selectedImage.localUri); }; if (selectedImage !== null) {