Fix missing setListener export in React core build#85
Conversation
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>
|
Someone is attempting to deploy a commit to the Open Circle Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis pull request updates the package versions for both the React framework and core packages, bumping 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
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
Listenertype andsetListener“No framework selected” stub topackages/core/src/framework/index.ts. - Patch-bump
@formisch/coreand document the fix in its changelog. - Patch-bump
@formisch/reactand 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.
|
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 |
|
Any updates? |
|
This PR is basically a precursor for the much larger PR: #87 |
Summary
packages/core/src/framework/index.tsdoesn't declareListenerorsetListener, butindex.react.tsdoes. The bundler'sexport *re-export forwards only names visible on the base module's analysis, sosetListenerwas silently dropped frompackages/core/dist/index.react.js.@formisch/react's build —frameworks/react/src/hooks/useSignals/useSignals.tsimportssetListenerfrom@formisch/core/reactandtsdownerrors with"setListener" is not exported by "../../packages/core/dist/index.react.js".Listenertype andsetListenerstub to the baseindex.ts, matching the existing"No framework selected"stub pattern used forcreateId,createSignal,batch, anduntrack. React picks up the real implementation fromindex.react.ts; the other five frameworks pick up the throwing stub but never call it.@formisch/core0.6.3 → 0.6.4 and@formisch/react0.4.5 → 0.4.6.Audit
I checked every
*.{framework}.tsfile inpackages/core/src/framework/,packages/core/src/types/, andpackages/methods/src/for the same bug pattern. Only React'sListener/setListenerwere missing from base — every other framework variant either redeclares the same names as its base or explicitly re-exports them (e.g.field.qwik.tsre-exportsFieldElement,form.qwik.tsre-exportsValidationMode/SubmitHandler/SubmitEventHandler).After the fix, all six framework cores' dist files have an identical 22-symbol export list, and
pnpm -C frameworks/react buildsucceeds.Note on the other 5 framework packages
I only bumped
@formisch/reactsince it was the only framework with a broken build. The other five (preact, qwik, solid, svelte, vue) don't importsetListener, so they're unaffected at the source level — but they will pick up the newsetListenerstub 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 buildsucceeds.pnpm -C packages/methods buildsucceeds.pnpm -C frameworks/react buildsucceeds (previously failed withMISSING_EXPORT setListener).pnpm -C frameworks/{preact,qwik,solid,svelte,vue} buildall succeed (no regressions).packages/core/dist/index.{preact,qwik,react,solid,svelte,vue}.js— all six should listsetListenerin the finalexport { ... }line.pnpm -C playgrounds/react devstarts withoutFailed to resolve entry for package "@formisch/react".🤖 Generated with Claude Code