Skip to content

Replace fragment composition with typed HTML components - #56

Open
gregjotau wants to merge 1 commit into
mainfrom
codex/wt-thim-typed-components
Open

gregjotau wants to merge 1 commit into
mainfrom
codex/wt-thim-typed-components

Conversation

@gregjotau

Copy link
Copy Markdown
Contributor

Replace string-substituted fragment composition with one typed component model. Calls such as <ui:feature props="${feature}"> bind an explicit Kotlin/Java contract, and default/named slots retain the caller's lexical scope. Definitions are checked independently; unknown attributes/slots, missing required slots, incompatible or nullable props, and recursive composition fail compilation.

This is deliberately breaking: th:fragment, th:replace, th:insert, th:include, the old expander, and the old Gradle option are removed. There is no compatibility path. The example and catalog benchmark are migrated; ReAI, Eteo and Utin remain on their existing versions for separate evaluation and migration.

COMPONENTS.md contains the full contract, implementation rationale, migration steps, limitations and raw benchmark links. Props are whole Kotlin/Java models so construction, defaults and enum checking stay in the host language. Components and slots compile to direct writes without runtime lookup, markup closures or browser wrappers.

Validation: ./gradlew clean build, final ./gradlew build, example startup and built-in browser verification, and temporary positive/negative compiler/rendering checks covering Kotlin and Java records, nested slot forwarding, scope isolation, escaping, URLs and partitioned renderers. English and Norwegian catalog output is byte-for-byte identical. Synthetic linking measured 41–43% faster with 38–42% less allocation; this excludes independent type validation and is not a whole-build claim. Catalog rendering remains effectively unchanged (7.91 vs 7.95 µs, identical allocation).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant