Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

simple-stack-query@0.2.0

Minor Changes

  • #77 f1431d5 Thanks @bholmesdev! - Revamps APIs to fix bugs and unlock a new suite of features.

    <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 for state management.

    Visit revamped documentation page 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.
    + <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.

@vercel
Copy link

vercel bot commented Jul 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simple-stack-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2024 1:42pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants