Skip to content

Move effect deps to implementation getter and require array return#3022

Closed
Copilot wants to merge 13 commits intomainfrom
copilot/support-effect-dependencies
Closed

Move effect deps to implementation getter and require array return#3022
Copilot wants to merge 13 commits intomainfrom
copilot/support-effect-dependencies

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Closes #

📝 Description

Effect dependencies now belong to the effect implementation itself and must be returned via a deps getter that always yields an array, simplifying descriptors to type only.

⛳️ Current behavior (updates)

Effect descriptors could carry deps, and dependency resolvers accepted optional/undefined returns, requiring extra defensive logic.

🚀 New behavior

  • Core: EffectDeps is a required getter (params) => EffectDepsValue[]; descriptors remain type-only.
  • Framework runtimes: dependency resolution calls the implementation’s deps getter directly (no undefined fallback) across React, Preact, Solid, Svelte, Vue, Vanilla.
  • Tests remain valid under the stricter contract.

Example:

const syncCount: EffectImpl<any> = ({ context }) => {
  // effect body
}
syncCount.deps = ({ context }) => [context.get("count")]

effects: ["syncCount"]
implementations: { effects: { syncCount } }

💣 Is this a breaking change (Yes/No):

Yes — deps must now be supplied on the implementation via a required getter; effect descriptors no longer accept deps.

📝 Additional Information


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: 869f010

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

@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zag-nextjs Ready Ready Preview Mar 12, 2026 3:02pm
zag-solid Ready Ready Preview Mar 12, 2026 3:02pm
zag-svelte Ready Ready Preview Mar 12, 2026 3:02pm
zag-vue Ready Ready Preview Mar 12, 2026 3:02pm
zag-website Ready Ready Preview Mar 12, 2026 3:02pm

Request Review

Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for effect dependencies across machine core and framework bindings feat: add effect dependency tracking across bindings Mar 12, 2026
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com>
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