Skip to content

Commit 85fc900

Browse files
committed
Prepare for launch
1 parent a6a35c8 commit 85fc900

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "htm",
3-
"version": "0.5.2",
3+
"version": "1.0.0",
44
"description": "The Tagged Template syntax for Virtual DOM. Only browser-compatible syntax.",
55
"main": "dist/htm.js",
66
"umd:main": "dist/htm.js",
77
"module": "dist/htm.mjs",
88
"scripts": {
99
"build": "npm run -s build:main && npm run -s build:preact && npm run -s build:babel",
1010
"build:main": "microbundle src/index.mjs -f es,umd --no-sourcemap --target web",
11-
"build:preact": "microbundle src/integrations/preact/index.mjs -o preact/index.js -f es,umd --no-sourcemap --target web && cp src/integrations/preact/{index.d.ts,package.json} preact/",
11+
"build:preact": "microbundle src/integrations/preact/index.mjs -o preact/index.js -f es,umd --external preact,htm --no-sourcemap --target web && cp src/integrations/preact/{index.d.ts,package.json} preact/ && npm run -s build:preact:standalone",
12+
"build:preact:standalone": "microbundle src/integrations/preact/standalone.mjs -o preact/standalone.js -f es,umd --no-sourcemap --target web",
1213
"build:babel": "cd packages/babel-plugin-htm && npm run build",
1314
"test": "eslint src/**/*.mjs test && jest test",
1415
"release": "npm run build && git checkout --detach && git add -f babel dist preact && git commit -am \"$npm_package_version\" && git tag $npm_package_version && git push --tags && git checkout master"

src/integrations/preact/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import { h, Component, render as preactRender } from 'preact';
15-
import htm from '../../index.mjs';
15+
import htm from 'htm';
1616

1717
function render(tree, parent) {
1818
preactRender(tree, parent, parent.firstElementChild);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "htm_preact",
33
"module": "index.mjs",
4-
"main": "index.js"
4+
"main": "index.js",
5+
"unpkg": "standalone.js"
56
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright 2018 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
import { h, Component, render as preactRender } from 'preact';
15+
import htm from '../../index.mjs';
16+
17+
function render(tree, parent) {
18+
preactRender(tree, parent, parent.firstElementChild);
19+
}
20+
21+
const html = htm.bind(h);
22+
23+
export { h, html, render, Component };

0 commit comments

Comments
 (0)