forked from nicojs/typed-html
-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(html): add jsx-dev-runtime (#166)
* feat: add jsx-dev-runtime * chore: update CHANGELOG * Create stupid-owls-think.md Signed-off-by: Arthur Fiorette <[email protected]> * chore: remove change on CHANGELOG --------- Signed-off-by: Arthur Fiorette <[email protected]> Co-authored-by: Arthur Fiorette <[email protected]>
- Loading branch information
1 parent
d56c683
commit d4e1d36
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kitajs/html": patch | ||
--- | ||
|
||
Added jsx-dev-runtime to re-enable Bun support in development mode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// <reference path="./jsx.d.ts" /> | ||
/// <reference types="./suspense.d.ts" /> | ||
/// <reference types="./error-boundary.d.ts" /> | ||
|
||
import type { Children } from './index'; | ||
|
||
/** | ||
* Generates a html string from an attribute name of component and it's props. | ||
* | ||
* This function is meant to be used by the jsx runtime and should not be called directly. | ||
* | ||
* @param name The name of the element to create or another component function | ||
* @param attributes The props to apply to the component | ||
* @retuns The generated html string or a promise that resolves to the generated html string | ||
*/ | ||
export function jsxDEV( | ||
this: void, | ||
name: string | Function, | ||
attributes: { children?: Children; [k: string]: any } | ||
): JSX.Element; | ||
|
||
/** | ||
* Generates a html string from an attribute name of component and it's props. | ||
* | ||
* This function is meant to be used by the jsx runtime and should not be called directly. | ||
* | ||
* @param name The name of the element to create or another component function | ||
* @param attributes The props to apply to the component | ||
* @retuns The generated html string or a promise that resolves to the generated html string | ||
*/ | ||
export function jsxs( | ||
this: void, | ||
name: string | Function, | ||
attributes: { children: Children[]; [k: string]: any } | ||
): JSX.Element; | ||
|
||
export { Fragment } from './index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="./jsx.d.ts" /> | ||
|
||
const { Fragment, jsx, jsxs } = require('./jsx-runtime'); | ||
|
||
const JsxRuntime = { | ||
jsxDEV: jsx, | ||
jsxs, | ||
Fragment | ||
}; | ||
|
||
module.exports = JsxRuntime; | ||
module.exports.default = JsxRuntime; |