Replies: 5 comments 21 replies
-
|
This way I do think we can utilise UI libraries like Pines that are based on Alpine and Tailwind and do not need server-side JS rendering like React libraries. |
Beta Was this translation helpful? Give feedback.
-
|
I totally agree and I am on the same mission! what I am looking into for my own project is using web component libraries, and shoelace looks really nice. also, I have it on my list to tinker with an elementary-based reactive DOM package that runs as WASM in the browser, but that is no small task... |
Beta Was this translation helpful? Give feedback.
-
|
VATHe Stack: Vapor+Alpine+Tailwind+HTMX (fenced area, in which the small cattle is herded together for the night (lol)) (the lowercase "e" stands for "Elementary") |
Beta Was this translation helpful? Give feedback.
-
|
No AlpineElementary? |
Beta Was this translation helpful? Give feedback.
-
|
Alpine is rather simple and is easy to implement in elementary. Here's a snippet: extension HTMLAttribute {
/// A namespace for Alpine.js attributes.
/// See the [Alpine.js docs](https://alpinejs.dev) for more information.
public enum x {}
}
extension HTMLAttribute.x {
@inlinable
public static func data(_ expr: String) -> HTMLAttribute {
.init(name: "x-data", value: expr)
}
@inlinable
public static func bind(_ name: String, _ expr: String) -> HTMLAttribute {
.init(name: "x-bind:\(name)", value: expr)
}
@inlinable
public static func on(_ event: String, _ expr: String) -> HTMLAttribute {
.init(name: "x-on:\(event)", value: expr)
}
@inlinable
public static func text(_ expr: String) -> HTMLAttribute {
.init(name: "x-text", value: expr)
}
@inlinable
public static func html(_ expr: String) -> HTMLAttribute {
.init(name: "x-html", value: expr)
}
@inlinable
public static func model(_ expr: String) -> HTMLAttribute {
.init(name: "x-model", value: expr)
}
@inlinable
public static func modelable(_ expr: String) -> HTMLAttribute {
.init(name: "x-modelable", value: expr)
}
@inlinable
public static func show(_ expr: String) -> HTMLAttribute {
.init(name: "x-show", value: expr)
}
@inlinable
public static func transition(_ expr: String) -> HTMLAttribute {
.init(name: "x-transition", value: expr)
}
@inlinable
public static func `for`(_ expr: String) -> HTMLAttribute {
.init(name: "x-for", value: expr)
}
@inlinable
public static func `if`(_ expr: String) -> HTMLAttribute {
.init(name: "x-if", value: expr)
}
@inlinable
public static func `init`(_ expr: String) -> HTMLAttribute {
.init(name: "x-init", value: expr)
}
@inlinable
public static func effect(_ expr: String) -> HTMLAttribute {
.init(name: "x-effect", value: expr)
}
@inlinable
public static func ref(_ expr: String) -> HTMLAttribute {
.init(name: "x-ref", value: expr)
}
@inlinable
public static func id(_ expr: String) -> HTMLAttribute {
.init(name: "x-id", value: expr)
}
@inlinable
public static func teleport(_ expr: String) -> HTMLAttribute {
.init(name: "x-teleport", value: expr)
}
@inlinable
public static var cloak: HTMLAttribute {
.init(name: "x-cloak", value: nil)
}
@inlinable
public static var ignore: HTMLAttribute {
.init(name: "x-ignore", value: nil)
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I really love the Swift-ish syntax of Elementary and Elementary-HTMX, in my research for the best stack to be used along side Vapor, I found that since HTMX is mostly for talking with server in HTML, but many things do not need this interaction but still many divs need to become reactive and JS-devs made a good solution for it as you may encounter it too, the AlpineJS, it may be big request but it may help the ecosystem to make Vapor+Elementary (with HTMX & AlpineJS) to become more reactive and dynamic web stack.
Beta Was this translation helpful? Give feedback.
All reactions