diff --git a/README.md b/README.md index 0c3e0b5..f4f8bde 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Yet another [JSX](https://facebook.github.io/jsx/) pragma for [Snabbdom](https:/ ## Features - Straightforward and intuitive syntax: `` rather than `` -- Supports recent major versions of Snabbdom - Attributes on intrinsic elements are typechecked (only for HTML elements for now) - `className` and `id` will be the part of the `sel` - Type-safe custom modules via module augmentation @@ -31,7 +30,7 @@ Note that the following packages are peer dependencies of this library, which ne | Package | Version | | ---------------------------------------------------- | ------- | | [`csstype`](https://www.npmjs.com/package/csstype) | `3` | -| [`snabbdom`](https://www.npmjs.com/package/snabbdom) | `*` | +| [`snabbdom`](https://www.npmjs.com/package/snabbdom) | `3` | ### With [npm](https://www.npmjs.com/) @@ -108,14 +107,6 @@ Make sure you are using TypeScript v4.1+ and add the following options to your ` Then the `jsx` and the `jsxs` functions will automatically be imported. -#### Using with older versions of Snabbdom - -If you are using Snabbdom older than v3, you also need to import the polyfill that provides the compatible type information. Add the following import statement to the entry point. - -```ts -import '@herp-inc/snabbdom-jsx/polyfills/older-snabbdom'; -``` - ### With [Babel](https://babeljs.io/) Add [`@babel/plugin-transform-react-jsx`](https://www.npmjs.com/package/@babel/plugin-transform-react-jsx) to your `devDependencies`. diff --git a/default.nix b/default.nix index ba9d65d..aea9aa1 100644 --- a/default.nix +++ b/default.nix @@ -18,7 +18,7 @@ pkgs.stdenv.mkDerivation rec { buildPhase='' HOME=$TMP yarn install --frozen-lockfile yarn tsc --project ./tsconfig.build.json - cp -r jsx-runtime.d.ts jsx-runtime.js package.json polyfills README.md ./dist + cp -r jsx-runtime.d.ts jsx-runtime.js package.json README.md ./dist cd ./dist yarn pack cd .. diff --git a/package.json b/package.json index 9ee1201..702facd 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,7 @@ "typings": "index.d.ts", "exports": { ".": "./index.js", - "./jsx-runtime": "./jsx-runtime.js", - "./polyfills/older-snabbdom": "./polyfills/older-snabbdom.js" + "./jsx-runtime": "./jsx-runtime.js" }, "sideEffects": false, "author": "HERP, Inc. dev team ", @@ -38,6 +37,6 @@ }, "peerDependencies": { "csstype": "3", - "snabbdom": "*" + "snabbdom": "3" } } diff --git a/polyfills/older-snabbdom.d.ts b/polyfills/older-snabbdom.d.ts deleted file mode 100644 index c89c996..0000000 --- a/polyfills/older-snabbdom.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Hooks as _Hooks } from 'snabbdom/hooks'; -import type { Attrs as _Attrs } from 'snabbdom/modules/attributes'; -import type { Classes as _Classes } from 'snabbdom/modules/class'; -import type { Dataset as _Dataset } from 'snabbdom/modules/dataset'; -import type { On as _On } from 'snabbdom/modules/eventlisteners'; -import type { Props as _Props } from 'snabbdom/modules/props'; -import type { VNodeStyle as _VNodeStyle } from 'snabbdom/modules/style'; -import type { Key as _Key, VNode as _VNode } from 'snabbdom/vnode'; - -declare module 'snabbdom' { - export type Attrs = _Attrs; - export type Classes = _Classes; - export type Hooks = _Hooks; - export type Key = _Key; - export type Dataset = _Dataset; - export type On = _On; - export type Props = _Props; - export type VNodeStyle = _VNodeStyle; - export type VNode = _VNode; -} diff --git a/polyfills/older-snabbdom.js b/polyfills/older-snabbdom.js deleted file mode 100644 index cb0ff5c..0000000 --- a/polyfills/older-snabbdom.js +++ /dev/null @@ -1 +0,0 @@ -export {};