Skip to content

Consolidate the dual render pipeline (legacy type-switch vs FieldRendererService) #148

Closed

Description

@phmatray

Context

FormCraftComponent.RenderField contains a legacy type-switch (string/int/decimal/double/float/long/short/byte/bool/DateTime/select/file branches) and delegates some cases to FieldRendererService, which has its own renderer registry. Several v3.0 bugs existed precisely because the two paths diverged (numeric pattern attribute, file-upload crash, LOV/lookup/autocomplete shadowing, MinDate/MaxDate honored in one path only), and fixes sometimes had to be applied twice.

Proposal

Make FieldRendererService the single rendering path:

  1. Move any behavior that only exists in the legacy switch (e.g. select options via Options attribute, MinDate/MaxDate passthrough) into the corresponding renderer components.
  2. Reduce RenderField to: custom template → renderer service.
  3. Delete RenderTextField/RenderNumericField/RenderBooleanField/RenderDateTimeField/RenderSelectField* from FormCraftComponent and the duplicated equivalents in CollectionFieldComponent where feasible.
  4. Keep the bUnit suite as the safety net — assertions target the rendered Mud components, not the dispatch path.

Risks

Subtle styling/behavior differences between the legacy markup and the renderer components (Variant/Margin/ShrinkLabel, Immediate, Culture). Inventory them first and align the components before deleting the switch.

Refs: v3.0 audit findings #13, #34, #53/54 and the file-upload/LOV regressions fixed in v3.0.0.

Activity

  1. phmatray commented on Jun 10, 2026

    @phmatray
    OwnerAuthor

    Shipped in v3.1.0: RenderField is now custom-template → FieldRendererService; the legacy type-switch and its helpers (-282 lines) are gone. Legacy-only behaviors (Options-driven selects incl. nullable/reflection fallback, MinDate/MaxDate, invariant culture on numerics, checkbox-default booleans, styling parity) moved into the renderer components with 17 parity tests. Bonus: AsMultiSelect fields, which the old switch silently skipped, now render a real multi-selection MudSelect.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:highShould fix soonstatus:doneWork completed and shippedtype:refactorCode refactoring without behavior change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions