github: remove some deps on github/graphql.js (#962)
Summary: A number of modules depended on the legacy `github/graphql.js` module solely to get at the `Reactions` enum object. As of #961, that object is exposed from the much lighter-weight `graphqlTypes.js`. This patch switches over the relevant imports, reducing our dependencies on this legacy module and its large bundle size. Test Plan: It suffices to run `yarn flow` and verify that the two values being imported are identical. wchargin-branch: github-use-generated-enums
This commit is contained in:
parent
2377f1980f
commit
b77db72c1d
|
@ -6,8 +6,7 @@ import * as N from "./nodes";
|
|||
import * as R from "./relationalView";
|
||||
import {createEdge} from "./edges";
|
||||
import {findMentionsAuthorReferences} from "./heuristics/mentionsAuthorReference";
|
||||
// TODO(@decentralion): Opportunity to reduce bundle size
|
||||
import {Reactions} from "./graphql";
|
||||
import {ReactionContent$Values as Reactions} from "./graphqlTypes";
|
||||
|
||||
export function createGraph(view: R.RelationalView): Graph {
|
||||
const creator = new GraphCreator();
|
||||
|
|
|
@ -9,8 +9,10 @@ import {
|
|||
import * as GithubNode from "./nodes";
|
||||
import * as GitNode from "../git/nodes";
|
||||
import type {MentionsAuthorReference} from "./heuristics/mentionsAuthorReference";
|
||||
// TODO(@decentralion): Opportunity to reduce bundle size (tree shaking?)
|
||||
import {Reactions, type ReactionContent} from "./graphql";
|
||||
import {
|
||||
type ReactionContent,
|
||||
ReactionContent$Values as Reactions,
|
||||
} from "./graphqlTypes";
|
||||
|
||||
export opaque type RawAddress: EdgeAddressT = EdgeAddressT;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import {createEdge, fromRaw, toRaw} from "./edges";
|
|||
import * as GE from "./edges";
|
||||
import * as GN from "./nodes";
|
||||
import {COMMIT_TYPE} from "../git/nodes";
|
||||
import {Reactions} from "./graphql";
|
||||
import {ReactionContent$Values as Reactions} from "./graphqlTypes";
|
||||
|
||||
describe("plugins/github/edges", () => {
|
||||
const nodeExamples = {
|
||||
|
|
|
@ -7,8 +7,7 @@ import * as GN from "./nodes";
|
|||
import * as GE from "./edges";
|
||||
|
||||
import * as GitNode from "../git/nodes";
|
||||
// TODO(@decentralion): Opportunity to reduce bundle size
|
||||
import {Reactions} from "./graphql";
|
||||
import {ReactionContent$Values as Reactions} from "./graphqlTypes";
|
||||
|
||||
import {
|
||||
Graph,
|
||||
|
|
Loading…
Reference in New Issue