Skip to content

Commit

Permalink
[ci] release (next) (#181)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Oct 6, 2022
1 parent bdf8467 commit c52862e
Show file tree
Hide file tree
Showing 3 changed files with 66 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": {
"corset": "2.4.0"
},
"changesets": []
"changesets": [
"stupid-beds-draw"
]
}
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# corset

## 2.5.0-next.0

### Minor Changes

- 38ff738: Allow specifying an alternative event target with event-target

This now allows specifying an alternative event target via the new `event-target` property. You can use it like this:

```js
import sheet, { mount } from "https://cdn.corset.dev/v2";

mount(
document,
class {
onpopstate(ev) {
console.log(
`location: ${document.location}, state: ${JSON.stringify(
event.state
)}`
);
}
bind() {
return sheet`
#app {
event: popstate ${this.onpopstate};
event-target: popstate ${window};
}
`;
}
}
);
```

In the above we are able to use a selector to listen to the [popstate](https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event) event that is on the window object.

This can also be used with any object that follows the [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) interface:

```js
import sheet, { mount } from "https://cdn.corset.dev/v2";
let target = new EventTarget();
// Now this can be shared around
mount(
document,
class {
bind() {
return sheet`
#app {
event: foo ${() => console.log("foo event occurred!")};
event-target: foo ${target};
}

some-custom-element {
prop: events ${target};
}
`;
}
}
);
```

## 2.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,6 +1,6 @@
{
"name": "corset",
"version": "2.4.0",
"version": "2.5.0-next.0",
"description": "Declarative DOM binding, without the complexity of JSX/templates.",
"type": "module",
"main": "./lib/main.js",
Expand Down

0 comments on commit c52862e

Please sign in to comment.