Skip to content

Commit

Permalink
Drop Snabbdom versions older than v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-ka committed Nov 11, 2023
1 parent 11e8fbe commit a1a997e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Yet another [JSX](https://facebook.github.io/jsx/) pragma for [Snabbdom](https:/
## Features

- Straightforward and intuitive syntax: `<input type="text" />` rather than `<input props={{ type: 'text' }}>`
- 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
Expand All @@ -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/)

Expand Down Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
Expand All @@ -38,6 +37,6 @@
},
"peerDependencies": {
"csstype": "3",
"snabbdom": "*"
"snabbdom": "3"
}
}
20 changes: 0 additions & 20 deletions polyfills/older-snabbdom.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion polyfills/older-snabbdom.js

This file was deleted.

0 comments on commit a1a997e

Please sign in to comment.