feat(solid-adapter): add @vanelsas/baredom-solid Solid 1.x adapter#246
Merged
Conversation
Wires Solid into the existing four-adapter codegen pipeline. Like the other adapters, every BareDOM custom element gets a typed wrapper component generated from the shared metadata (model.cljs + form-control-metadata.bb + codegen_shared.bb). Adding a new BareDOM component automatically updates Solid alongside React/Vue/Angular/Svelte via the pre-commit hook. Adapter architecture: - Function components (no defineComponent, no @directive, no .svelte). Events bind via addEventListener inside onMount with onCleanup; refs are direct via setRef callback; controlled inputs use createEffect to sync the control prop to the DOM attribute. Closest analog among the four is React (JSX, function-shaped). Solid is structurally simpler: no synthetic events, no virtual DOM, no forwardRef. - TypeScript compile: jsx: preserve + jsxImportSource: solid-js. The package ships .jsx alongside .d.ts so consumers' Solid bundler (vite-plugin-solid / babel-preset-solid / esbuild-plugin-solid) handles the JSX -> DOM compilation. This is the prevailing Solid- library convention (solid-primitives, @solid-aria). - splitProps preserves reactivity — props are never destructured in the generated wrappers. Form-control reuse: the controlled-components map is derived from scripts/form-control-metadata.bb identically to React (post-PR-#245), so the silent drift trap stays closed for Solid too. Pre-commit hook (scripts/pre-commit-react-adapter.sh): - Trigger regex widened to include generate_solid.bb and codegen_shared.bb - Added a fifth regeneration block for the Solid adapter Verification: - bb scripts/generate_solid.bb -> 104 wrappers + index.ts + custom-elements.d.ts - npm --prefix adapters/solid run build -> tsc clean, dist/ emitted (.jsx per-component, .js for barrel + composables) - npm --prefix adapters/solid/test-app run build -> vite build clean (22 modules, 73 KB gzip), all imports resolved, JSX compiled, Solid runtime wired - Existing four adapter generators produce byte-identical output (git status adapters/{react,vue,angular,svelte} clean after regenerating) - clj-kondo --lint src test -> 0 errors, 0 warnings - npx shadow-cljs release lib -> 480 files, 0 warnings (Closure Advanced gate) - All four existing adapter builds remain clean (React/Vue tsc, Angular ngc, Svelte svelte-check 373 files 0 errors 0 warnings) Test app smoke target (adapters/solid/test-app) renders five representative components covering the event prop, controlled boolean, controlled string, uncontrolled default-value, and imperative-ref paths. Initial version 0.1.0, matching the Svelte and Vue adapter initial releases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a fifth framework adapter —
@vanelsas/baredom-solid— wired into the existing four-adapter codegen pipeline. Targets SolidJS for reach (largest unserved audience among current top-10 JS frameworks).Like the other adapters, every BareDOM custom element gets a typed wrapper component generated from shared metadata (
model.cljs+form-control-metadata.bb+codegen_shared.bb). Adding a new BareDOM component automatically updates Solid alongside React/Vue/Angular/Svelte via the pre-commit hook.Architecture
defineComponent, no@Directive, no.svelte. Events bind viaaddEventListenerinsideonMountwithonCleanup; refs are direct via asetRefcallback; controlled inputs usecreateEffectto sync the control prop to the DOM attribute. Closest analog among the four existing adapters is React (JSX, function-shaped). Solid is structurally simpler: no synthetic events, no virtual DOM, noforwardRef.jsx: "preserve"+jsxImportSource: "solid-js". The package ships.jsxalongside.d.tsso consumers' Solid bundler (vite-plugin-solid/babel-preset-solid/esbuild-plugin-solid) handles the JSX → DOM compilation. This is the prevailing Solid-library convention (solid-primitives, @solid-aria).splitPropspreserves reactivity — props are never destructured in generated wrappers.controlled-componentsmap derives fromscripts/form-control-metadata.bbidentically to React (post-PR-refactor(adapter-codegen): share helpers across the four generators #245), so the silent drift trap stays closed for Solid too.Pre-commit hook (
scripts/pre-commit-react-adapter.sh)generate_solid.bbandcodegen_shared.bbTest plan
bb scripts/generate_solid.bb→ 104 wrappers +index.ts+custom-elements.d.tsnpm --prefix adapters/solid run build→tscclean,dist/emitted (.jsxper-component,.jsfor barrel + composables)npm --prefix adapters/solid/test-app run build→vite buildclean (22 modules, 73 KB gzip) — all imports resolved, JSX compiled, Solid runtime wiredgit status adapters/{react,vue,angular,svelte}clean after regenerating)clj-kondo --lint src test→ 0 errors, 0 warningsnpx shadow-cljs release lib→ 480 files, 0 warnings (Closure Advanced gate)tsc✓tsc✓ngc✓ (CEM-drift-sensitive)svelte-check→ 373 FILES 0 ERRORS 0 WARNINGS ✓cd adapters/solid/test-app && npm run dev— verify five-component demo (button event, controlled boolean checkbox, controlled string slider, uncontrolled select, modal via signal)Version
0.1.0— matches the initial-release version of the Svelte and Vue adapters.🤖 Generated with Claude Code