-
-
Notifications
You must be signed in to change notification settings - Fork 2k
docs: Update CONTRIBUTING.md #4886
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
Conversation
| ### Why does the code base often use `let` instead of `const`? | ||
|
|
||
| There is no real reason for that other a historical one. Back before auto-formatting via prettier was a thing and minifiers weren't as advanced as they are today we used a pretty terse code-style. The code-style deliberately was aimed at making code look as concise and short as possible. The `let` keyword is a bit shorter than `const` to write, so we only used that. This was done only for stylistic reasons. | ||
|
|
||
| This helped our minds to not lose sight of focusing on size, but made it difficult for newcomers to start contributing to Preact. For that reason alone we switched to `prettier` and loosened our rule regarding usage of `let` or `const`. Today we use both, but you can still find many existing places where `let` is still in use. | ||
|
|
||
| In the end there is no effect on size regardless if you use `const`, `let` or use both. Our code is downtranspiled to `ES5` for npm so both will be replaced with `var` anyways. Therefore it doesn't really matter at all which one is used in our codebase. | ||
|
|
||
| This will only become important once shipping modern JavaScript code on npm becomes a thing and bundlers follow suit. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have too many weird let/consts these days, so I think this whole section is rather unnecessary? I'm not sure anyone would actually ask this question is all.
Can revert if we want it for the "Our code is downtranspiled to ES5...` info though.
| - `main` - This is the main development branch and represents the upcoming v11 release line. | ||
| - `v10.x` - This branch represents the current stable release line, v10. | ||
|
|
||
| As we have yet to release v11, contributors are welcome to use either branch to build upon. We will try to port changes between the branches when possible, to keep them in sync, but if you're feeling generous, we'd love if you'd submit PRs to both branches! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verbiage recommendations welcome, if anyone has them. Not sure I love this line as-is.
Mainly adds mention of the current
main/v10.xsituation, just to mirror what's in the ReadMe, and corrects the oldkarma&mochareferences now that they're gone.I don't actually know what the release process looks like these days, but it might be worth updating the instructions and removing/replacing the v8 instructions as we haven't had a release there in nearly 6 years.