Skip to content

Commit 9216014

Browse files
committed
4.0.0
1 parent 32fff04 commit 9216014

File tree

8 files changed

+39
-58
lines changed

8 files changed

+39
-58
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [4.0.0] - 2021-01-25
9+
10+
- [BREAKING] Drop support for legacy Hyperapp v2.0.0-v2.0.8.
11+
- Add compatibility with Hyperapp [v2.0.9](https://github.com/hyperapp/hyperapp/releases/tag/2.0.9)
12+
after internal VNode schema change.
13+
814
## [3.5.0] - 2020-11-06
915

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

6773
- Initial public release.
6874

69-
[unreleased]: https://github.com/kriasoft/hyperapp-render/compare/v3.5.0...HEAD
75+
[unreleased]: https://github.com/kriasoft/hyperapp-render/compare/v4.0.0...HEAD
76+
[4.0.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.5.0...v4.0.0
7077
[3.5.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.4.0...v3.5.0
7178
[3.4.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.3.0...v3.4.0
7279
[3.3.0]: https://github.com/kriasoft/hyperapp-render/compare/v3.2.0...v3.3.0

dist/hyperapp-render.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-render.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-render.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-render.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "hyperapp-render",
4-
"version": "3.5.0",
4+
"version": "4.0.0",
55
"description": "Render Hyperapp to an HTML string with SSR and Node.js streaming support",
66
"repository": "kriasoft/hyperapp-render",
77
"author": "Vladimir Kutepov",
@@ -40,29 +40,29 @@
4040
"@types/node": "*"
4141
},
4242
"devDependencies": {
43-
"@babel/core": "^7.12.3",
44-
"@babel/plugin-transform-react-jsx": "^7.12.5",
45-
"@babel/preset-env": "^7.12.1",
46-
"@babel/register": "^7.12.1",
43+
"@babel/core": "^7.12.10",
44+
"@babel/plugin-transform-react-jsx": "^7.12.12",
45+
"@babel/preset-env": "^7.12.11",
46+
"@babel/register": "^7.12.10",
47+
"@rollup/plugin-commonjs": "^17.0.0",
48+
"@rollup/plugin-node-resolve": "^11.1.0",
4749
"babel-jest": "^26.6.3",
4850
"benchr": "^4.3.0",
49-
"eslint": "^7.12.1",
50-
"eslint-config-airbnb": "^18.2.0",
51-
"eslint-config-prettier": "^6.15.0",
51+
"eslint": "^7.18.0",
52+
"eslint-config-airbnb": "^18.2.1",
53+
"eslint-config-prettier": "^7.2.0",
5254
"eslint-plugin-import": "^2.22.1",
5355
"eslint-plugin-jsx-a11y": "^6.4.1",
54-
"eslint-plugin-react": "^7.21.5",
55-
"fs-extra": "^9.0.1",
56-
"husky": "^4.3.0",
56+
"eslint-plugin-react": "^7.22.0",
57+
"fs-extra": "^9.1.0",
58+
"husky": "^4.3.8",
5759
"hyperapp": "^1.2.10",
5860
"jest": "^26.6.3",
59-
"prettier": "^2.1.2",
60-
"rollup": "^2.33.1",
61+
"prettier": "^2.2.1",
62+
"rollup": "^2.38.0",
6163
"rollup-plugin-babel": "^4.4.0",
62-
"rollup-plugin-commonjs": "^10.1.0",
63-
"rollup-plugin-node-resolve": "^5.2.0",
6464
"rollup-plugin-terser": "^7.0.2",
65-
"typescript": "^4.0.5"
65+
"typescript": "^4.1.3"
6666
},
6767
"scripts": {
6868
"lint": "node tools/lint.js",

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,11 @@ export function renderer(view, state, actions) {
250250
children: node,
251251
footer: '',
252252
})
253-
} else if (node.tag === 3) {
254-
out += escapeHtml(node.type)
255253
} else if (node.type === 3) {
256-
out += escapeHtml(node.name)
254+
out += escapeHtml(node.tag || node.name)
257255
} else if (typeof node === 'object') {
258256
out += renderFragment(
259-
node.name || node.type || node.nodeName,
257+
node.tag || node.nodeName,
260258
node.props || node.attributes,
261259
node.children,
262260
stack,

test/index.test.js

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -449,45 +449,23 @@ describe('renderToString(view, state, actions)', () => {
449449
expect(html).toBe('<meta/><link/>')
450450
})
451451

452-
it('should support Hyperapp v2.0.0', () => {
452+
it('should support Hyperapp v2.0.9', () => {
453453
const VNode = {
454-
name: 'div',
454+
tag: 'div',
455455
props: {},
456-
children: [
457-
{
458-
name: 'foo bar baz',
459-
props: {},
460-
children: [],
461-
element: null,
462-
key: null,
463-
type: 3,
464-
},
465-
],
466-
element: null,
467456
key: null,
468-
type: 1,
469-
}
470-
const html = renderToString(VNode)
471-
expect(html).toBe('<div>foo bar baz</div>')
472-
})
473-
474-
it('should support Hyperapp v2.0.6', () => {
475-
const VNode = {
476-
type: 'div',
477-
props: {},
478457
children: [
479458
{
480-
type: 'foo bar baz',
459+
tag: 'foo bar baz',
481460
props: {},
461+
key: null,
482462
children: [],
463+
type: 3,
483464
node: null,
484-
key: null,
485-
tag: 3,
486465
},
487466
],
467+
type: 1,
488468
node: null,
489-
key: null,
490-
tag: 1,
491469
}
492470
const html = renderToString(VNode)
493471
expect(html).toBe('<div>foo bar baz</div>')

0 commit comments

Comments
 (0)