Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Case Study] Make yarn v2 work with flow #634
What package is covered by this investigations?
Describe the goal of the investigation
It should be possible to use flow in a codebase.
I've put together a small repo demonstrating that flow doesn't work with yarn v2: https://github.com/lhorie/flow-berry
Produces this error:
I've also tried suggestions from this thread, but without success.
Flow works w/ yarn 1.x and npm
This will be difficult (and I won't implement it).
On the other hand TypeScript is written in JS, so even if they don't support PnP natively (yet, but we're working with them to find an appropriate way that satisfies both sides) we can implement it through PnPify, which simulates a n_m folder.
I realize it's not the answer you hoped for, and I'm really sorry not to have better news in this regard ...
One last thing of interest is that @larixer is working on implementing a n_m linker for Yarn 2 (you can follow the development in #470). This will allow your projects to keep using node_modules until you're ready to migrate to PnP. Unfortunately this also means that you won't benefit from the PnP perf, stability improvements, and some features, but ... tradeoffs tradeoffs. At least you'll get the rest of the CLI improvements, and will be able to use the Yarn plugin interface etc.
The Flow team has no plans to adopt support for Yarn 2 or PNP. The primary use case for Flow at Facebook is in support of React code. Christoph Nakazawa of the React Native team has publicly stated that they have no immediate plans to support Yarn 2. There's a more thorough discussion here. Dan Abramov, from the React Core team, concurred, "We’re still using 1.x at FB and there are no immediate plans to switch to 2.x as that would be a ton of work."
@arcanis, I've edited my comment to be more precise. Feel free to reach out to me directly in the future.
Is not at all expected. It took me a long time to hunt down this not-really-a-solution; especially since I came across a few examples of using custom resolvers (which didn't work). It might be useful to have a prominently featured partial list of common tools that don't work with yarn 2.
Please make it all work together!