Skip to content

Conversation

@rschristian
Copy link
Member

@rschristian rschristian commented Aug 14, 2025

Mainly adds mention of the current main/v10.x situation, just to mirror what's in the ReadMe, and corrects the old karma & mocha references 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.

@coveralls
Copy link

coveralls commented Aug 14, 2025

Coverage Status

coverage: 99.536%. remained the same
when pulling 1799631 on docs/update-contributing
into d2c0387 on main.

Comment on lines -170 to -179
### 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.

Copy link
Member Author

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!
Copy link
Member Author

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.

@rschristian rschristian merged commit 61f47ca into main Aug 16, 2025
5 checks passed
@rschristian rschristian deleted the docs/update-contributing branch August 16, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants