Skip to content

Fix missing setListener export in React core build#85

Open
Dan503 wants to merge 2 commits into
open-circle:mainfrom
Dan503:fix/missing-framework-exports
Open

Fix missing setListener export in React core build#85
Dan503 wants to merge 2 commits into
open-circle:mainfrom
Dan503:fix/missing-framework-exports

Conversation

@Dan503
Copy link
Copy Markdown

@Dan503 Dan503 commented May 1, 2026

Summary

  • The framework-agnostic packages/core/src/framework/index.ts doesn't declare Listener or setListener, but index.react.ts does. The bundler's export * re-export forwards only names visible on the base module's analysis, so setListener was silently dropped from packages/core/dist/index.react.js.
  • This broke @formisch/react's build — frameworks/react/src/hooks/useSignals/useSignals.ts imports setListener from @formisch/core/react and tsdown errors with "setListener" is not exported by "../../packages/core/dist/index.react.js".
  • Adds Listener type and setListener stub to the base index.ts, matching the existing "No framework selected" stub pattern used for createId, createSignal, batch, and untrack. React picks up the real implementation from index.react.ts; the other five frameworks pick up the throwing stub but never call it.
  • Patch-bumps the two affected packages: @formisch/core 0.6.3 → 0.6.4 and @formisch/react 0.4.5 → 0.4.6.

Audit

I checked every *.{framework}.ts file in packages/core/src/framework/, packages/core/src/types/, and packages/methods/src/ for the same bug pattern. Only React's Listener / setListener were missing from base — every other framework variant either redeclares the same names as its base or explicitly re-exports them (e.g. field.qwik.ts re-exports FieldElement, form.qwik.ts re-exports ValidationMode/SubmitHandler/SubmitEventHandler).

After the fix, all six framework cores' dist files have an identical 22-symbol export list, and pnpm -C frameworks/react build succeeds.

Note on the other 5 framework packages

I only bumped @formisch/react since it was the only framework with a broken build. The other five (preact, qwik, solid, svelte, vue) don't import setListener, so they're unaffected at the source level — but they will pick up the new setListener stub in their core dists when they next rebuild. If you'd prefer to also bump those five to follow the "bump-frameworks-with-deps" convention used in the v0.4.5 release, happy to add that as a follow-up commit.

Test plan

  • pnpm -C packages/core build succeeds.
  • pnpm -C packages/methods build succeeds.
  • pnpm -C frameworks/react build succeeds (previously failed with MISSING_EXPORT setListener).
  • pnpm -C frameworks/{preact,qwik,solid,svelte,vue} build all succeed (no regressions).
  • Inspect packages/core/dist/index.{preact,qwik,react,solid,svelte,vue}.js — all six should list setListener in the final export { ... } line.
  • pnpm -C playgrounds/react dev starts without Failed to resolve entry for package "@formisch/react".

🤖 Generated with Claude Code

Daniel Tonon and others added 2 commits May 1, 2026 15:20
The framework-agnostic packages/core/src/framework/index.ts didn't declare Listener or setListener, but packages/core/src/framework/index.react.ts did. The build's `export *` re-export forwards only names visible on the base module's analysis, so setListener was silently dropped from the React core dist. This broke @formisch/react's useSignals hook (which imports setListener from @formisch/core/react) and any downstream React framework build.

Adds Listener and setListener stub declarations to the base index.ts, matching the existing pattern of "No framework selected" stubs for createId, createSignal, batch, and untrack. The React framework now picks up the real implementation from index.react.ts; the other five frameworks pick up the throwing stub but never call it, so the stub is harmless.

Audit of the other framework-specific files (packages/core/src/framework/index.{preact,qwik,solid,svelte,vue}.ts, packages/core/src/types/*.{fw}.ts, packages/methods/src/**/*.{fw}.ts) found no other missing-export bugs — every other framework variant either redeclares the same names as its base or explicitly re-exports them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Patch release for the React core build fix in the previous commit.

- @formisch/core: 0.6.3 → 0.6.4 — adds Listener type and setListener stub to the framework-agnostic framework/index.ts so the bundler includes setListener in the React core dist.
- @formisch/react: 0.4.5 → 0.4.6 — pulls in the fixed @formisch/core; the React framework's build (frameworks/react/src/hooks/useSignals/useSignals.ts) was previously failing with "MISSING_EXPORT setListener".

The other five framework packages (preact, qwik, solid, svelte, vue) are not bumped here — their builds were not affected by the bug, since none of them import setListener. If you'd prefer to bump them too to follow the existing "bump-frameworks-with-deps" convention used in the v0.4.5 release, happy to do that as a follow-up.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 1, 2026 05:39
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

Someone is attempting to deploy a commit to the Open Circle Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a260f57d-d431-4d5d-8d2b-d3950214232a

📥 Commits

Reviewing files that changed from the base of the PR and between 10dc3d0 and 27e5fd3.

📒 Files selected for processing (5)
  • frameworks/react/CHANGELOG.md
  • frameworks/react/package.json
  • packages/core/CHANGELOG.md
  • packages/core/package.json
  • packages/core/src/framework/index.ts

Walkthrough

This pull request updates the package versions for both the React framework and core packages, bumping @formisch/react from 0.4.5 to 0.4.6 and @formisch/core from 0.6.3 to 0.6.4. Corresponding changelog entries document the release notes for each version. The core change adds two new exports to packages/core/src/framework/index.ts: a Listener type representing a listener callback and subscription-set structure, and a setListener function that follows the framework-selection pattern by throwing an exception when no framework is selected.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a missing setListener export to fix the React core build failure.
Description check ✅ Passed The description provides comprehensive context about the root cause, impact, fix, audit, and test plan—all directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot Bot added the fix Smaller bug fix or improvement label May 1, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a missing export in the React-specific @formisch/core/react build by ensuring Listener and setListener are declared in the framework-agnostic framework entrypoint, preventing export * re-export analysis from dropping them and unblocking @formisch/react builds.

Changes:

  • Add Listener type and setListener “No framework selected” stub to packages/core/src/framework/index.ts.
  • Patch-bump @formisch/core and document the fix in its changelog.
  • Patch-bump @formisch/react and document the core version update in its changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/framework/index.ts Declares Listener and setListener in the base framework module to ensure the React build re-exports them correctly.
packages/core/package.json Bumps @formisch/core version to 0.6.4.
packages/core/CHANGELOG.md Adds release note for v0.6.4 describing the missing export fix.
frameworks/react/package.json Bumps @formisch/react version to 0.4.6.
frameworks/react/CHANGELOG.md Adds release note for v0.4.6 referencing the core bump/fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fabian-hiller
Copy link
Copy Markdown
Member

Thank you for looking into this. I need more details to understand where and how you encountered this issue. When I clone the repo, install the packages and build the library there are no errors and setListener is part of the /react/dist/index.js file.

@fabian-hiller fabian-hiller self-assigned this May 2, 2026
@fabian-hiller fabian-hiller added the question Further information is requested label May 2, 2026
@fabian-hiller
Copy link
Copy Markdown
Member

Any updates?

@Dan503
Copy link
Copy Markdown
Author

Dan503 commented May 7, 2026

This PR is basically a precursor for the much larger PR: #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Smaller bug fix or improvement question Further information is requested size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants