Skip to content

fix(deps): request consumers to install react-native polyfills #2191

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

Merged
merged 10 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ If you use tree shaking to reduce bundle size, using non-modular interface will
<!-- Uncomment when numbers are available for gamma clients
In our workshop code, a lambda with DynamoDBClient and a command takes ~18kB while DynamoDB takes ~26 kB ([details](https://github.com/aws-samples/aws-sdk-js-v3-workshop/blob/dc3ad778b04dfe3f8f277dca67162da79c937eca/Exercise1/backend/README.md#reduce-bundle-size-by-just-importing-dynamodb)) -->

If you are consuming modular AWS SDK for JavaScript on react-native environments, you will need
to add and import following polyfills in your react-native application:

- [react-native-get-random-values](https://www.npmjs.com/package/react-native-get-random-values)
- [react-native-url-polyfill](https://www.npmjs.com/package/react-native-url-polyfill) <!-- Future support in #2138 --->

```js
import "react-native-get-random-values";
import "react-native-url-polyfill/auto";
import { DynamoDB } from "@aws-sdk/client-dynamodb";
```

## New features

### Modularized packages
Expand Down
1 change: 0 additions & 1 deletion packages/middleware-retry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@aws-sdk/protocol-http": "3.10.0",
"@aws-sdk/service-error-classification": "3.10.0",
"@aws-sdk/types": "3.10.0",
"react-native-get-random-values": "^1.4.0",
"tslib": "^1.8.0",
"uuid": "^3.0.0"
},
Expand Down
7 changes: 0 additions & 7 deletions packages/middleware-retry/src/index.native.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@aws-sdk/signature-v4": "3.10.0",
"@aws-sdk/types": "3.10.0",
"@aws-sdk/util-format-url": "3.10.0",
"react-native-get-random-values": "^1.4.0",
"tslib": "^1.8.0",
"uuid": "^3.0.0"
},
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions tests/react-native/End2End/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @format
*/

import "react-native-get-random-values";
import React, { Fragment, useState } from "react";
import { SafeAreaView, StyleSheet, ScrollView, StatusBar, Button, Text } from "react-native";
import { S3 } from "@aws-sdk/client-s3";
Expand Down
3 changes: 2 additions & 1 deletion tests/react-native/End2End/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"detox": "^17.0.2",
"jest-junit": "^11.0.1",
"react": "16.8.6",
"react-native": "0.60.3"
"react-native": "0.60.3",
"react-native-get-random-values": "^1.6.0"
},
"devDependencies": {
"@babel/core": "^7.5.0",
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4918,11 +4918,6 @@ extsprintf@^1.2.0:
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=

fast-base64-decode@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418"
integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==

fast-deep-equal@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
Expand Down Expand Up @@ -9491,13 +9486,6 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339"
integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==

react-native-get-random-values@^1.4.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.6.0.tgz#9035636b2dc2a6d574f2803205381fe1a7b5c864"
integrity sha512-sPTRTJk4bpuZeTBf6d7DldQGAOCi0GZh5NxzNI3eHXzxwHbNkV13Q22TehiSb3bsaVqwLC4UAa6QvYIucyyc+A==
dependencies:
fast-base64-decode "^1.0.0"

read-cmd-shim@^1.0.1:
version "1.0.5"
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz#87e43eba50098ba5a32d0ceb583ab8e43b961c16"
Expand Down