Status: backlog Priority: P0 Created: 2026-02-22 Owner: AI Depends-on: none Phase: 8 — Library Restructuring
This spec describes work that must happen in the UPSTREAM fulcro-rad project (../fulcro-rad/), NOT in this library. It is a prerequisite for the restructuring of fulcro-rad-statecharts into an add-on library.
Currently, form.cljc and report.cljc in fulcro-rad contain both engine-agnostic pure functions (~40 for form, ~25 for report) and UISM-specific engine code. To allow fulcro-rad-statecharts to reuse the pure functions without duplicating them, these functions must be extracted into form.impl and report.impl namespaces. The existing public vars in form.cljc and report.cljc become pointers to the impl, preserving zero public API change.
This is an internal refactor of fulcro-rad. No user-facing behavior changes.
com.fulcrologic.rad.form.impl namespace containing ~52 pure functions extracted from form.cljccom.fulcrologic.rad.report.impl namespace containing ~25 pure functions extracted from report.cljcform.cljc become def aliases pointing to form.impl (e.g., (def valid? impl/valid?))report.cljc become def aliases pointing to report.impldefsc-form* macro helper function moves to form.impl, parameterized by a convert-options-fn argumentdefsc-report* macro helper function moves to report.impl, parameterized similarlyconvert-options-base (shared option conversion logic) moves to implrender-element multimethod (if present) moves to impl since it's engine-agnosticBased on the classification in cleanup-analysis.md Section 7:
*default-save-form-mutation*, view-action, create-action, edit-action, standard-action-buttonspicker-join-key, master-form, master-form?, parent-relation, form-key->attribute, subform-options, subform-ui, get-field-optionsrendering-env, render-input, field-context, with-field-context (macro), subform-rendering-env, render-subformfind-fields, optional-fields, field-label, field-style-config, field-autocomplete, field-visible?, omit-label?, computed-valueform-pre-merge, form-and-subform-attributes, default-to-many, default-to-one, default-state, mark-fields-complete*, update-tree*valid?, invalid?, invalid-attribute-value?, validation-error-messagesave-form*, wrap-env, pathom-plugin, resolvers, pathom2 mutation defs, delete!server-errors, sc (private), defunion (macro), form-bodydefsc-form* (parameterized by convert-options-fn), convert-options-baserender-element (if it dispatches on [element layout-style] — engine-agnostic)render-field delegation, render-layout delegation, render-input| Function | Issue | Resolution |
|---|---|---|
read-only? | Calls view-mode? (engine-specific) | Each engine defines its own (~5 lines) |
standard-controls | Lambdas call save!, cancel!, undo-all!, view-mode? | Each engine builds its own |
form-options->form-query | Original includes [::uism/asm-id '_] in query | Takes optional extra-query-elements param; UISM passes [[::uism/asm-id '_]], statecharts passes [] |
Same pattern. Extract all pure/rendering functions that don't reference UISM. Key categories:
defsc-report*../fulcro-rad/. Verify with ls ../fulcro-rad/src/main/com/fulcrologic/rad/form.cljc.../fulcro-rad/src/main/com/fulcrologic/rad/form.cljc and classify every function/var../fulcro-rad/src/main/com/fulcrologic/rad/form/impl.cljc with pure functionsform.cljc to require form.impl and create def aliases for extracted functionsreport.cljc → report/impl.cljcsrc/main/com/fulcrologic/rad/form.cljc — Extract pure functions, replace with def aliasessrc/main/com/fulcrologic/rad/form/impl.cljc — NEW: ~52 pure functionssrc/main/com/fulcrologic/rad/report.cljc — Extract pure functions, replace with def aliasessrc/main/com/fulcrologic/rad/report/impl.cljc — NEW: ~25 pure functionsimpl in the name as a signal, but don't add :no-doc metadata since downstream (this library) needs to access them.container.cljc? The cleanup analysis defers container work, but if we're extracting impl for form and report, should we do container too? Recommend: defer, since container is less stable.form.impl compiles with no UISM/statechart requiresreport.impl compiles with no UISM/statechart requires(require 'com.fulcrologic.rad.form) still exposes all public vars(require 'com.fulcrologic.rad.report) still exposes all public varsform.impl/defsc-form* accepts a convert-options-fn parameterform.impl/form-options->form-query accepts optional extra-query-elementsread-only? and standard-controls remain in form.cljc (not extracted)Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |