Skip to content

Conversation

@joshblack
Copy link
Contributor

Closes #333

With the changes to React's JSX namespace, this PR updates our define module so that it no longer defines relative-time under JSX.IntrinsicElements. Instead, we include a snippet in the README now that details how to use this alongside React. In the future we could also add a wrapper for this for React.

This helps to avoid any future issues with changes to React's typescript types and means we don't have to specify any optional dependencies when using the declare module 'react' syntax.

Curious what you all think about this change 👀 Let me know if there would be a better way here!

In terms of versioning, since this would break existing usage of this element I believe we should treat this as a major change.

@joshblack joshblack requested a review from a team as a code owner November 20, 2025 17:16
Copilot AI review requested due to automatic review settings November 20, 2025 17:16
Copilot finished reviewing on behalf of joshblack November 20, 2025 17:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the JSX namespace definition from the TypeScript definition file to avoid coupling with React's evolving type system. Instead of automatically declaring relative-time under JSX.IntrinsicElements, the PR adds documentation showing developers how to manually add React support if needed.

Key Changes:

  • Removed automatic JSX namespace declaration from the TypeScript definition file
  • Added React integration documentation with a code snippet for manual type declaration
  • Cleaned up formatting throughout the README (whitespace, markdown tables, code blocks)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/relative-time-element-define.ts Removed JSXBase type and JSX namespace declaration, keeping only the global HTMLElementTagNameMap definition
README.md Added React usage section with manual JSX type declaration example; cleaned up formatting and whitespace throughout examples and tables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

##### time-zone (`string`)

The`time-zone` attribute allows you to specify the IANA time zone name (e.g., `America/New_York`, `Europe/London`) used for formatting the date and time.
The`time-zone` attribute allows you to specify the IANA time zone name (e.g., `America/New_York`, `Europe/London`) used for formatting the date and time.
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after 'The' in 'Thetime-zone'.

Suggested change
The`time-zone` attribute allows you to specify the IANA time zone name (e.g., `America/New_York`, `Europe/London`) used for formatting the date and time.
The `time-zone` attribute allows you to specify the IANA time zone name (e.g., `America/New_York`, `Europe/London`) used for formatting the date and time.

Copilot uses AI. Check for mistakes.
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.

JSX type extensions should use scoped-jsx under React.JSX.IntrinsicElements

3 participants