-
Notifications
You must be signed in to change notification settings - Fork 73
[Toolchain] Update Relay to support new TypeScript compiler option #522
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
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4062726
[Deps] Add interim Relay v1.5.0 forks and patch
damassi 464423c
[Migrate] Replace `graphql.experimental` calls
damassi c2b1245
[Migrate] Move __generated__ to root
damassi e3fe8d6
[Webpack] Replace awesome-ts-loader with ts-loader
damassi 8bfd4b2
[Deps] Update Relay packages to latest
damassi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| src/__generated__/*.graphql.ts linguist-generated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,17 @@ | ||
| node_modules | ||
| .DS_Store | ||
| .awcache | ||
| .fusebox | ||
| .cache-loader/ | ||
| .env | ||
| out* | ||
| dist | ||
| .DS_Store | ||
| .storybook/.DS_Store | ||
| assets/reaction-force.js | ||
| .storybook/manager.js | ||
| reaction-force.js | ||
| reaction-force.js.map | ||
| dist | ||
| .vscode/cSpell.json | ||
| yarn-error.log | ||
| assets/reaction-force.js | ||
| dist | ||
| dist | ||
| node_modules | ||
| npm-debug.log | ||
| __generated__ | ||
| out* | ||
| package-lock.json | ||
| reaction-force.js | ||
| reaction-force.js.map | ||
| yarn-error.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,19 @@ | |
| "styled-components": "^3.1.5" | ||
| }, | ||
| "scripts": { | ||
| "compile": "env GRAPHQL_NO_NAME_WARNING=true yarn relay && gulp", | ||
| "compile": "yarn relay && gulp", | ||
| "deploy-storybook": "yarn relay && NODE_ENV=production storybook-to-ghpages", | ||
| "lint": "tslint -c tslint.json --project tsconfig.json", | ||
| "prepare": "patch-package", | ||
| "precommit": "lint-staged", | ||
| "prepublishOnly": "rm -rf dist && npm run compile", | ||
| "prepush": "yarn run type-check", | ||
| "prettier": "prettier", | ||
| "prettier-project": "yarn run prettier-write 'src/**/*.{ts,tsx}'", | ||
| "prettier-write": "yarn run prettier --write", | ||
| "relay": "env GRAPHQL_NO_NAME_WARNING=true relay-compiler --src ./src --schema data/schema.graphql --extensions ts tsx", | ||
| "relay": "relay-compiler --src ./src --schema data/schema.graphql --language typescript --artifactDirectory ./src/__generated__", | ||
| "start": "yarn storybook", | ||
| "storybook": "node verify-node-version.js && concurrently --kill-others 'yarn relay --watch' 'env GRAPHQL_NO_NAME_WARNING=true start-storybook -p 9001'", | ||
| "storybook": "node verify-node-version.js && concurrently --kill-others 'yarn relay --watch' 'start-storybook -p 9001'", | ||
| "sync-colors": "cd externals/elan && git fetch && git checkout origin/master && cp components/lib/variables/colors.json ../../data", | ||
| "sync-schema": "cd externals/metaphysics && git fetch && git checkout origin/master && yarn install && npm run dump-schema -- ../../data", | ||
| "sync-schema:localhost": "cd ../metaphysics && yarn dump-schema -- ../reaction/data", | ||
|
|
@@ -43,6 +44,13 @@ | |
| "type-check": "tsc --noEmit --pretty", | ||
| "watch": "gulp watch" | ||
| }, | ||
| "resolutions": { | ||
| "graphql": "^0.12.3", | ||
| "babel-plugin-relay": "https://github.com/alloy/relay/releases/download/v1.5.0-plugin.2/babel-plugin-relay-1.5.0-plugin.2.tgz", | ||
| "relay-compiler": "https://github.com/alloy/relay/releases/download/v1.5.0-plugin.2/relay-compiler-1.5.0-plugin.2.tgz", | ||
| "relay-runtime": "https://github.com/alloy/relay/releases/download/v1.5.0-plugin.2/relay-runtime-1.5.0-plugin.2.tgz", | ||
| "react-relay": "https://github.com/alloy/relay/releases/download/v1.5.0-plugin.2/react-relay-1.5.0-plugin.2.tgz" | ||
| }, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figured it would be clearest to explicitly resolve all of our patches here similar to the most recent example, and then update / remove when ready. |
||
| "devDependencies": { | ||
| "@playlyfe/gql": "^2.3.2", | ||
| "@storybook/addon-options": "^3.2.1", | ||
|
|
@@ -55,24 +63,27 @@ | |
| "@types/prop-types": "^15.5.1", | ||
| "@types/react": "^16.0.31", | ||
| "@types/react-dom": "^16.0.3", | ||
| "@types/react-relay": "^1.3.1", | ||
| "@types/react-relay": "^1.3.3", | ||
| "@types/react-slick": "^0.14.1", | ||
| "@types/react-test-renderer": "^15.4.4", | ||
| "@types/relay-runtime": "^1.3.0", | ||
| "@types/relay-runtime": "^1.3.2", | ||
| "@types/storybook__react": "^3.0.5", | ||
| "awesome-typescript-loader": "^3.1.2", | ||
| "babel-core": "^6.24.0", | ||
| "babel-plugin-relay": "https://github.com/alloy/relay/releases/download/v1.3.0-artsy/babel-plugin-relay-1.3.0-artsy.1.tgz", | ||
| "babel-loader": "^7.1.2", | ||
| "babel-plugin-relay": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.1/babel-plugin-relay-1.5.0-artsy.1.tgz", | ||
| "babel-plugin-styled-components": "^1.4.0", | ||
| "babel-preset-es2015": "^6.22.0", | ||
| "babel-preset-react": "^6.22.0", | ||
| "babel-preset-stage-3": "^6.22.0", | ||
| "babel-template": "^6.2.0", | ||
| "babel-types": "^6.2.0", | ||
| "cache-loader": "^1.2.0", | ||
| "concurrently": "^3.5.0", | ||
| "dotenv": "^4.0.0", | ||
| "enzyme": "^3.1.0", | ||
| "enzyme-adapter-react-16": "^1.0.1", | ||
| "fork-ts-checker-notifier-webpack-plugin": "^0.2.0", | ||
| "fork-ts-checker-webpack-plugin": "^0.3.0", | ||
| "graphql-config-parser": "^1.2.1", | ||
| "gulp": "^3.9.1", | ||
| "gulp-babel": "^6.1.2", | ||
|
|
@@ -86,14 +97,18 @@ | |
| "jest": "^22.1.4", | ||
| "jest-styled-components": "^4.11.0-1", | ||
| "lint-staged": "^4.0.0", | ||
| "patch-package": "^5.0.0", | ||
| "postinstall-prepare": "^1.0.1", | ||
| "prettier": "^1.7.4", | ||
| "raf": "^3.4.0", | ||
| "react": "^16.2.0", | ||
| "react-addons-test-utils": "^15.5.1", | ||
| "react-dom": "^16.2.0", | ||
| "react-test-renderer": "^16.0.0", | ||
| "relay-compiler": "https://github.com/alloy/relay/releases/download/v1.3.0-artsy/relay-compiler-1.3.0-artsy.1.tgz", | ||
| "relay-compiler": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.1/relay-compiler-1.5.0-artsy.1.tgz", | ||
| "relay-compiler-language-typescript": "^0.9.0", | ||
| "styled-components": "^3.1.5", | ||
| "ts-loader": "^3.5.0", | ||
| "tslint": "^4.5.0", | ||
| "tslint-config-prettier": "^1.1.0", | ||
| "tslint-react": "^2.4.0", | ||
|
|
@@ -113,21 +128,18 @@ | |
| "react-css-transition-replace": "^3.0.2", | ||
| "react-lines-ellipsis": "^0.8.0", | ||
| "react-markdown": "^2.5.0", | ||
| "react-relay": "https://github.com/alloy/relay/releases/download/v1.3.0-artsy/react-relay-1.3.0-artsy.1.tgz", | ||
| "react-relay": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.1/react-relay-1.5.0-artsy.1.tgz", | ||
| "react-responsive-decorator": "^0.0.1", | ||
| "react-sizeme": "^2.3.2", | ||
| "react-slick": "^0.14.11", | ||
| "react-styled-flexboxgrid": "^2.0.0", | ||
| "react-tracking": "^4.2.1", | ||
| "react-url-query": "^1.1.4", | ||
| "react-waypoint": "^7.3.3", | ||
| "relay-runtime": "https://github.com/alloy/relay/releases/download/v1.3.0-artsy/relay-runtime-artsy.1.tgz", | ||
| "relay-runtime": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.1/relay-runtime-1.5.0-artsy.1.tgz", | ||
| "sharify": "^0.1.6", | ||
| "superagent": "^3.6.3" | ||
| }, | ||
| "graphql": { | ||
| "file": "data/schema.json" | ||
| }, | ||
| "prettier": { | ||
| "semi": false, | ||
| "singleQuote": false, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| patch-package | ||
| --- a/node_modules/graphql/utilities/assertValidName.js | ||
| +++ b/node_modules/graphql/utilities/assertValidName.js | ||
| @@ -41,13 +41,13 @@ function assertValidName(name) { | ||
| */ | ||
| function isValidNameError(name, node) { | ||
| !(typeof name === 'string') ? (0, _invariant2.default)(0, 'Expected string') : void 0; | ||
| - if (name.length > 1 && name[0] === '_' && name[1] === '_' && | ||
| - // Note: this special case is not part of the spec and exists only to | ||
| - // support legacy server configurations. Do not rely on this special case | ||
| - // as it may be removed at any time. | ||
| - name !== '__configs__') { | ||
| - return new _GraphQLError.GraphQLError('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection.', node); | ||
| - } | ||
| + // if (name.length > 1 && name[0] === '_' && name[1] === '_' && | ||
| + // // Note: this special case is not part of the spec and exists only to | ||
| + // // support legacy server configurations. Do not rely on this special case | ||
| + // // as it may be removed at any time. | ||
| + // name !== '__configs__') { | ||
| + // return new _GraphQLError.GraphQLError('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection.', node); | ||
| + // } | ||
| if (!NAME_RX.test(name)) { | ||
| return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.', node); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just alpha and cleanup