-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
1 parent
2e1c08c
commit 637b302
Showing
8 changed files
with
70 additions
and
20 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 @@ | ||
--- | ||
'preact-render-to-string': patch | ||
--- | ||
|
||
Bring back exports from 5.x to make migration easier |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const path = require('path'); | ||
const assert = require('assert/strict'); | ||
|
||
const filePath = (file) => path.join(process.cwd(), 'dist', file); | ||
|
||
// Main CJS | ||
const mainCjs = require(filePath('index.js')); | ||
assert(typeof mainCjs === 'function'); | ||
assert(typeof mainCjs.renderToString === 'function'); | ||
assert(typeof mainCjs.renderToStaticMarkup === 'function'); | ||
assert(typeof mainCjs.render === 'function'); | ||
|
||
// Main ESM | ||
(async () => { | ||
const mainESM = await import(filePath('index.mjs')); | ||
assert(typeof mainESM.default === 'function'); | ||
assert(typeof mainESM.renderToString === 'function'); | ||
assert(typeof mainESM.renderToStaticMarkup === 'function'); | ||
assert(typeof mainESM.render === 'function'); | ||
})(); | ||
|
||
// JSX CJS | ||
const jsxCjs = require(filePath('jsx.js')); | ||
assert(typeof jsxCjs === 'function'); | ||
assert(typeof jsxCjs.render === 'function'); | ||
assert(typeof jsxCjs.shallowRender === 'function'); | ||
|
||
// JSX ESM | ||
(async () => { | ||
const jsxESM = await import(filePath('jsx.mjs')); | ||
assert(typeof jsxESM.default === 'function'); | ||
assert(typeof jsxESM.render === 'function'); | ||
assert(typeof jsxESM.shallowRender === 'function'); | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { VNode } from 'preact'; | ||
|
||
export default function renderToString(vnode: VNode, context?: any): string; | ||
|
||
export function render(vnode: VNode, context?: any): string; | ||
export function renderToString(vnode: VNode, context?: any): string; | ||
export function renderToStaticMarkup(vnode: VNode, context?: any): string; |
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