|
1 | 1 | # ultrahtml
|
2 | 2 |
|
| 3 | +## 1.0.0 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- 95c0f73: `ultrahtml` is a complete markup toolkit with a tiny footprint. Parse, transform, and render HTML on the server, in the browser, with or without a build step. |
| 8 | + |
| 9 | + ## Breaking Changes |
| 10 | + |
| 11 | + The signature of `transform` has been updated. Rather than applying sanitization and component swapping by default, these have been split out to individual `ultrahtml/transformers` that can be applied modularly. |
| 12 | + |
| 13 | + In `[email protected]`, `transform` accepted an options object with `sanitize` and `components`. Other transformations would need to be applied outside of this flow. |
| 14 | + |
| 15 | + ```js |
| 16 | + import { transform } from "ultrahtml"; |
| 17 | + |
| 18 | + await transform(markup, { |
| 19 | + components: { h1: "h2" }, |
| 20 | + sanitize: { allowElements: ["h1", "h2", "h3"] } |
| 21 | + }); |
| 22 | + ``` |
| 23 | + |
| 24 | + In `[email protected]`, `transform` accepts an array of transformers to apply. The `sanitize` and `components` options can be handled with the built-in transformers named `sanitize` and `swap`. |
| 25 | + |
| 26 | + ```js |
| 27 | + import { transform } from "ultrahtml"; |
| 28 | + import swap from "ultrahtml/transformers/swap"; |
| 29 | + import sanitize from "ultrahtml/transformers/sanitize"; |
| 30 | + |
| 31 | + await transform(markup, [ |
| 32 | + swap({ h1: "h2" }), |
| 33 | + sanitize({ allowElements: ["h1", "h2", "h3"] }) |
| 34 | + ]); |
| 35 | + ``` |
| 36 | + |
| 37 | + ## New Features |
| 38 | + |
| 39 | + ### JSX Runtime |
| 40 | + |
| 41 | + `ultrahtml` now comes with `h` and `Fragment` functions for JSX, as well as a `jsx-runtime` export. |
| 42 | + |
| 43 | + ### Tranformers |
| 44 | + |
| 45 | + Transformers are AST transformations that can be applied to any `ultrahtml` Node. Usually these are applied to entire documents. |
| 46 | + |
| 47 | + **New** `inline` transformer inlines CSS from `<style>` blocks directly to matching elements. |
| 48 | + |
| 49 | + **New** `scope` transformer scopes CSS from `<style>` blocks to the elements in a given document or component. |
| 50 | + |
| 51 | +### Patch Changes |
| 52 | + |
| 53 | +- 4699020: Update JSX runtime child handling |
| 54 | +- da119c1: Fix transformer definitions |
| 55 | +- d29a0e2: Add `resolveAsset` option to the `inline` transformer |
| 56 | +- 401b13a: Fix JSX runtime types |
| 57 | +- 44a771e: Update list of void HTML tags |
| 58 | + |
3 | 59 | ## 1.0.0-next.4
|
4 | 60 |
|
5 | 61 | ### Patch Changes
|
|
0 commit comments