Skip to content

Commit

Permalink
Merge transformer branch - rewrite of the language plugin. It now gen…
Browse files Browse the repository at this point in the history
…erates Flow types using the officially maintained Flow language plugin, then parses that and creates an intermediate, generalized structure of what types exist for the operation, and then finally reprints that as Reason types using the same structure as before. The reason for this change is and attempt to make the language plugin much more resilient to updates/development of the official language plugin. The former solution was mimicking what the official Flow language plugin is doing, but maintaining that with the rapid development that the Relay team is doing internally proved too difficult. This has a few trade offs, like needing a few changes to the official plugin (which is now done in our vendored fork of the compiler), but I still think it's a better solution in the long run.
  • Loading branch information
zth committed Oct 6, 2019
1 parent 66032cc commit d9d08fa
Show file tree
Hide file tree
Showing 86 changed files with 2,117 additions and 9,662 deletions.
20 changes: 12 additions & 8 deletions packages/reason-relay/language-plugin/babel.config.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
module.exports = {
presets: [
'@babel/flow',
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
node: 'current'
node: "current"
}
}
]
],
plugins: ['@babel/plugin-proposal-nullish-coalescing-operator', ['module-resolver', {
alias: {
'bs-platform/lib/es6': 'bs-platform/lib/js'
}
}]]
plugins: [
[
"module-resolver",
{
alias: {
"bs-platform/lib/es6": "bs-platform/lib/js"
}
}
]
]
};
8 changes: 6 additions & 2 deletions packages/reason-relay/language-plugin/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
},
"suffix": ".bs.js",
"bs-dependencies": [
"bs-flow-parser",
"tablecloth-bucklescript"
],
"warnings": {
"error" : "+101"
},
"refmt": 3,
"gentypeconfig": {
"language": "flow",
"shims": {},
"language": "typescript",
"shims": {
"Js": "Js"
},
"debug": {
"all": false,
"basic": false
Expand Down
2 changes: 0 additions & 2 deletions packages/reason-relay/language-plugin/flow-typed/global.js

This file was deleted.

This file was deleted.

0 comments on commit d9d08fa

Please sign in to comment.