Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .changeset/rare-trainers-kiss.md

This file was deleted.

54 changes: 54 additions & 0 deletions packages/query/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# simple-stack-query

## 0.2.0

### Minor Changes

- [#77](https://github.com/bholmesdev/simple-stack/pull/77) [`f1431d5`](https://github.com/bholmesdev/simple-stack/commit/f1431d56e6a25b8854b749614e5d8af865e33c82) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Revamps APIs to fix bugs and unlock a new suite of features.

```astro
<RootElement>
<button data-target="btn">Click me</button>
</RootElement>

<script>
RootElement.ready(($) => {
$('btn').addEventListener('click', () => {
console.log("It's like JQuery but not!");
});
});
</script>
```

- Support multiple instances of the same component. Before, only the first instance would become interactive.
- Enable data passing from the server to your client script using the `data` property.
- Add an `effect()` utility to interact with the [Signal polyfill](https://github.com/proposal-signals/signal-polyfill?tab=readme-ov-file#creating-a-simple-effect) for state management.

[Visit revamped documentation page](https://simple-stack.dev/query) to learn how to use the new features.

## Migration for v0.1

If you were an early adopter of v0.1, thank you! You'll a few small updates to use the new APIs:

- Wrap any HTML you want to target with the global `RootElement` component.
- Remove the `# simple-stack-query from your `data-target` selector (`data-target={$('btn')}`->`data-target="btn"`). Scoping is now handled automatically.
- Change `$.ready()` to `RootElement.ready()`, and retrieve the `# simple-stack-query selector from the first function argument. The `# simple-stack-query selector is no longer a global.

```diff
+ <RootElement>
- <button data=target={$('btn')}>
+ <button data-target="btn">
Click me
</button>
+ </RootElement>

<script>
- $.ready(() => {
+ RootElement.ready(($) => {
$('btn').addEventListener('click', () => {
console.log("It's like JQuery but not!");
});
});
</script>
```

Since the syntax for `data-target` is now simpler, we have also **removed the VS Code snippets prompt.** We recommend deleting the snippets file created by v0.1: `.vscode/simple-query.code-snippets`.

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-stack-query",
"version": "0.1.1",
"version": "0.2.0",
"description": "Select elements in Astro without the hassle",
"type": "module",
"scripts": {
Expand Down
Loading