Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Investigated whether html${nothing}`` should be replaced with direct nothing returns in Lit components. Answer: No - the wrapper is required for type safety.

Root Cause

Decorators @errorGuard() and @bindingGuard() enforce return type GenericRender<T> = TemplateResult<T>. Direct nothing returns fail because nothing is symbol, not TemplateResult<T>.

// ❌ Breaks with decorators
@errorGuard()
render() {
  return nothing;  // Type error: symbol not assignable to TemplateResult<T>
}

// ✅ Required pattern
@errorGuard()
render() {
  return html`${nothing}`;  // Creates TemplateResult<T> wrapping the symbol
}

Investigation Summary

  • 21 occurrences tested across 20 files
  • TypeScript compilation failed with decorator type errors
  • Alternative type definitions broke all decorator-using components
  • Changes reverted - current pattern is correct

Documentation

Added INVESTIGATION-NOTHING-PATTERN.md with detailed analysis including:

  • Type system constraints
  • Compilation errors encountered
  • Pattern usage matrix
  • Alternative approaches attempted

No code changes required. Current implementation is type-safe and correct.

Original prompt

This section details on the original issue you should resolve

<issue_title>[DXUI]: Return nothing instead of html`${nothing}`</issue_title>
<issue_description>### Task Description

Should we return nothing instead of html`${nothing}`?
Study the question and implement.

Acceptance Criteria

  • Should remain typesafe & build
  • Should pass existing tests

Technical Notes

No response

Jira Ticket

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Return nothing instead of html template Investigation: html${nothing} pattern is required for type safety with decorators Nov 19, 2025
Copilot AI requested a review from louis-bompart November 19, 2025 06:07
Copilot finished work on behalf of louis-bompart November 19, 2025 06:07
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.

[DXUI]: Return nothing instead of ` html${nothing} `

2 participants