Skip to content

Commit 5e8fadb

Browse files
authored
Merge pull request #78 from bholmesdev/changeset-release/main
[ci] release
2 parents 66d140f + 3fa9dc5 commit 5e8fadb

File tree

4 files changed

+3339
-4792
lines changed

4 files changed

+3339
-4792
lines changed

.changeset/rare-trainers-kiss.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/query/CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,59 @@
11
# simple-stack-query
22

3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- [#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.
8+
9+
```astro
10+
<RootElement>
11+
<button data-target="btn">Click me</button>
12+
</RootElement>
13+
14+
<script>
15+
RootElement.ready(($) => {
16+
$('btn').addEventListener('click', () => {
17+
console.log("It's like JQuery but not!");
18+
});
19+
});
20+
</script>
21+
```
22+
23+
- Support multiple instances of the same component. Before, only the first instance would become interactive.
24+
- Enable data passing from the server to your client script using the `data` property.
25+
- 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.
26+
27+
[Visit revamped documentation page](https://simple-stack.dev/query) to learn how to use the new features.
28+
29+
## Migration for v0.1
30+
31+
If you were an early adopter of v0.1, thank you! You'll a few small updates to use the new APIs:
32+
33+
- Wrap any HTML you want to target with the global `RootElement` component.
34+
- Remove the `# simple-stack-query from your `data-target` selector (`data-target={$('btn')}`->`data-target="btn"`). Scoping is now handled automatically.
35+
- 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.
36+
37+
```diff
38+
+ <RootElement>
39+
- <button data=target={$('btn')}>
40+
+ <button data-target="btn">
41+
Click me
42+
</button>
43+
+ </RootElement>
44+
45+
<script>
46+
- $.ready(() => {
47+
+ RootElement.ready(($) => {
48+
$('btn').addEventListener('click', () => {
49+
console.log("It's like JQuery but not!");
50+
});
51+
});
52+
</script>
53+
```
54+
55+
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`.
56+
357
## 0.1.1
458

559
### Patch Changes

packages/query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-stack-query",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Select elements in Astro without the hassle",
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)