Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(JS): Update v5 JS libraries installation guides. #7090

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
To install the Amplify library to use the analytics features, run the following command in your project’s root folder:

```bash
npm install aws-amplify
npm install aws-amplify@^5
```
4 changes: 2 additions & 2 deletions src/fragments/lib-v1/auth/js/getting-started-rn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Amplify uses [Amazon Cognito](https://aws.amazon.com/cognito/) as the main authe
Install the necessary dependencies by running the following command:

```sh
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
```

You will also need to install the pod dependencies for iOS:
Expand All @@ -31,7 +31,7 @@ npm run ios
Install the necessary dependencies by running the following command:

```sh
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
```

</Block>
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/datastore/js/setup-env-js.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Next, install the Amplify library dependencies in your project by running:

```bash
npm install aws-amplify
npm install aws-amplify@^5
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Start with the [React Native CLI](https://reactnative.dev/docs/getting-started):
npx react-native@0.68.2 init AmplifyDataStoreRN --version 0.68.2
cd AmplifyDataStoreRN
npx amplify-app@latest
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
```

You will also need to install the pod dependencies for iOS:
Expand All @@ -37,7 +37,7 @@ To enable SQLite with DataStore for enhanced local database performance, follow
npx react-native@0.68.2 init AmplifyDataStoreRN --version 0.68.2
cd AmplifyDataStoreRN
npx amplify-app@latest
npm install aws-amplify amazon-cognito-identity-js @aws-amplify/datastore-storage-adapter react-native-sqlite-storage @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
npm install aws-amplify@^5 amazon-cognito-identity-js @aws-amplify/datastore-storage-adapter react-native-sqlite-storage @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
npx pod-install
```

Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/geo/js/geofences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To add a geofence management component to your map, you can use the [amplify-geo
Install the necessary dependencies with the following command:

```bash
npm install aws-amplify @aws-amplify/ui-react @aws-amplify/ui-react-geo maplibre-gl-js-amplify maplibre-gl
npm install aws-amplify@^5 @aws-amplify/ui-react@^5 @aws-amplify/ui-react-geo@^1 maplibre-gl-js-amplify@^2 maplibre-gl
```

> **Note:** Make sure that `maplibre-gl-js-amplify` version `2.0.0` or above and `@aws-amplify/geo` version `1.3.0` or above are installed.
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/geo/js/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ For more information, you can visit the full [Amplify CLI Geo Maps docs](/[platf
Install the necessary dependencies by running the following command:

```sh
npm install aws-amplify
npm install aws-amplify@^5
```

> **Note:** Make sure that version `4.3.0` or above is installed.
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/graphqlapi/js/js-configure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add Amplify to your app with `yarn` or `npm`:

```bash
npm install aws-amplify
npm install aws-amplify@^5
```

In your app's entry point i.e. App.ts or App.js, import and load the configuration file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add Amplify to your app with `yarn` or `npm`:

```bash
npm install aws-amplify @react-native-async-storage/async-storage @react-native-community/netinfo
npm install aws-amplify@^5 @react-native-async-storage/async-storage @react-native-community/netinfo
```

In your app's entry point i.e. **App.js** (Expo) or **index.js** (React Native CLI), import and load the configuration file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Learn more about Amplify In-App Messaging UI and how to fully unlock its capabil
</Callout>

```bash
npm install aws-amplify @aws-amplify/ui-react @aws-amplify/ui-react-notifications
npm install aws-amplify@^5 @aws-amplify/ui-react@^5 @aws-amplify/ui-react-notifications@^1
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
In your project directory, you should first install the necessary dependencies for using Amplify Push Notifications.

```bash
npm install aws-amplify @aws-amplify/rtn-push-notification amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill
npm install aws-amplify@^5 @aws-amplify/rtn-push-notification amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill
```

You will also need to add the crypto.getRandomValues and URL polyfills to your application's entry point file (in most React Native apps this will be the top level `index.js`).
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/react-native-polyfills.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Install Amplify and its dependencies

```bash
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill
```

You need to add the crypto.getRandomValues and URL polyfills to your application's entry point file (in most React Native apps this will be the top level index.js).
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/lib-v1/storage/js/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ When your backend is successfully updated, your new configuration file `aws-expo
Add Amplify to your app with `yarn` or `npm`:

```bash
npm install aws-amplify
npm install aws-amplify@^5
```

import js0 from '/src/fragments/lib/common/js/import_configuration.mdx';
Expand Down
4 changes: 2 additions & 2 deletions src/fragments/lib-v1/utilities/cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ It is a key/value structure where expiration values can be configured **globally

## Installation

Install `aws-amplify`.
Install `aws-amplify@^5.0`.

```bash
npm install aws-amplify
npm install aws-amplify@^5
```

## Working with the API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Install the necessary dependencies by running the following command:

```sh
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fragment used in v5 or v6? The path doesn't seem specific to v5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is v5 because we have a reference to amazon-cognito-identity-js

```

</Block>
Expand All @@ -13,7 +13,7 @@ npm install aws-amplify amazon-cognito-identity-js @react-native-community/netin
Install the necessary dependencies by running the following command:

```sh
npm install aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @azure/core-asynciterator-polyfill
```

You will also need to install the pod dependencies for iOS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ Amplify has pre-built UI components for React, Vue, Angular, React Native, Swift
<BlockSwitcher>
<Block name="React">

First, install the `@aws-amplify/ui-react` library as well as `aws-amplify` if you have not already:
First, install the `@aws-amplify/ui-react@^5` library as well as `aws-amplify` if you have not already:

```sh
npm install aws-amplify @aws-amplify/ui-react
npm install aws-amplify@^5 @aws-amplify/ui-react@^5
```

Next, open **src/App.js** and add the `withAuthenticator` component.
Expand Down Expand Up @@ -458,10 +458,10 @@ export default withAuthenticator(App);
</Block>
<Block name="Vue 3">

First, install the `@aws-amplify/ui-vue` library as well as `aws-amplify` if you have not already:
First, install the `@aws-amplify/ui-vue@^3` library as well as `aws-amplify` if you have not already:
israx marked this conversation as resolved.
Show resolved Hide resolved

```bash
npm install aws-amplify @aws-amplify/ui-vue
npm install aws-amplify@^5 @aws-amplify/ui-vue@^3
```

Next, open **src/App.js** and add the `Authenticator` component.
Expand Down Expand Up @@ -491,56 +491,13 @@ The `Authenticator` component offers a simple way to add authentication flows in
</template>
```

</Block>
<Block name="Vue 2">

First, install the `@aws-amplify/ui-components` library as well as `aws-amplify` if you have not already:

```bash
npm install aws-amplify @aws-amplify/ui-components
```

Now open **src/main.js** and add the following below your last import:

```js
import '@aws-amplify/ui-components';
import {
applyPolyfills,
defineCustomElements
} from '@aws-amplify/ui-components/loader';
import Vue from 'vue';

Vue.config.ignoredElements = [/amplify-\w*/];

applyPolyfills().then(() => {
defineCustomElements(window);
});
```

Next, open **src/App.js** and add the `amplify-authenticator` component.

**amplify-authenticator**

The `amplify-authenticator` component offers a simple way to add authentication flows into your app. This component encapsulates an authentication workflow in the framework of your choice and is backed by the cloud resources set up in your Auth cloud resources. You will also notice the `amplify-sign-out` component. This is an optional component if you’d like to render a sign-out button.

```html
<template>
<amplify-authenticator>
<div>
My App
<amplify-sign-out></amplify-sign-out>
</div>
</amplify-authenticator>
</template>
```

</Block>
<Block name="Angular">

First, install the `@aws-amplify/ui-angular` library as well as `aws-amplify` if you have not already:
First, install the `@aws-amplify/ui-angular@^4` library as well as `aws-amplify` if you have not already:
israx marked this conversation as resolved.
Show resolved Hide resolved

```bash
npm install aws-amplify @aws-amplify/ui-angular
npm install aws-amplify@^5 @aws-amplify/ui-angular@^4
```

Now open **app.module.ts** and add the Amplify imports and configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Before you begin, you will need:
The Amplify Library is the recommended client library used to connect to your GraphQL APIs. To install the the Amplify client library, navigate to your frontend's root folder and run the following command in your Terminal:

```bash
npm install aws-amplify
npm install aws-amplify@^5
```

## Configure the Amplify Library
Expand Down
Loading