0.13.2 • Published 2 days ago

@sudodevnull/datastar v0.13.2

Weekly downloads
-
License
-
Repository
github
Last release
2 days ago

Datastar

https://data-star.dev

Star History Chart

Typescript library for making hypermedia systems using little to no Javascript code. The Typescript may be important to the datastar dev but its just a normal JS file to the browser. The goal is to make it easy to create realtime web apps with as little Javascript as possible. This is done by using HTML attributes to define the behavior of the page. This is similar to Alpine.js + HTMX but with a few key differences.

It's just normal HTML data attributes that get watched by plugins and build up a context object. The current plugins work off of signals to make everything reactive and allow very fast interactions in very little code.

Size

Community

Lives as a channel in the EventGraph Discord server. Feel free to join and ask questions. npm.io #datastar channel

Features

Pros

  • Built with reactive applications in mind, not just pages.
  • 💯 strict Typescript with full tree shaking support
  • 📦 0 dependencies
  • The best parts of Alpine.js and HTMX but created in a unique way to allow for a more declarative approach
  • 💯 HTML compliant
  • Fine grain reactivity
  • Using Vite for development and Rollup for production builds.
  • Everything is an plugin so you can add and remove features as needed
  • HOWL stack ready with Go specific tooling coming soon
  • Even with all plugins its very small (see badge above)
  • Faster than Alpine.js VDOM reactivity and HTMX needs Hyperscript or Alpine to work on most real world projects
  • DHH would hate it

Cons

  • No progressive enhancement, you need Javascript enabled. Datastar is for making realtime web apps like dashboards, admin panels, etc. If you need progressive enhancement use Alpine-Ajax or HTMX and stick to just <a/> and <form/> tags. Scripting is a first class citizen in hypermedia systems.
  • Modern browsers only (no IE11 support)
  • Have to use custom attributes (data-*) so slightly more verbose but spec compliant always
  • Have to use SSE if you use the defaults. I little more upfront but allows for faster updates and less code.
  • No book, but most of hypermedia concepts will port directly over.

Why not just use Vue/React/Svelte?

HTMX Essays are a great place to start.

Why not just use HTMX+Alpine?

I think HTMX is great and I will continue to recommend it for splashes of contents. In general Datastar is geared towards more complex reactive applications, especially in a realtime context.

0.13.2

2 days ago

0.13.0

5 days ago

0.13.1

4 days ago

0.12.7

7 days ago

0.12.4

7 days ago

0.12.5

7 days ago

0.12.6

7 days ago

0.12.3

28 days ago

0.12.2

30 days ago

0.12.1

1 month ago

0.12.0

1 month ago

0.11.5

1 month ago

0.11.4

1 month ago

0.11.2

1 month ago

0.11.3

1 month ago

0.11.0

1 month ago

0.11.1

1 month ago

0.10.0

2 months ago

0.9.0

2 months ago

0.8.5

2 months ago

0.8.4

2 months ago

0.8.3

2 months ago

0.8.2

2 months ago

0.8.0

2 months ago

0.7.0

3 months ago

0.5.8

5 months ago

0.5.7

5 months ago

0.6.0

5 months ago

0.5.4

5 months ago

0.5.6

5 months ago

0.5.5

5 months ago

0.5.3

5 months ago

0.5.2

5 months ago

0.5.0

6 months ago

0.5.1

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.4.2

6 months ago

0.3.10

6 months ago

0.3.8

6 months ago

0.3.7

6 months ago

0.3.6

6 months ago

0.3.4

6 months ago

0.3.3

6 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.15

7 months ago

0.1.14

7 months ago

0.1.13

7 months ago

0.1.12

7 months ago

0.1.11

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago