Examples for Datastar #170
stroiman
started this conversation in
Getting started tips
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Unfortunately, there isn't a good example, how to get started with Datastar.
Gost-DOM has an internal "test app" that a set of pages using Datastar, as well as a set of pages using HTMX. A set of tests verify some of the behaviour provided by these two frameworks. But the purpose of those tests wasn't to serve as an example; their purpose is to help verify that Gost-DOM simulates enough of the browser environment for these two to work.
The tests use the DOM API exposed by Gost-DOM. I strongly recommend against this approach for real-world applications. Tests have a tendency to become tightly coupled to implementation details, like element IDs, etc. - or even trigger developers to add such attributes that don't serve a role in the actual behaviour of the app.
https://github.com/gost-dom/shaman provides an experimental an incomplete query language coupled to accessibility properties.
Project Harmony is an HTMX app, but can be used as inspiration for writing tests expressed in a higher level of abstraction.
There is a task to Create an example Datastar test app. If anyone could provide an example app, I'd be happy to write example test cases.
Beta Was this translation helpful? Give feedback.
All reactions