This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
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.
The road to relay modern involves switching our existing components to use the compat API, which is an adapter to the classic relay environment with the modern API. There are a few steps. The first is getting relay compiler working.
This PR gets the compiler working as
yarn run relay
as suggested. This spits out graphql generated files extracted from the relay component files. It can be run with--watch
to notice changes to files to recompile them, and we could put this into foreman.But while the watcher is optional, you must have facebook's watchman installed to run the compiler at all because of poor isolation (facebook/relay#1644). This is easy in dev —
brew install watchman
— but this will break the CI build unless we install watchman on the agents and that's a bit silly. So we may have to wait for that to be fixed.There's also a lovely webpack plugin which can automatically compile the graphql files during the webpack build, in dev and prod. It still requires watchman because it still uses relay-compiler under the hood. But it doesn't really work for me. It sounds like they need to work with the relay compiler folks to make it more modular and better integrated with webpack. Early days.
I'll keep an eye on things and update this branch accordingly.