Just spent a few hours trying out Yarn workspaces on a monorepo project. I was enthusiastic at first but I found it to increase the complexity too much and make things seem more brittle. Problems mainly to do with hoisting of dependencies and complications thereof.
-
-
Replying to @michlbrmly
Hi there. Thanks for sharing your experience. Have you tried other options like lerna? I wonder how much of the complexity is yarn and how much is a monorepo in general...
1 reply 0 retweets 0 likes -
Replying to @Meligy
I did not try Lerna - I thought I'd start simply. The monorepo is pretty simple - 2 main packages: a server and a client app (ng CLI). Some problems w/ workspaces were e.g. differing versions of TypeScript, one getting hoisted and causing conflicts with other packages.
2 replies 0 retweets 1 like -
Replying to @michlbrmly @Meligy
Where did those TS errors pop up, in your editor, or actually in your build?
1 reply 0 retweets 0 likes -
When I tried to do build tasks or run tests, I'd get errors from Node. Also my editor
@WebStormIDE got confused about import paths for packages which had been hoisted. I believe they are working on improving support for that though.2 replies 0 retweets 2 likes
Any chance you can share your project with us? We’ve added some support for yarn workspaces back in version 2018.1.1: https://youtrack.jetbrains.com/issue/WEB-29250 We would like to investigate why it hasn’t helped with the imports. Or was it because of different TS versions? Thanks!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.