Skip to content
Myr

fix(jsx): rename `Hono` to `JSX` and export `JSX` namespace (#2937)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* fix(jsx): rename `Hono` to `JSX` and export `JSX` namespace * export as type

authored by Yusuke Wada · committed by GitHub · parent 1a32ef4 · Browse files · 4 files+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+11 added−6 removed

  • other:+11 added−6 removed

4 files+11 added−6 removed

modified:src/jsx/base.ts+5 added-2 removed
1 unmodified line
2import { escapeToBuffer, stringBufferToString } from '../utils/html'3import type { HtmlEscaped, HtmlEscapedString, StringBuffer } from '../utils/html'4import type { Context } from './context'5import { globalContexts } from './context'6import type { Hono, IntrinsicElements as IntrinsicElementsDefined } from './intrinsic-elements'6import type {7 JSX as HonoJSX,8 IntrinsicElements as IntrinsicElementsDefined,9} from './intrinsic-elements'10import { normalizeIntrinsicElementProps, styleObjectForEach } from './utils'1112// eslint-disable-next-line @typescript-eslint/no-explicit-any13export type Props = Record<string, any>
1 unmodified line
15 (props: P): HtmlEscapedString | Promise<HtmlEscapedString>16 defaultProps?: Partial<P> | undefined17 displayName?: string | undefined18}16export type DOMAttributes = Hono.HTMLAttributes19export type DOMAttributes = HonoJSX.HTMLAttributes2021// eslint-disable-next-line @typescript-eslint/no-namespace22export namespace JSX {23 export type Element = HtmlEscapedString | Promise<HtmlEscapedString>
341 unmodified lines
modified:src/jsx/index.ts+2 added
modified:src/jsx/intrinsic-elements.ts+2 added-2 removed
6 unmodified lines
7 * Copyright (c) Meta Platforms, Inc. and affiliates.8 */910// eslint-disable-next-line @typescript-eslint/no-namespace11export namespace Hono {11export namespace JSX {12 export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined13 export type CSSProperties = {}14 type AnyAttributes = { [attributeName: string]: any }15
709 unmodified lines
725 wbr: HTMLAttributes726 }727}728729export interface IntrinsicElements extends Hono.IntrinsicElements {}729export interface IntrinsicElements extends JSX.IntrinsicElements {}
modified:src/jsx/types.ts+2 added-2 removed