Skip to content

Commit

Permalink
chore: cleanup unused uploadMiddleware (#9587)
Browse files Browse the repository at this point in the history
* chore: cleanup unused uploadMiddleware

* code review fix
  • Loading branch information
nickskalkin authored Nov 22, 2023
1 parent a396092 commit 80da20e
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 252 deletions.
10 changes: 0 additions & 10 deletions HACKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,6 @@ There are two hacks here:
- We hack the output of the compiler to provide clickable links for error messages. Relay assumes that you put your `__generated__` folder in the root of your project, but we put it in `src`.
- We make sure that files which do not change are not overwritten. This prevents excessive reloading by metro.

## react-relay-network-modern (upload middleware patch)

#### When can we remove this:

We can remove this hack when we can pass Blob/File with specified `name` field to `fetch()` and we won't get an error on Android

#### Explanation/Context:

If we try to pass Blob/File with specified `name` field (if we forgot to specify this field, Metaphysics will assume that no file was passed) to `fetch()`, we will get an error on Android. For this reason, support for these data formats is extracted from `upload` middleware.

## react-native-credit-card-input

#### When can we remove this:
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"deprecated-react-native-prop-types": "4.1.0",
"easy-peasy": "6.0.0",
"events": "3.3.0",
"extract-files": "9.0.0",
"formik": "2.2.9",
"google-libphonenumber": "3.2.33",
"grapheme-splitter": "1.0.4",
Expand Down Expand Up @@ -236,7 +235,6 @@
"@types/autosuggest-highlight": "3.1.1",
"@types/chalk": "2.2.0",
"@types/dedent": "0.7.0",
"@types/extract-files": "8.1.1",
"@types/google-libphonenumber": "7.4.26",
"@types/jest": "29.2.6",
"@types/jscodeshift": "0.11.6",
Expand Down
20 changes: 0 additions & 20 deletions patches/@types+extract-files+8.1.1.patch

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/system/relay/defaultEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Environment as IEnvironment } from "react-relay"
import {
errorMiddleware as relayErrorMiddleware,
RelayNetworkLayer,
uploadMiddleware,
} from "react-relay-network-modern/node8"
import { Environment, RecordSource, Store } from "relay-runtime"
import { MockEnvironment } from "relay-test-utils"
Expand All @@ -17,7 +18,6 @@ import {
import { rateLimitMiddleware } from "./middlewares/rateLimitMiddleware"
import { simpleLoggerMiddleware } from "./middlewares/simpleLoggerMiddleware"
import { timingMiddleware } from "./middlewares/timingMiddleware"
import { uploadMiddleware } from "./middlewares/uploadMiddleware"

const network = new RelayNetworkLayer(
[
Expand Down
152 changes: 0 additions & 152 deletions src/app/system/relay/middlewares/uploadMiddleware.tests.ts

This file was deleted.

61 changes: 0 additions & 61 deletions src/app/system/relay/middlewares/uploadMiddleware.ts

This file was deleted.

7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4979,11 +4979,6 @@
resolved "https://registry.yarnpkg.com/@types/dedent/-/dedent-0.7.0.tgz#155f339ca404e6dd90b9ce46a3f78fd69ca9b050"
integrity sha512-EGlKlgMhnLt/cM4DbUSafFdrkeJoC9Mvnj0PUCU7tFmTjMjNRT957kXCx0wYm3JuEq4o4ZsS5vG+NlkM2DMd2A==

"@types/[email protected]":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@types/extract-files/-/extract-files-8.1.1.tgz#11b67e795ad2c8b483431e8d4f190db2fd22944b"
integrity sha512-dMJJqBqyhsfJKuK7p7HyyNmki7qj1AlwhUKWx6KrU7i1K2T2SPsUsSUTWFmr/sEM1q8rfR8j5IyUmYrDbrhfjQ==

"@types/geojson@*", "@types/geojson@^7946.0.7":
version "7946.0.7"
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.7.tgz#c8fa532b60a0042219cdf173ca21a975ef0666ad"
Expand Down Expand Up @@ -8840,7 +8835,7 @@ extglob@^2.0.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

extract-files@9.0.0, extract-files@^9.0.0:
extract-files@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-9.0.0.tgz#8a7744f2437f81f5ed3250ed9f1550de902fe54a"
integrity sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ==
Expand Down

0 comments on commit 80da20e

Please sign in to comment.