Skip to content

Files

Latest commit

 

History

History
62 lines (48 loc) · 1.59 KB

deprecations.md

File metadata and controls

62 lines (48 loc) · 1.59 KB

Deprecations

Throughout the development of @kitajs/html, we have made some changes that might affect your codebase.

This document lists all the deprecations and breaking changes that have been made.

Global register

The @kitajs/html/register in favour of the react-jsx target @kitajs/html supports, which automatically registers the JSX runtime globally.

Please update your tsconfig to use the new jsxImportSource option and remove all references to '@kitajs/html/register' from your codebase.

{
  "compilerOptions": {
+   "jsx": "react-jsx",
+   "jsxImportSource": "@kitajs/html",
-   "jsx": "react",
-   "jsxFactory": "Html.createElement",
-   "jsxFragmentFactory": "Html.Fragment",
    "plugins": [{ "name": "@kitajs/ts-html-plugin" }],
  }
}

You can also remove all references to import { Html } from '@kitajs/html' from your codebase.

- import { Html } from '@kitajs/html';

Importing type extensions

Importing type extensions like import '@kitajs/html/htmx' and import '@kitajs/html/alpine' have been deprecated and will be removed in the next major version.

Please change the way you import them to either use /// <reference types="..." /> triple slash directive or the types option in your tsconfig.

- import '@kitajs/html/htmx';
+ /// <reference types="@kitajs/html/htmx" />

Or add them in the types option present in your tsconfig:

{
  "compilerOptions": {
+   "types": ["@kitajs/html/htmx"]
  }
}
docs/html/deprecations.md at main &middot; kitajs/docs · GitHub