Context
Relevant spec, issue, ADR, or discussion:
- Spec:
docs/product/markup-transitions-spec.md - Issue: https://github.com/cssbruno/GoWDK/issues/503
- ADR:
docs/engineering/decisions/0008-bounded-client-language.md
Assumptions
- Transition and animation names are literal CSS hook names.
- This slice targets JS islands for client
g:ifand keyed clientg:for. - Server-rendered
server {}regions remain static request-time HTML and do not get transition hooks.
Proposed Changes
- Add
g:transitionandg:animateto the closed directive set. - Validate motion directive values and placement in
viewrender. - Emit
data-gowdk-transitionanddata-gowdk-animateattributes. - Extend
island.jsconditional and keyed-list lifecycles with class toggles, transition/animation end handling, and fallback cleanup. - Update docs, stability metadata, and conformance coverage.
Files Expected To Change
internal/viewparse/directives.gointernal/viewrender/directives.gointernal/viewrender/element.gointernal/viewanalysis/contract_references.gointernal/clientrt/assets/island.jsinternal/lang/stability.gointernal/lang/conformance_coverage_test.gointernal/viewrender/view_test.gointernal/buildgen/islands_test.godocs/compiler/generated-output.mddocs/language/components.mddocs/language/diagnostics.mddocs/language/markup.mddocs/language/stability.mddocs/product/requirements.mddocs/product/roadmap.md
Data And API Impact
- Public
.gwdkmarkup gains two accepted directives. - Generated HTML gains compiler-owned
data-gowdk-transitionanddata-gowdk-animateattributes. - No manifest shape changes.
Tests
- Unit:
internal/viewrenderdirective validation and rendering tests. - Integration:
internal/buildgengenerated HTML/runtime source tests. - End-to-end: browser island smoke for enter, leave interruption, and reorder.
- Manual: no separate example is required for this first slice; docs include the minimal CSS contract.
Verification Commands
go test ./internal/viewparse ./internal/viewrender ./internal/viewanalysis ./internal/clientrt ./internal/buildgen ./internal/lang ./internal/diagnostics
go build ./cmd/gowdk
go test ./...
scripts/test-go-modules.sh
Rollback Plan
- Remove the directives from the supported set and revert the runtime class toggles. Existing generated output without these directives is unaffected.
Risks
- Class names could collide if unprefixed; the implementation uses
gowdk-*. - CSS transitions without an end event need a deterministic fallback cleanup.
- Reordering must not disturb keyed row reuse or event listener rebinding.