From 5289204c3f5e5e7cbee1001a0f8b5845cd79bc64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Oct 2022 12:57:49 +0000 Subject: [PATCH] [ci] release (next) --- .changeset/pre.json | 4 +++- CHANGELOG.md | 48 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 8da1470..bcea32c 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -4,5 +4,7 @@ "initialVersions": { "ultrahtml": "0.3.3" }, - "changesets": [] + "changesets": [ + "bright-garlics-destroy" + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index db4d4cc..0df7714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # ultrahtml +## 1.0.0-next.0 + +### Major Changes + +- 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. + + ## Breaking Changes + + 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. + + In `ultrahtml@0.x`, `transform` accepted an options object with `sanitize` and `components`. Other transformations would need to be applied outside of this flow. + + ```js + import { transform } from "ultrahtml"; + + await transform(markup, { + components: { h1: "h2" }, + sanitize: { allowElements: ["h1", "h2", "h3"] } + }); + ``` + + In `ultrahtml@1.x`, `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`. + + ```js + import { transform } from "ultrahtml"; + import swap from "ultrahtml/transformers/swap"; + import sanitize from "ultrahtml/transformers/sanitize"; + + await transform(markup, [ + swap({ h1: "h2" }), + sanitize({ allowElements: ["h1", "h2", "h3"] }) + ]); + ``` + + ## New Features + + ### JSX Runtime + + `ultrahtml` now comes with `h` and `Fragment` functions for JSX, as well as a `jsx-runtime` export. + + ### Tranformers + + Transformers are AST transformations that can be applied to any `ultrahtml` Node. Usually these are applied to entire documents. + + **New** `inline` transformer inlines CSS from `