Skip to content

Commit

Permalink
Merge pull request #5934 from artsy/update-relay
Browse files Browse the repository at this point in the history
[Lib] Upgrade Relay to 9
  • Loading branch information
damassi authored Aug 14, 2020
2 parents d008676 + d0791ca commit bf3134c
Show file tree
Hide file tree
Showing 548 changed files with 35,443 additions and 34,915 deletions.
8 changes: 3 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"editor.rulers": [
80
],
"editor.rulers": [80],
"editor.tabSize": 2,
"javascript.validate.enable": true,
"search.exclude": {
Expand All @@ -16,7 +14,7 @@
"editor.formatOnSave": false
},
"typescript.tsdk": "./node_modules/typescript/lib",
"debug.node.autoAttach": "on",
"debug.node.autoAttach": "off",
"cSpell.ignoreWords": [],
"cSpell.diagnosticLevel": "Hint",
"cSpell.ignorePaths": [
Expand All @@ -34,4 +32,4 @@
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
}
}
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@artsy/gemup": "0.1.0",
"@artsy/palette": "12.0.2",
"@artsy/passport": "1.3.2",
"@artsy/reaction": "27.1.0",
"@artsy/reaction": "28.0.0",
"@artsy/stitch": "6.1.6",
"@artsy/xapp": "1.0.6",
"@loadable/component": "5.12.0",
Expand Down Expand Up @@ -104,14 +104,15 @@
"express": "4.16.4",
"express-ipfilter": "0.2.1",
"express-request-id": "1.4.0",
"farce": "^0.4.5",
"fastclick": "1.0.6",
"flickity": "2.1.2",
"flickity-imagesloaded": "2.0.0",
"focus-visible": "5.1.0",
"forever": "0.15.3",
"found": "0.4.9",
"found-relay": "0.5.0",
"found-scroll": "0.1.6",
"found": "^0.5.5",
"found-relay": "^0.8.2",
"found-scroll": "^0.3.0",
"geoformatter": "artsy/geoformatter",
"geolib": "2.0.22",
"glob": "7.1.3",
Expand Down Expand Up @@ -167,9 +168,9 @@
"react-dom": "16.8.6",
"react-linkify": "1.0.0-alpha",
"react-redux": "5.1.1",
"react-relay": "7.1.0",
"react-relay-network-modern": "2.5.1",
"react-relay-network-modern-ssr": "1.2.2",
"react-relay": "9.1.0",
"react-relay-network-modern": "^4.7.3",
"react-relay-network-modern-ssr": "^1.4.0",
"react-remove-scroll": "2.3.0",
"react-router": "4.2.0",
"react-router-redux": "4.0.8",
Expand All @@ -183,7 +184,7 @@
"redux-thunk": "2.2.0",
"referer-parser": "0.0.3",
"relay-mock-network-layer": "2.0.0",
"relay-runtime": "7.1.0",
"relay-runtime": "9.1.0",
"require-control": "2.1.1",
"sailthru-client": "3.0.2",
"scroll-frame": "1.0.0",
Expand Down Expand Up @@ -256,7 +257,7 @@
"@types/react-tracking": "7.0.0",
"@types/react-transition-group": "2.0.11",
"@types/redis": "2.8.22",
"@types/relay-runtime": "8.0.10",
"@types/relay-runtime": "9.1.0",
"@types/storybook__react": "5.2.1",
"@types/styled-components": "4.0.3",
"@types/styled-system": "5.1.9",
Expand All @@ -271,7 +272,7 @@
"babel-plugin-inline-react-svg": "0.2.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-module-resolver": "3.1.0",
"babel-plugin-relay": "7.1.0",
"babel-plugin-relay": "9.0.0",
"babel-plugin-styled-components": "1.11.1",
"benv": "3.3.0",
"cache-loader": "1.2.2",
Expand Down Expand Up @@ -321,9 +322,9 @@
"react-stripe-elements": "2.0.1",
"react-test-renderer": "16.8.6",
"react-use-dimensions": "1.2.1",
"relay-compiler": "7.1.0",
"relay-compiler-language-typescript": "10.1.0",
"relay-config": "7.1.0",
"relay-compiler": "9.1.0",
"relay-compiler-language-typescript": "^12.0.3",
"relay-config": "9.1.0",
"rewire": "2.2.0",
"s3": "4.4.0",
"should": "11.2.1",
Expand Down
14 changes: 7 additions & 7 deletions patches/found+0.4.9.patch → patches/found+0.5.5.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/node_modules/found/lib/index.d.ts b/node_modules/found/lib/index.d.ts
index 02cc90c..b3706dd 100644
--- a/node_modules/found/lib/index.d.ts
+++ b/node_modules/found/lib/index.d.ts
diff --git a/node_modules/found/index.d.ts b/node_modules/found/index.d.ts
index 6868cf5..4bca495 100644
--- a/node_modules/found/index.d.ts
+++ b/node_modules/found/index.d.ts
@@ -111,6 +111,10 @@ declare module 'found' {
* matchContext from the router
*/
Expand All @@ -13,7 +13,7 @@ index 02cc90c..b3706dd 100644
}

