@public-ui/hydrate 2.0.0-rc.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -4
- package/dist/index.js +13416 -13938
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
# Hydrate-Adapter
|
|
1
|
+
# KoliBri - Hydrate-Adapter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Motivation
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Provide an adapter for Server Side Rendering of KoliBri components.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
⚠️ Hydrate support is currently considered experimental.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
You can install the adapter with `npm`, `pnpm` or `yarn`:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -g @public-ui/hydrate
|
|
15
|
+
pnpm i -g @public-ui/hydrate
|
|
16
|
+
yarn add -g @public-ui/hydrate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Call the `renderToString` method and pass it an HTML string containing KoliBri component tags. The method will return a
|
|
22
|
+
Promise that resolves with an object containing the hydrated HTML.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { renderToString } from '@public-ui/hydrate';
|
|
26
|
+
|
|
27
|
+
const inputHtml = `<kol-button _label="Hello World"_></kol-button>`;
|
|
28
|
+
const { html } = await renderToString(inputHtml);
|
|
29
|
+
```
|