Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed @kitajs/htm/register. #287

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/clean-pots-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@kitajs/html': major
---

Removed `@kitajs/htm/register`. Read more
[here](https://github.com/kitajs/html/tree/master/packages/html#removing-global-register)
8 changes: 4 additions & 4 deletions packages/html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
- [How it works](#how-it-works)
- [Serialization table](#serialization-table)
- [Format HTML output](#format-html-output)
- [Deprecating global register](#deprecating-global-register)
- [Removing global register](#removing-global-register)
- [Deprecating importing type extensions](#deprecating-importing-type-extensions)
- [Fork credits](#fork-credits)

Expand Down Expand Up @@ -1018,10 +1018,10 @@ console.log(prettify(html));

<br />

## Deprecating global register
## Removing global register

The `@kitajs/html/register` in favour of the `react-jsx` target `@kitajs/html` supports,
which automatically registers the JSX runtime globally.
The `@kitajs/html/register` was removed 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.
Expand Down
14 changes: 12 additions & 2 deletions packages/html/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function toKebabCase(this: void, camel: string): string;
export function createElement(
this: void,
name: string | Function,
attributes: PropsWithChildren<any> | null,
attributes: PropsWithChildren<unknown> | null,
...contents: Children[]
): JSX.Element;

Expand Down Expand Up @@ -171,4 +171,14 @@ export type Component<T = {}> = (this: void, props: PropsWithChildren<T>) => JSX
* @link https://github.com/kitajs/html
* @link https://www.npmjs.com/package/@kitajs/html
*/
export const Html: Omit<typeof import('.'), 'Html'>;
export declare const Html: Omit<typeof import('.'), 'Html'>;

/**
* Fast and type safe HTML templates using JSX syntax.
*
* @module Html
* @license Apache License Version 2.0
* @link https://github.com/kitajs/html
* @link https://www.npmjs.com/package/@kitajs/html
*/
export as namespace Html;
5 changes: 1 addition & 4 deletions packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
"funding": "https://github.com/kitajs/html?sponsor=1",
"license": "MIT",
"author": "Arthur Fiorette <[email protected]>",
"sideEffects": [
"register.js"
],
"sideEffects": false,
"type": "commonjs",
"exports": {
".": "./index.js",
"./jsx-runtime": "./jsx-runtime.js",
"./jsx-dev-runtime": "./jsx-dev-runtime.js",
"./package.json": "./package.json",
"./suspense": "./suspense.js",
"./register": "./register.js",
"./error-boundary": "./error-boundary.js",
"./*": "./*"
},
Expand Down
12 changes: 0 additions & 12 deletions packages/html/register.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/html/register.js

This file was deleted.

29 changes: 0 additions & 29 deletions packages/html/test/register.test.tsx

This file was deleted.

Loading