-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
830 additions
and
72 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
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
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
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
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
// @jsxImportSource jsx-xml | ||
|
||
import { render } from 'jsx-xml'; | ||
|
||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'x:automatic': any; | ||
'x:nice': any; | ||
} | ||
} | ||
} | ||
|
||
const props = { foo: 'bar' }; | ||
|
||
export function renderAutomatic(count: number) { | ||
return render( | ||
<x:automatic> | ||
<x:nice before="value" key="66" ref="77" after="value"> | ||
{count} | ||
</x:nice> | ||
<x:nice before="value" key="66" ref="77" after="value"> | ||
{count} | ||
</x:nice> | ||
<x:nice {...props} before="value" key="66" ref="77" after="value"> | ||
{count} | ||
</x:nice> | ||
</x:automatic>, | ||
).end({ headless: true, prettyPrint: true }); | ||
} |
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,24 @@ | ||
// @jsxRuntime classic | ||
// @jsxFrag Fragment | ||
// @jsx h | ||
|
||
import { render, h } from 'jsx-xml'; | ||
|
||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'x:classic': any; | ||
'x:nice': any; | ||
} | ||
} | ||
} | ||
|
||
export function renderClassic(count: number) { | ||
return render( | ||
<x:classic> | ||
<x:nice before="value" key="66" ref="77" after="value"> | ||
{count} | ||
</x:nice> | ||
</x:classic>, | ||
).end({ headless: true, prettyPrint: true }); | ||
} |
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,38 @@ | ||
import { render, Comment } from 'jsx-xml'; | ||
import { ReactNode } from 'react'; | ||
|
||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'x:test': any; | ||
'x:label': any; | ||
'x:value': any; | ||
'x:nice': any; | ||
} | ||
} | ||
} | ||
|
||
const XLabel = (props: { children?: ReactNode }) => { | ||
return <x:label>{props.children}</x:label>; | ||
}; | ||
|
||
const XValue = (props: { children?: ReactNode }) => { | ||
return <x:value>{props.children}</x:value>; | ||
}; | ||
|
||
export function renderReact(count: number) { | ||
const xml = render( | ||
<x:test> | ||
<XLabel>count</XLabel> | ||
<XValue>{count}</XValue> | ||
<Comment>jsx-xml in react</Comment> | ||
<x:nice before="value" key="66" ref="77" after="value"> | ||
{count} | ||
</x:nice> | ||
</x:test>, | ||
).end({ | ||
headless: true, | ||
prettyPrint: true, | ||
}); | ||
return xml; | ||
} |
Oops, something went wrong.