diff --git a/README.md b/README.md
index f87c7b48..306746dd 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Works in Node & the browser, making it useful for universal/isomorphic rendering
### Render JSX/VDOM to HTML
```js
-import render from 'preact-render-to-string';
+import { render } from 'preact-render-to-string';
import { h } from 'preact';
/** @jsx h */
@@ -31,7 +31,7 @@ console.log(html);
### Render Preact Components to HTML
```js
-import render from 'preact-render-to-string';
+import { render } from 'preact-render-to-string';
import { h, Component } from 'preact';
/** @jsx h */
@@ -66,7 +66,7 @@ console.log(html);
```js
import express from 'express';
import { h } from 'preact';
-import render from 'preact-render-to-string';
+import { render } from 'preact-render-to-string';
/** @jsx h */
// silly example component:
@@ -92,8 +92,30 @@ app.get('/:fox', (req, res) => {
---
+## Migration guide
-### License
+### Migrating from 5.x to 6.x
+
+The only breaking change introduced with the `6.x` is that the `default` exports have been removed in favor of named exports. To update, replace the default import in your code with a named one.
+
+```diff
+- import render from 'preact-render-to-string';
++ import { render } from 'preact-render-to-string';
+```
+
+Similarily if you've been using the `jsx` renderer, the default import needs to be swapped with a named import:
+
+```diff
+- import render from 'preact-render-to-string/jsx';
++ import { render } from 'preact-render-to-string/jsx';
+```
+
+_Note: The named exports were already present in the `5.x` release line. So if you can't update today for any reason, you can apply the above changes safely to make a future update to `6.x` easier!_
+
+---
+
+
+## License
[MIT]
diff --git a/benchmarks/index.js b/benchmarks/index.js
index 323fe511..f93139ab 100644
--- a/benchmarks/index.js
+++ b/benchmarks/index.js
@@ -1,6 +1,6 @@
import { h } from 'preact';
import Suite from 'benchmarkjs-pretty';
-import renderToString from '../src/index';
+import { renderToString } from '../src/index';
import TextApp from './text';
// import StackApp from './stack';
import { App as IsomorphicSearchResults } from './isomorphic-ui-search-results';
diff --git a/config/node-commonjs.js b/config/node-commonjs.js
deleted file mode 100644
index 9dacbdc4..00000000
--- a/config/node-commonjs.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const fs = require('fs');
-const path = require('path');
-
-// This file will only export default exports in commonjs bundles
-// instead of guarding them behind a `.default` property.
-
-const filePath = (file) => path.join(process.cwd(), 'dist', file);
-
-// Main entry
-fs.copyFileSync(filePath('index.js'), filePath('commonjs.js'));
-fs.copyFileSync(filePath('index.js.map'), filePath('commonjs.js.map'));
-
-const source = `module.exports = require('./commonjs').default;`;
-fs.writeFileSync(filePath('index.js'), source, 'utf-8');
-
-// JSX entry
-fs.copyFileSync(filePath('jsx.js'), filePath('jsx-entry.js'));
-fs.copyFileSync(filePath('jsx.js.map'), filePath('jsx-entry.js.map'));
-
-const sourceJsx = `module.exports = require('./jsx-entry').default;`;
-fs.writeFileSync(filePath('jsx.js'), sourceJsx, 'utf-8');
diff --git a/jsx.d.ts b/jsx.d.ts
index ee2ba580..9b9d0c63 100644
--- a/jsx.d.ts
+++ b/jsx.d.ts
@@ -1,13 +1,12 @@
import { VNode } from 'preact';
interface Options {
- jsx?: boolean;
- xml?: boolean;
- functions?: boolean
- functionNames?: boolean,
- skipFalseAttributes?: boolean
- pretty?: boolean | string;
+ jsx?: boolean;
+ xml?: boolean;
+ functions?: boolean;
+ functionNames?: boolean;
+ skipFalseAttributes?: boolean;
+ pretty?: boolean | string;
}
-export function render(vnode: VNode, context?: any, options?: Options):string;
-export default render;
+export function render(vnode: VNode, context?: any, options?: Options): string;
diff --git a/package.json b/package.json
index 2fa68f0e..4ae9dcfb 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"scripts": {
"bench": "node -r @babel/register benchmarks index.js",
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
- "postbuild": "node ./config/node-13-exports.js && node ./config/node-commonjs.js",
+ "postbuild": "node ./config/node-13-exports.js",
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
"transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs",
"copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
diff --git a/src/index.d.ts b/src/index.d.ts
index 221d349a..fd655e64 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -6,11 +6,10 @@ interface Options {
pretty?: boolean | string;
}
-export function render(vnode: VNode, context?: any, options?: Options): string;
export function renderToString(
vnode: VNode,
context?: any,
options?: Options
): string;
+export const render: typeof renderToString;
export function shallowRender(vnode: VNode, context?: any): string;
-export default render;
diff --git a/src/index.js b/src/index.js
index e92cf1c0..06b5934a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -19,19 +19,6 @@ const UNSAFE_NAME = /[\s\n\\/='"\0<>]/;
const noop = () => {};
-/** Render Preact JSX + Components to an HTML string.
- * @name render
- * @function
- * @param {VNode} vnode JSX VNode to render.
- * @param {Object} [context={}] Optionally pass an initial context object through the render path.
- * @param {Object} [options={}] Rendering options
- * @param {Boolean} [options.shallow=false] If `true`, renders nested Components as HTML elements (`