interface FoundState {
@@ -267,6 +271,12 @@ declare module 'found' {
@@ -272,6 +276,12 @@ declare module 'found' {
* loaded
*/
data?: any;
Expand All @@ -26,10 +26,10 @@ index 02cc90c..b3706dd 100644
}

/**
@@ -438,6 +448,8 @@ declare module 'found' {
@@ -444,6 +454,8 @@ declare module 'found' {

function useRouter(): RouterState;

+ const RouterContext: React.Context<any>;
+
function withRouter<Props extends RouterState>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/node_modules/relay-compiler/bin/relay-compiler b/node_modules/relay-compiler/bin/relay-compiler
index 78b40a3..8d05a9a 100755
index 02c8adc..e74249f 100755
--- a/node_modules/relay-compiler/bin/relay-compiler
+++ b/node_modules/relay-compiler/bin/relay-compiler
@@ -308,7 +308,7 @@ function highlightSourceAtLocation(source, location) {
@@ -291,7 +291,7 @@ function highlightSourceAtLocation(source, location) {
var columnOffset = location.line === 1 ? firstLineColumnOffset : 0;
var columnNum = location.column + columnOffset;
var lines = body.split(/\r\n|[\n\r]/g);
- return "".concat(source.name, " (").concat(lineNum, ":").concat(columnNum, ")\n") + printPrefixedLines([// Lines specified like this: ["prefix", "string"],
+ return "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n") + printPrefixedLines([// Lines specified like this: ["prefix", "string"],
+ return "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, ")\n") + printPrefixedLines([// Lines specified like this: ["prefix", "string"],
["".concat(lineNum - 1, ": "), lines[lineIndex - 1]], ["".concat(lineNum, ": "), lines[lineIndex]], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1, ": "), lines[lineIndex + 1]]]);
}

@@ -17391,10 +17391,10 @@ module.exports = function (tagFinder) {
@@ -17783,10 +17783,10 @@ module.exports = function (tagFinder, getFileFilter) {

var astDefinitions = [];
var sources = [];
Expand All @@ -25,7 +25,7 @@ index 78b40a3..8d05a9a 100755
sources.push(source.body);
astDefinitions.push.apply(astDefinitions, (0, _toConsumableArray2["default"])(ast.definitions));
});
@@ -17478,9 +17478,7 @@ function find(tagFinder, text, absPath) {
@@ -17871,9 +17871,7 @@ function find(tagFinder, text, absPath) {
tags.forEach(function (tag) {
return validateTemplate(tag, moduleName, absPath);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
patch-package
diff --git a/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js b/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js
index 13ac420..8502116 100644
--- a/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js
+++ b/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js
@@ -407,7 +407,7 @@ function () {
@@ -278,7 +278,7 @@ var RelayResponseNormalizer = /*#__PURE__*/function () {
//
// Otherwise, missing fields usually indicate a server or user error (
// the latter for manually constructed payloads).
Expand Down
4 changes: 3 additions & 1 deletion src/v2/Apps/Artist/ArtistApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export const ArtistApp: React.FC<ArtistAppProps> = props => {
const { artist, children } = props
const { trackEvent } = useTracking()
const route = findCurrentRoute(props.match)
let HorizontalPaddingArea = HorizontalPadding
let HorizontalPaddingArea:
| typeof HorizontalPadding
| typeof Box = HorizontalPadding
let maxWidth

if (route.displayFullPage) {
Expand Down
3 changes: 1 addition & 2 deletions src/v2/Apps/Artist/__tests__/routes.jest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { routes_ArtistTopLevelQueryRawResponse } from "v2/__generated__/routes_A
import { routes } from "v2/Apps/Artist/routes"
import { createMockNetworkLayer2 } from "v2/DevTools/createMockNetworkLayer"
import { Resolver } from "found-relay"
import { FarceRedirectResult } from "found/lib/server"
import getFarceResult from "found/lib/server/getFarceResult"
import { FarceRedirectResult, getFarceResult } from "found/server"
import React from "react"
import { Environment, RecordSource, Store } from "relay-runtime"
import { PermanentRedirectException } from "v2/Artsy/Router/PermanentRedirectException"
Expand Down
4 changes: 2 additions & 2 deletions src/v2/Apps/Auction/__tests__/routes.jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import deepMerge from "deepmerge"
import { createMockNetworkLayer2 } from "v2/DevTools/createMockNetworkLayer"
import { createRender } from "found"
import { Resolver } from "found-relay"
import { FarceElementResult, FarceRedirectResult } from "found/lib/server"
import getFarceResult from "found/lib/server/getFarceResult"
import { FarceElementResult, FarceRedirectResult } from "found/server"
import { getFarceResult } from "found/server"
import { Environment, RecordSource, Store } from "relay-runtime"
import { DeepPartial } from "v2/Utils/typeSupport"

Expand Down
2 changes: 1 addition & 1 deletion src/v2/Apps/Conversation/Components/TimeSince.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface TimeSinceProps extends Omit<BoxProps, "color"> {
size?: SansSize
time: string
exact?: boolean
style?: React.CSSProperties
style?: any // FIXME: React.CSSProperties
}
export const TimeSince: React.FC<TimeSinceProps> = ({
size = "2",
Expand Down
2 changes: 1 addition & 1 deletion src/v2/Apps/IdentityVerification/__tests__/routes.jest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
FarceElementResult,
FarceRedirectResult,
getFarceResult,
} from "found/lib/server"
} from "found/server"
import { Environment, RecordSource, Store } from "relay-runtime"

import { routes } from "v2/Apps/IdentityVerification/routes"
Expand Down
133 changes: 67 additions & 66 deletions src/v2/Apps/Order/Components/OfferHistoryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,83 @@ import {
StepSummaryItem,
StepSummaryItemProps,
} from "v2/Components/StepSummaryItem"
import React, { HTMLProps } from "react"
import React from "react"
import { createFragmentContainer, graphql } from "react-relay"
import { RevealButton } from "./RevealButton"

const OfferHistoryItem: React.SFC<{
order: OfferHistoryItem_order
} & StepSummaryItemProps> = ({
order: { totalListPrice, lastOffer, offers },
...others
}) => {
const previousOffers = offers.edges.filter(
({ node: { internalID } }) => internalID !== lastOffer.internalID
)
const OfferHistoryItem: React.SFC<
{
order: OfferHistoryItem_order
} & StepSummaryItemProps
> = ({ order: { totalListPrice, lastOffer, offers }, ...others }) => {
const previousOffers = offers.edges.filter(
({ node: { internalID } }) => internalID !== lastOffer.internalID
)

return (
<StepSummaryItem {...others}>
<Row>
return (
<StepSummaryItem {...others}>
<Row>
<Serif size={["2", "3"]} color="black100" weight="semibold">
{lastOffer.fromParticipant === "SELLER"
? "Seller's offer"
: "Your offer"}
</Serif>
<Serif size={["2", "3"]} color="black100">
{lastOffer.amount}
</Serif>
</Row>
<Row>
<div />
<Sans size="2" color="black60">
List price: {totalListPrice}
</Sans>
</Row>
{lastOffer.note && (
<>
<Spacer mb={2} />
<Serif size={["2", "3"]} color="black100" weight="semibold">
{lastOffer.fromParticipant === "SELLER"
? "Seller's offer"
: "Your offer"}
? "Seller's note"
: "Your note"}
</Serif>
<Serif size={["2", "3"]} color="black100">
{lastOffer.amount}
<Serif size="2" color="black60">
{lastOffer.note}
</Serif>
</Row>
<Row>
<div />
<Sans size="2" color="black60">
List price: {totalListPrice}
</Sans>
</Row>
{lastOffer.note && (
<>
<Spacer mb={2} />
<Serif size={["2", "3"]} color="black100" weight="semibold">
{lastOffer.fromParticipant === "SELLER"
? "Seller's note"
: "Your note"}
</Serif>
<Serif size="2" color="black60">
{lastOffer.note}
</Serif>
<Spacer mb={1} />
</>
)}
{previousOffers.length > 0 && (
<>
<Spacer mb={2} />
<RevealButton buttonLabel="Show offer history">
<Flex m={0} flexDirection="column">
<Serif size={["2", "3"]} color="black100" weight="semibold">
Offer history
<Spacer mb={1} />
</>
)}
{previousOffers.length > 0 && (
<>
<Spacer mb={2} />
<RevealButton buttonLabel="Show offer history">
<Flex m={0} flexDirection="column">
<Serif size={["2", "3"]} color="black100" weight="semibold">
Offer history
</Serif>
{previousOffers.map(({ node: offer }) => (
<Row key={offer.internalID}>
<Serif size={["2", "3"]} color="black60">
{offer.fromParticipant === "BUYER" ? "You" : "Seller"}
{` (${offer.createdAt})`}
</Serif>
<Serif size={["2", "3"]} color="black60">
{offer.amount}
</Serif>
</Row>
))}
</Flex>
</RevealButton>
</>
)}
</StepSummaryItem>
)
}
{previousOffers.map(({ node: offer }) => (
<Row key={offer.internalID}>
<Serif size={["2", "3"]} color="black60">
{offer.fromParticipant === "BUYER" ? "You" : "Seller"}
{` (${offer.createdAt})`}
</Serif>
<Serif size={["2", "3"]} color="black60">
{offer.amount}
</Serif>
</Row>
))}
</Flex>
</RevealButton>
</>
)}
</StepSummaryItem>
)
}
// TODO: look into why a separate style prop is necessary here
const Row: React.SFC<FlexProps & {
style?: HTMLProps<HTMLDivElement>["style"]
}> = ({ children, ...others }) => (
const Row: React.SFC<
FlexProps & {
style?: any // FIXME: HTMLProps<HTMLDivElement>["style"]
}
> = ({ children, ...others }) => (
<Flex justifyContent="space-between" alignItems="baseline" {...others}>
{children}
</Flex>
Expand Down
Loading

0 comments on commit bf3134c

Please sign in to comment.