diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml new file mode 100644 index 0000000..30195d3 --- /dev/null +++ b/.github/workflows/compressed-size.yml @@ -0,0 +1,13 @@ +name: Compressed Size + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: preactjs/compressed-size-action@v2 + with: + pattern: "./{dist,mini,react,preact}/{index.js,index.mjs,htm.js,htm.mjs,standalone.js,standalone.mjs}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0aa1f95..f23f7fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: # Change the condition for ESM Dist Test below when changing this. - node-version: [10.x, 12.x, 14.x] + node-version: [12.x, 14.x] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/README.md b/README.md index aceab95..6763017 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ It's a single HTML file, and there's no build or tooling. You can edit it with n <${Header} name="ToDo's (${page})" /> diff --git a/package.json b/package.json index 3937d25..4a048e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "htm", - "version": "3.0.4", + "version": "3.1.1", "description": "The Tagged Template syntax for Virtual DOM. Only browser-compatible syntax.", "main": "dist/htm.js", "umd:main": "dist/htm.umd.js", @@ -8,35 +8,40 @@ "types": "dist/htm.d.ts", "exports": { ".": { - "import": "./dist/htm.mjs", - "require": "./dist/htm.js", + "types": "./dist/htm.d.ts", "browser": "./dist/htm.module.js", - "umd": "./dist/htm.umd.js" + "umd": "./dist/htm.umd.js", + "import": "./dist/htm.mjs", + "require": "./dist/htm.js" }, "./": "./", "./preact": { - "import": "./preact/index.mjs", - "require": "./preact/index.js", + "types": "./preact/index.d.ts", "browser": "./preact/index.module.js", - "umd": "./preact/index.umd.js" + "umd": "./preact/index.umd.js", + "import": "./preact/index.mjs", + "require": "./preact/index.js" }, "./preact/standalone": { - "import": "./preact/standalone.mjs", - "require": "./preact/standalone.js", + "types": "./preact/index.d.ts", "browser": "./preact/standalone.module.js", - "umd": "./preact/standalone.umd.js" + "umd": "./preact/standalone.umd.js", + "import": "./preact/standalone.mjs", + "require": "./preact/standalone.js" }, "./react": { - "import": "./react/index.mjs", - "require": "./react/index.js", + "types": "./react/index.d.ts", "browser": "./react/index.module.js", - "umd": "./react/index.umd.js" + "umd": "./react/index.umd.js", + "import": "./react/index.mjs", + "require": "./react/index.js" }, "./mini": { - "import": "./mini/index.mjs", - "require": "./mini/index.js", + "types": "./mini/index.d.ts", "browser": "./mini/index.module.js", - "umd": "./mini/index.umd.js" + "umd": "./mini/index.umd.js", + "import": "./mini/index.mjs", + "require": "./mini/index.js" } }, "scripts": { diff --git a/packages/babel-plugin-htm/README.md b/packages/babel-plugin-htm/README.md index ef27e75..a2bb474 100644 --- a/packages/babel-plugin-htm/README.md +++ b/packages/babel-plugin-htm/README.md @@ -60,7 +60,7 @@ With Babel config: "plugins": [ ["babel-plugin-htm", { "tag": "$$html", - "import": "preact" + "import": "htm/preact" }] ] ``` diff --git a/packages/babel-plugin-transform-jsx-to-htm/package.json b/packages/babel-plugin-transform-jsx-to-htm/package.json index f3f43ee..ed51f00 100644 --- a/packages/babel-plugin-transform-jsx-to-htm/package.json +++ b/packages/babel-plugin-transform-jsx-to-htm/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-htm", - "version": "2.0.0", + "version": "2.2.0", "description": "Babel plugin to compile JSX to Tagged Templates.", "main": "dist/babel-plugin-transform-jsx-to-htm.js", "scripts": { diff --git a/src/integrations/preact/standalone.mjs b/src/integrations/preact/standalone.mjs index e78dfb0..0ceb223 100644 --- a/src/integrations/preact/standalone.mjs +++ b/src/integrations/preact/standalone.mjs @@ -11,10 +11,10 @@ * limitations under the License. */ -import { h, Component, createContext, render } from 'preact'; +import { h, Component, createContext, createRef, render } from 'preact'; import { useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary } from 'preact/hooks'; import htm from '../../index.mjs'; const html = htm.bind(h); -export { h, html, render, Component, createContext, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary }; +export { h, html, render, Component, createContext, createRef, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary };