Skip to content

Commit

Permalink
Merge pull request #25 from natemoo-re/changeset-release/main
Browse files Browse the repository at this point in the history
[ci] release (next)
  • Loading branch information
natemoo-re authored Oct 17, 2022
2 parents 95c0f73 + 5289204 commit 313c078
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"initialVersions": {
"ultrahtml": "0.3.3"
},
"changesets": []
"changesets": [
"bright-garlics-destroy"
]
}
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 `[email protected]`, `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 `[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`.

```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 `<style>` blocks directly to matching elements.

**New** `scope` transformer scopes CSS from `<style>` blocks to the elements in a given document or component.

## 0.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ultrahtml",
"type": "module",
"version": "0.4.0",
"version": "1.0.0-next.0",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
Expand Down

0 comments on commit 313c078

Please sign in to comment.