Skip to content

Conversation

@amirhhashemi
Copy link
Collaborator

This PR improves the createEffect and createRenderEffect reference pages by:

  1. Improving compliance with the Diataxis framework.
  2. Clarifying when effects run.
  3. Updating the structure to match the new reference page format.

Any important notes removed from the reference pages (usually for Diataxis compliance) have been moved to an explanation page.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for solid-docs ready!

Name Link
🔨 Latest commit 800c418
🔍 Latest deploy log https://app.netlify.com/projects/solid-docs/deploys/690a2d5629dcc40008eb0e30
😎 Deploy Preview https://deploy-preview-1330--solid-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@amirhhashemi amirhhashemi force-pushed the improve-effect-reference branch from 73217bb to a50d1ff Compare October 30, 2025 14:31
@amirhhashemi amirhhashemi marked this pull request as draft October 30, 2025 14:32
@amirhhashemi amirhhashemi marked this pull request as ready for review October 30, 2025 15:53
@amirhhashemi amirhhashemi marked this pull request as draft October 31, 2025 17:12
@amirhhashemi amirhhashemi marked this pull request as ready for review November 1, 2025 16:46
- The initial run of a render effect happens during the current rendering phase.
- It runs as DOM elements are being created and updated, but before they are mounted.
As a result, refs are _not_ set before a render effect runs for the first time.
- If multiple dependencies are updated within the same batch, the render effect only runs once.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If multiple dependencies are updated within the same batch, the render effect only runs once.

Id say (or something similar)

If multiple dependencies are updated within the same batch, the render effect will run one more time.

Because, when dependencies changed, the render effect already ran. So it has to run again, but yes, even if multiple dependencies has been updated, it will run at the very minimum 1 more time.

As a result, refs are _not_ set before a render effect runs for the first time.
- If multiple dependencies are updated within the same batch, the render effect only runs once.
- Effects always run after any pure computations (like [memos](/concepts/derived-values/memos)) in the same update cycle.
- The order in which render effects run is not guaranteed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order in which render effects run is not guaranteed.

I'd say

The order in which render effects run is not guaranteed after the initial ran.

Because, it's an eager effect, so the order on which is defined, it's the order on which runs. Only after it ran at least once the order stops being guaranteed.

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