Skip to content

Commit

Permalink
4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzzy committed Jan 24, 2021
1 parent 32fff04 commit 9216014
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 58 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.0] - 2021-01-25

- [BREAKING] Drop support for legacy Hyperapp v2.0.0-v2.0.8.
- Add compatibility with Hyperapp [v2.0.9](https://github.com/hyperapp/hyperapp/releases/tag/2.0.9)
after internal VNode schema change.

## [3.5.0] - 2020-11-06

- Compatibility with Hyperapp [v2.0.6](https://github.com/hyperapp/hyperapp/releases/tag/2.0.6)
Expand Down Expand Up @@ -66,7 +72,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Initial public release.

[unreleased]: https://github.com/kriasoft/hyperapp-render/compare/v3.5.0...HEAD
[unreleased]: https://github.com/kriasoft/hyperapp-render/compare/v4.0.0...HEAD
[4.0.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.5.0...v4.0.0
[3.5.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.4.0...v3.5.0
[3.4.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.3.0...v3.4.0
[3.3.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.2.0...v3.3.0
Expand Down
8 changes: 3 additions & 5 deletions dist/hyperapp-render.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/hyperapp-render.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/hyperapp-render.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/hyperapp-render.min.js.map

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "hyperapp-render",
"version": "3.5.0",
"version": "4.0.0",
"description": "Render Hyperapp to an HTML string with SSR and Node.js streaming support",
"repository": "kriasoft/hyperapp-render",
"author": "Vladimir Kutepov",
Expand Down Expand Up @@ -40,29 +40,29 @@
"@types/node": "*"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-react-jsx": "^7.12.5",
"@babel/preset-env": "^7.12.1",
"@babel/register": "^7.12.1",
"@babel/core": "^7.12.10",
"@babel/plugin-transform-react-jsx": "^7.12.12",
"@babel/preset-env": "^7.12.11",
"@babel/register": "^7.12.10",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"babel-jest": "^26.6.3",
"benchr": "^4.3.0",
"eslint": "^7.12.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.15.0",
"eslint": "^7.18.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"fs-extra": "^9.0.1",
"husky": "^4.3.0",
"eslint-plugin-react": "^7.22.0",
"fs-extra": "^9.1.0",
"husky": "^4.3.8",
"hyperapp": "^1.2.10",
"jest": "^26.6.3",
"prettier": "^2.1.2",
"rollup": "^2.33.1",
"prettier": "^2.2.1",
"rollup": "^2.38.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.0.5"
"typescript": "^4.1.3"
},
"scripts": {
"lint": "node tools/lint.js",
Expand Down
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,11 @@ export function renderer(view, state, actions) {
children: node,
footer: '',
})
} else if (node.tag === 3) {
out += escapeHtml(node.type)
} else if (node.type === 3) {
out += escapeHtml(node.name)
out += escapeHtml(node.tag || node.name)
} else if (typeof node === 'object') {
out += renderFragment(
node.name || node.type || node.nodeName,
node.tag || node.nodeName,
node.props || node.attributes,
node.children,
stack,
Expand Down
34 changes: 6 additions & 28 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,45 +449,23 @@ describe('renderToString(view, state, actions)', () => {
expect(html).toBe('<meta/><link/>')
})

it('should support Hyperapp v2.0.0', () => {
it('should support Hyperapp v2.0.9', () => {
const VNode = {
name: 'div',
tag: 'div',
props: {},
children: [
{
name: 'foo bar baz',
props: {},
children: [],
element: null,
key: null,
type: 3,
},
],
element: null,
key: null,
type: 1,
}
const html = renderToString(VNode)
expect(html).toBe('<div>foo bar baz</div>')
})

it('should support Hyperapp v2.0.6', () => {
const VNode = {
type: 'div',
props: {},
children: [
{
type: 'foo bar baz',
tag: 'foo bar baz',
props: {},
key: null,
children: [],
type: 3,
node: null,
key: null,
tag: 3,
},
],
type: 1,
node: null,
key: null,
tag: 1,
}
const html = renderToString(VNode)
expect(html).toBe('<div>foo bar baz</div>')
Expand Down

0 comments on commit 9216014

Please sign in to comment.