preact-render-to-string 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,152 +1,152 @@
1
- {
2
- "name": "preact-render-to-string",
3
- "amdName": "preactRenderToString",
4
- "version": "6.0.0",
5
- "description": "Render JSX to an HTML string, with support for Preact components.",
6
- "main": "dist/index.js",
7
- "umd:main": "dist/index.umd.js",
8
- "module": "dist/index.module.js",
9
- "jsnext:main": "dist/index.module.js",
10
- "types": "src/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "types": "./src/index.d.ts",
14
- "browser": "./dist/index.module.js",
15
- "umd": "./dist/index.umd.js",
16
- "import": "./dist/index.mjs",
17
- "require": "./dist/index.js"
18
- },
19
- "./jsx": {
20
- "types": "./jsx.d.ts",
21
- "browser": "./dist/jsx.module.js",
22
- "umd": "./dist/jsx.umd.js",
23
- "import": "./dist/jsx.mjs",
24
- "require": "./dist/jsx.js"
25
- },
26
- "./package.json": "./package.json"
27
- },
28
- "scripts": {
29
- "bench": "BABEL_ENV=test node -r @babel/register benchmarks index.js",
30
- "bench:v8": "BABEL_ENV=test microbundle benchmarks/index.js -f modern --alias benchmarkjs-pretty=benchmarks/lib/benchmark-lite.js --external none --target node --no-compress --no-sourcemap --raw -o benchmarks/.v8.mjs && v8 --module benchmarks/.v8.mjs",
31
- "build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
32
- "postbuild": "node ./config/node-13-exports.js && node ./config/node-commonjs.js",
33
- "transpile": "microbundle src/index.js -f es,cjs,umd --target web --external preact",
34
- "transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external preact && microbundle dist/jsx.js -o dist/jsx.js -f cjs --external preact",
35
- "copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
36
- "test": "eslint src test && tsc && npm run test:mocha && npm run test:mocha:compat && npm run test:mocha:debug && npm run bench",
37
- "test:mocha": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js test/*.test.js",
38
- "test:mocha:compat": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js 'test/compat/index.test.js'",
39
- "test:mocha:debug": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js 'test/debug/index.test.js'",
40
- "format": "prettier src/**/*.{d.ts,js} test/**/*.js --write",
41
- "prepublishOnly": "npm run build",
42
- "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
43
- },
44
- "keywords": [
45
- "preact",
46
- "render",
47
- "universal",
48
- "isomorphic"
49
- ],
50
- "files": [
51
- "src",
52
- "dist",
53
- "jsx.js",
54
- "typings.json"
55
- ],
56
- "eslintConfig": {
57
- "extends": "developit",
58
- "rules": {
59
- "react/prefer-stateless-function": 0,
60
- "react/jsx-no-bind": 0,
61
- "react/no-danger": 0,
62
- "jest/valid-expect": 0,
63
- "new-cap": 0,
64
- "curly": "off",
65
- "brace-style": "off",
66
- "indent": "off"
67
- },
68
- "settings": {
69
- "react": {
70
- "version": "16.8"
71
- }
72
- }
73
- },
74
- "babel": {
75
- "env": {
76
- "test": {
77
- "presets": [
78
- [
79
- "@babel/preset-env",
80
- {
81
- "targets": {
82
- "node": true
83
- }
84
- }
85
- ]
86
- ],
87
- "plugins": [
88
- [
89
- "@babel/plugin-transform-react-jsx",
90
- {
91
- "pragma": "h"
92
- }
93
- ]
94
- ]
95
- }
96
- }
97
- },
98
- "minify": {
99
- "compress": {
100
- "reduce_funcs": false
101
- }
102
- },
103
- "author": "Jason Miller <jason@developit.ca>",
104
- "license": "MIT",
105
- "repository": "developit/preact-render-to-string",
106
- "bugs": "https://github.com/developit/preact-render-to-string/issues",
107
- "homepage": "https://github.com/developit/preact-render-to-string",
108
- "peerDependencies": {
109
- "preact": ">=10"
110
- },
111
- "devDependencies": {
112
- "@babel/plugin-transform-react-jsx": "^7.12.12",
113
- "@babel/preset-env": "^7.12.11",
114
- "@babel/register": "^7.12.10",
115
- "@changesets/changelog-github": "^0.4.1",
116
- "@changesets/cli": "^2.18.0",
117
- "benchmarkjs-pretty": "^2.0.1",
118
- "chai": "^4.2.0",
119
- "copyfiles": "^2.4.1",
120
- "eslint": "^7.16.0",
121
- "eslint-config-developit": "^1.2.0",
122
- "husky": "^4.3.6",
123
- "lint-staged": "^10.5.3",
124
- "microbundle": "^0.15.1",
125
- "mocha": "^8.2.1",
126
- "baseline-rts": "npm:preact-render-to-string@latest",
127
- "preact": "^10.13.0",
128
- "prettier": "^2.2.1",
129
- "sinon": "^9.2.2",
130
- "sinon-chai": "^3.5.0",
131
- "typescript": "^5.0.0"
132
- },
133
- "dependencies": {
134
- "pretty-format": "^3.8.0"
135
- },
136
- "prettier": {
137
- "singleQuote": true,
138
- "trailingComma": "none",
139
- "useTabs": true,
140
- "tabWidth": 2
141
- },
142
- "lint-staged": {
143
- "**/*.{js,jsx,ts,tsx,yml}": [
144
- "prettier --write"
145
- ]
146
- },
147
- "husky": {
148
- "hooks": {
149
- "pre-commit": "lint-staged"
150
- }
151
- }
152
- }
1
+ {
2
+ "name": "preact-render-to-string",
3
+ "amdName": "preactRenderToString",
4
+ "version": "6.0.2",
5
+ "description": "Render JSX to an HTML string, with support for Preact components.",
6
+ "main": "dist/index.js",
7
+ "umd:main": "dist/index.umd.js",
8
+ "module": "dist/index.module.js",
9
+ "jsnext:main": "dist/index.module.js",
10
+ "types": "src/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./src/index.d.ts",
14
+ "browser": "./dist/index.module.js",
15
+ "umd": "./dist/index.umd.js",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ },
19
+ "./jsx": {
20
+ "types": "./jsx.d.ts",
21
+ "browser": "./dist/jsx.module.js",
22
+ "umd": "./dist/jsx.umd.js",
23
+ "import": "./dist/jsx.mjs",
24
+ "require": "./dist/jsx.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "scripts": {
29
+ "bench": "BABEL_ENV=test node -r @babel/register benchmarks index.js",
30
+ "bench:v8": "BABEL_ENV=test microbundle benchmarks/index.js -f modern --alias benchmarkjs-pretty=benchmarks/lib/benchmark-lite.js --external none --target node --no-compress --no-sourcemap --raw -o benchmarks/.v8.mjs && v8 --module benchmarks/.v8.mjs",
31
+ "build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
32
+ "postbuild": "node ./config/node-13-exports.js && node ./config/node-commonjs.js && node ./config/node-verify-exports.js",
33
+ "transpile": "microbundle src/index.js -f es,cjs,umd --target web --external preact",
34
+ "transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external preact && microbundle dist/jsx.js -o dist/jsx.js -f cjs --external preact",
35
+ "copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
36
+ "test": "eslint src test && tsc && npm run test:mocha && npm run test:mocha:compat && npm run test:mocha:debug && npm run bench",
37
+ "test:mocha": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js test/*.test.js",
38
+ "test:mocha:compat": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js 'test/compat/index.test.js'",
39
+ "test:mocha:debug": "BABEL_ENV=test mocha -r @babel/register -r test/setup.js 'test/debug/index.test.js'",
40
+ "format": "prettier src/**/*.{d.ts,js} test/**/*.js --write",
41
+ "prepublishOnly": "npm run build",
42
+ "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
43
+ },
44
+ "keywords": [
45
+ "preact",
46
+ "render",
47
+ "universal",
48
+ "isomorphic"
49
+ ],
50
+ "files": [
51
+ "src",
52
+ "dist",
53
+ "jsx.js",
54
+ "typings.json"
55
+ ],
56
+ "eslintConfig": {
57
+ "extends": "developit",
58
+ "rules": {
59
+ "react/prefer-stateless-function": 0,
60
+ "react/jsx-no-bind": 0,
61
+ "react/no-danger": 0,
62
+ "jest/valid-expect": 0,
63
+ "new-cap": 0,
64
+ "curly": "off",
65
+ "brace-style": "off",
66
+ "indent": "off"
67
+ },
68
+ "settings": {
69
+ "react": {
70
+ "version": "16.8"
71
+ }
72
+ }
73
+ },
74
+ "babel": {
75
+ "env": {
76
+ "test": {
77
+ "presets": [
78
+ [
79
+ "@babel/preset-env",
80
+ {
81
+ "targets": {
82
+ "node": true
83
+ }
84
+ }
85
+ ]
86
+ ],
87
+ "plugins": [
88
+ [
89
+ "@babel/plugin-transform-react-jsx",
90
+ {
91
+ "pragma": "h"
92
+ }
93
+ ]
94
+ ]
95
+ }
96
+ }
97
+ },
98
+ "minify": {
99
+ "compress": {
100
+ "reduce_funcs": false
101
+ }
102
+ },
103
+ "author": "Jason Miller <jason@developit.ca>",
104
+ "license": "MIT",
105
+ "repository": "developit/preact-render-to-string",
106
+ "bugs": "https://github.com/developit/preact-render-to-string/issues",
107
+ "homepage": "https://github.com/developit/preact-render-to-string",
108
+ "peerDependencies": {
109
+ "preact": ">=10"
110
+ },
111
+ "devDependencies": {
112
+ "@babel/plugin-transform-react-jsx": "^7.12.12",
113
+ "@babel/preset-env": "^7.12.11",
114
+ "@babel/register": "^7.12.10",
115
+ "@changesets/changelog-github": "^0.4.1",
116
+ "@changesets/cli": "^2.18.0",
117
+ "benchmarkjs-pretty": "^2.0.1",
118
+ "chai": "^4.2.0",
119
+ "copyfiles": "^2.4.1",
120
+ "eslint": "^7.16.0",
121
+ "eslint-config-developit": "^1.2.0",
122
+ "husky": "^4.3.6",
123
+ "lint-staged": "^10.5.3",
124
+ "microbundle": "^0.15.1",
125
+ "mocha": "^8.2.1",
126
+ "baseline-rts": "npm:preact-render-to-string@latest",
127
+ "preact": "^10.13.0",
128
+ "prettier": "^2.2.1",
129
+ "sinon": "^9.2.2",
130
+ "sinon-chai": "^3.5.0",
131
+ "typescript": "^5.0.0"
132
+ },
133
+ "dependencies": {
134
+ "pretty-format": "^3.8.0"
135
+ },
136
+ "prettier": {
137
+ "singleQuote": true,
138
+ "trailingComma": "none",
139
+ "useTabs": true,
140
+ "tabWidth": 2
141
+ },
142
+ "lint-staged": {
143
+ "**/*.{js,jsx,ts,tsx,yml}": [
144
+ "prettier --write"
145
+ ]
146
+ },
147
+ "husky": {
148
+ "hooks": {
149
+ "pre-commit": "lint-staged"
150
+ }
151
+ }
152
+ }
package/src/constants.js CHANGED
@@ -1,16 +1,16 @@
1
- // Options hooks
2
- export const DIFF = '__b';
3
- export const RENDER = '__r';
4
- export const DIFFED = 'diffed';
5
- export const COMMIT = '__c';
6
- export const SKIP_EFFECTS = '__s';
7
-
8
- // VNode properties
9
- export const COMPONENT = '__c';
10
- export const CHILDREN = '__k';
11
- export const PARENT = '__';
12
-
13
- // Component properties
14
- export const VNODE = '__v';
15
- export const DIRTY = '__d';
16
- export const NEXT_STATE = '__s';
1
+ // Options hooks
2
+ export const DIFF = '__b';
3
+ export const RENDER = '__r';
4
+ export const DIFFED = 'diffed';
5
+ export const COMMIT = '__c';
6
+ export const SKIP_EFFECTS = '__s';
7
+
8
+ // VNode properties
9
+ export const COMPONENT = '__c';
10
+ export const CHILDREN = '__k';
11
+ export const PARENT = '__';
12
+
13
+ // Component properties
14
+ export const VNODE = '__v';
15
+ export const DIRTY = '__d';
16
+ export const NEXT_STATE = '__s';
package/src/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- import { VNode } from 'preact';
2
-
3
- export default function renderToString(vnode: VNode, context?: any): string;
1
+ import { VNode } from 'preact';
2
+
3
+ export default function renderToString(vnode: VNode, context?: any): string;
4
+
5
+ export function render(vnode: VNode, context?: any): string;
6
+ export function renderToString(vnode: VNode, context?: any): string;
7
+ export function renderToStaticMarkup(vnode: VNode, context?: any): string;