-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contributing to this repository is HARD #16889
Comments
Hi @eyalroth, Here two things that might help you the next time you want to contribute to any larger project: 1. git clone size & docs
That way you will save A LOT of files that are not relevant if you are only relying on the current state as it drops all the files from the past. I'm a fan of including the docs and blog posts. It's so handy to have all those information at hands if you dig deeper into the framework. 2. yarn vs npm -- I hope you are able to finish your contribution. I'm still looking forward to my own first code contribution as Gatsby is such an awesome piece of software 🙏 |
@georgiee I believe my experience has very little to do with my unfamiliarity with these tools, as the vast majority of my time was invested in troubleshooting unexpected problems with the tools (aka bugs). Other than these problems, most of the process was pretty straight-forward as the guides are pretty good and really there isn't much to it. I obviously tried cloning only with minimal depth, but that doesn't help much as even the latest revision without the history is pretty big, as you can see in the image I attached (or simply Again, I have very little experience with both Yarn and NPM alike, so I cannot really say which gives a better user experience; however, having the repository setup in "less than a day" is not an achievement in my opinion, and I believe it will further alienate contributors from this repository over time. I would at least expect a warning in the documentation about the potential difficulties in setting up a local clone. |
Thank you for bringing this up. I'm closing this as a duplicate of #13699 |
@wardpeet What about Yarn? Reducing the repo size won't solve the cumbersomeness of the setup process, which is caused mostly due to bugs in Yarn. |
{ **Microsoft Windows [Version 10.0.16299.371] C:\Users\user>gatsby -v C:\Users\user>npm install gatsby-cli C:\Users\user>npm cache clean --force C:\Users\user>npm install -g gatsby-cli C:\Users\user>core-js -v C:\Users\user>npm install -g core-js
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
C:\Users\user>core-js -v C:\Users\user>npm install -g gatsby-cli
Success! Welcome to the Gatsby CLI! Please visit https://www.gatsbyjs.org/docs/gatsby-cli/ for more information. Usage: gatsby [options] Commands: Options:
C:\Users\user>cd desktop C:\Users\user\Desktop>gatsby new gatsby-site C:\Users\user\Desktop>** how can i solve this problem? |
I just had a small fix I wanted to contribute to this repository, but the process was difficult, time consuming and daunting, and all because of the extremely cumbersome process of setting up the repository locally.
My setup process
Upon cloning the repository I encountered a git problem I've never seen before: "The remote end hung up unexpectedly". Eventually I managed to workaround the problem by increasing
http.postBuffer
and using the HTTPS clone link instead of the SSH one, but that obviously took a few attempts and quite some time to resolve.I had to wait for the entire repo to download, which is a bit more than 600MB. On a slower-than-normal connection (5-10 Mbps) this could take up to 20 minutes.
After installing Yarn, which was pretty straightforward, I encountered a problem which seems to take a variety of different forms. Troubleshooting this problem took an immense amount of time, since I had to clean the Yarn cache and
yarn install
multiple times for each workaround attempt. Also there was the--network-concurrency 1
attempt which took forever.I eventually resorted to upgrade my Windows from
10.0.17134.799
to10.0.18362.295
in a final desperate attempt to resolve these issues by upgrading WSL. Lucky for me, that worked, but took quite a long time (couple of hours).On to the next Yarn error: "There appears to be trouble with your network connection. Retrying..." (+#5259). This was luckily resolved faster than the previous error with the
--network-timeout
workaround, but still took more than just a few minutes to fix.Finally,
yarn install
finished without any error, but that alone took more than 10 minutes.yarn run bootstrap
takes a few more minutes to complete.Finally, some tests (less than 20) fail. I didn't bother making them pass since they were not related to the package/plugin I was intending to fix.
Proposal
As I said in the beginning, this is one hell of a bad user experience for anyone who is just casual contributor, and I assume these problems have led others to eventually give up on contributing to this repository.
I believe there are two major steps that can be taken to dramatically improve this experience.
1. Reduce the repository size
This was very recently discussed in #16722, but I believe the discussion there was missing the fact that the reason this repository is so big is not because it is a mono-repo, but because more than half of it includes the
docs
directory, and especially thedocs/blog
directory:(
.git
andnode_modules
can obviously be ignored in this demonstration)There are two possible ways of remedying this: (a) Move the documentation / blog out of the repository, or (b) Make use of Git LFS to basically remove all the documentation / blog images from local repositories; though, I have no previous experience with this tool so I cannot attest to how well it works.
2. Move away from Yarn
The vast majority of my time consumed in the setup process was invested in solving Yarn problems. I can't say how common are these problems, especially since I am quite new to node and javascript, but from what little research I made I gather that some of these problems are indeed common in large Yarn projects.
The official documentation explains that the reason this repository is using Yarn instead of NPM is mainly due to the "workspaces" feature, but from what I gather that feature is possible to achieve in NPM via Lerna (and some say it is even better).
I understand this is probably quite a major step and requires a lot of work, but if Yarn is going to keep causing problems, perhaps it's better making that transition earlier so it will be easier.
The text was updated successfully, but these errors were encountered: