Skip to content

chore: tweak effect docs #11979

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

Merged
merged 2 commits into from
Jun 10, 2024
Merged

chore: tweak effect docs #11979

merged 2 commits into from
Jun 10, 2024

Conversation

Rich-Harris
Copy link
Member

Alternative to #10746, so that we can tidy up the PR queue. I still think we're devoting way too much space to $effect in these docs, but if we must keep a section on shallow tracking then we can at least whittle it down a bit.

Currently, the comments (which are the important bit) are the least visible part of the section — there's too much visual noise surrounding them (both literally, in that they're inside the $effect blocks, and in the sense of being less prominent than the console.log calls in terms of syntax highlighting). Moving them out of the blocks, putting them all on a single line, and getting rid of the console.log calls helps a lot, I think. I also think that removing the distracting logs makes it clearer that reading a value (even if you don't 'do' anything with it) is what makes something a dependency of an effect.

We should avoid using snake_case in snippets like these unless we plan to commit to using it everywhere in docs, which I don't think we're ready to do. When dealing with abstract concepts I think short names like a and b rather than object and derived_object tend to work better.

Copy link

changeset-bot bot commented Jun 9, 2024

⚠️ No Changeset found

Latest commit: c7f12f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rich-Harris Rich-Harris changed the title tweak effect docs chore: tweak effect docs Jun 9, 2024
@Rich-Harris Rich-Harris merged commit 3bfb302 into main Jun 10, 2024
8 checks passed
@Rich-Harris Rich-Harris deleted the effect-docs-2b branch June 10, 2024 13:30
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.

2 participants