Skip to content

Commit 2d3a7f0

Browse files
trivikrNicolas Perrautfelipecesr
authored
fix(deps): request consumers to install react-native polyfills (#2191)
Co-authored-by: Nicolas Perraut <[email protected]> Co-authored-by: Felipe César <[email protected]>
1 parent fd40114 commit 2d3a7f0

File tree

8 files changed

+15
-31
lines changed

8 files changed

+15
-31
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ If you use tree shaking to reduce bundle size, using non-modular interface will
7171
<!-- Uncomment when numbers are available for gamma clients
7272
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)) -->
7373

74+
If you are consuming modular AWS SDK for JavaScript on react-native environments, you will need
75+
to add and import following polyfills in your react-native application:
76+
77+
- [react-native-get-random-values](https://www.npmjs.com/package/react-native-get-random-values)
78+
- [react-native-url-polyfill](https://www.npmjs.com/package/react-native-url-polyfill) <!-- Future support in #2138 --->
79+
80+
```js
81+
import "react-native-get-random-values";
82+
import "react-native-url-polyfill/auto";
83+
import { DynamoDB } from "@aws-sdk/client-dynamodb";
84+
```
85+
7486
## New features
7587

7688
### Modularized packages

packages/middleware-retry/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"@aws-sdk/protocol-http": "3.10.0",
2121
"@aws-sdk/service-error-classification": "3.10.0",
2222
"@aws-sdk/types": "3.10.0",
23-
"react-native-get-random-values": "^1.4.0",
2423
"tslib": "^1.8.0",
2524
"uuid": "^3.0.0"
2625
},

packages/middleware-retry/src/index.native.ts

-7
This file was deleted.

packages/middleware-sdk-transcribe-streaming/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"@aws-sdk/signature-v4": "3.10.0",
2525
"@aws-sdk/types": "3.10.0",
2626
"@aws-sdk/util-format-url": "3.10.0",
27-
"react-native-get-random-values": "^1.4.0",
2827
"tslib": "^1.8.0",
2928
"uuid": "^3.0.0"
3029
},

packages/middleware-sdk-transcribe-streaming/src/index.native.ts

-9
This file was deleted.

tests/react-native/End2End/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @format
99
*/
1010

11+
import "react-native-get-random-values";
1112
import React, { Fragment, useState } from "react";
1213
import { SafeAreaView, StyleSheet, ScrollView, StatusBar, Button, Text } from "react-native";
1314
import { S3 } from "@aws-sdk/client-s3";

tests/react-native/End2End/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"detox": "^17.0.2",
1414
"jest-junit": "^11.0.1",
1515
"react": "16.8.6",
16-
"react-native": "0.60.3"
16+
"react-native": "0.60.3",
17+
"react-native-get-random-values": "^1.6.0"
1718
},
1819
"devDependencies": {
1920
"@babel/core": "^7.5.0",

yarn.lock

-12
Original file line numberDiff line numberDiff line change
@@ -4918,11 +4918,6 @@ extsprintf@^1.2.0:
49184918
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
49194919
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
49204920

4921-
fast-base64-decode@^1.0.0:
4922-
version "1.0.0"
4923-
resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418"
4924-
integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==
4925-
49264921
fast-deep-equal@^3.1.1:
49274922
version "3.1.3"
49284923
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -9491,13 +9486,6 @@ react-is@^17.0.1:
94919486
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339"
94929487
integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==
94939488

9494-
react-native-get-random-values@^1.4.0:
9495-
version "1.6.0"
9496-
resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.6.0.tgz#9035636b2dc2a6d574f2803205381fe1a7b5c864"
9497-
integrity sha512-sPTRTJk4bpuZeTBf6d7DldQGAOCi0GZh5NxzNI3eHXzxwHbNkV13Q22TehiSb3bsaVqwLC4UAa6QvYIucyyc+A==
9498-
dependencies:
9499-
fast-base64-decode "^1.0.0"
9500-
95019489
read-cmd-shim@^1.0.1:
95029490
version "1.0.5"
95039491
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz#87e43eba50098ba5a32d0ceb583ab8e43b961c16"

0 commit comments

Comments
 (0)