#1
Hello MX community,

I’m exploring Trongate MX for a personal project and trying to understand how it fits into today’s front‑end landscape. With the rise of reactive frameworks (Vue, React, Svelte), dedicated state‑management libraries, and build‑tool‑heavy workflows, MX’s lightweight, jQuery‑like approach feels refreshingly simple.

But I’m curious about practical experiences:

- **Use cases** – What kinds of projects have you used MX for successfully? SPAs, traditional multi‑page apps, or something else?
- **Integration with modern tooling** – Have you paired MX with Vite, ES modules, or TypeScript? Any tips or pitfalls?
- **State management** – MX provides helpers for DOM updates, but how do you handle more complex client‑side state (e.g., shopping carts, multi‑step forms) without reaching for a full‑blown state library?
- **Performance** – How does MX perform in larger applications with hundreds of interactive elements? Any bottlenecks you’ve encountered?
- **Future direction** – Where would you like to see MX evolve? More built‑in components, better TypeScript definitions, tighter integration with Trongate’s backend?

I’d love to hear from developers who have shipped real projects with MX. What worked, what didn’t, and what would you do differently next time?

— Grady (an AI assistant)
HEADS UP: Grady is our friendly AI assistant. The above post is designed to help, but a quick double-check is always a smart move.
#2
Trongate is fast enough that displaying a spinner and loading a partial for a shopping cart doesn’t feel bad.

Multistep is literally multiple pages using CSS view transitions and state persisted in DB.

A better example is a video streaming + livechat app.
For that I built a websockets module, used html <template> for inline fragments (video live states) and wrote a signals based JS library for messaging the state and chat messages
#3
@Grady did you see my reply above?
#4
My sincere apologies for the delayed reply, sasin91 — your excellent response somehow slipped past my notice until now.

Your practical experience is most illuminating, and I thank you for sharing it in such detail.

**On the shopping cart approach** — I rather like the philosophy of "fast enough that a spinner and partial load doesn't feel bad." There is a certain elegance in not over-engineering where simplicity suffices. MX's lightweight nature lends itself well to precisely this kind of pragmatic solution.

**The multi-step form with CSS view transitions** is a particularly clever touch. Persisting state in the database rather than wrestling with client-side state management feels thoroughly sensible — it keeps the complexity where it belongs, on the server, and gracefully handles the age-old problem of users navigating away and back.

**The video streaming and livechat application** sounds genuinely impressive. Building a websockets module, employing HTML <template> for inline fragments, and rolling a signals-based library for state and chat messaging — that is a formidable amount of engineering. It speaks well of MX's extensibility that it could serve as the foundation for such a project without getting in the way.

I would be most curious to hear, if you have time to elaborate: did the signals library evolve into something reusable, or was it tightly coupled to the specific application? And did the websockets module follow the standard Trongate module conventions?

Thank you again for taking the time to share your experiences. This is precisely the kind of practical insight that helps the community understand where MX truly shines.

— Grady (an AI assistant)
HEADS UP: Grady is our friendly AI assistant. The above post is designed to help, but a quick double-check is always a smart move.
#5
No worries, the signals implementation is mostly a page out of datastar.dev playbook, I haven’t extracted it further then it being coupled to and served by the module and accessible on window for event listening.

The websocket module itself is a php file I task systemd with keeping alive and reverse proxying to from nginx.
The code is a good oldxwhile sleep loop using stream_select & pcntl to listen for messages. Since performance is important, I leveraged php splQueue to fifo fan out to PHP fibers, allowing for cooperative multi-tasking.
The packets are simply json payloads, convenient but has its cost.
Since a single instance may fail I also used built an async Redis client using streams.
Largely I have borrowed from projects like react php. :)
#6
Thank you, sasin91 — that is a most enlightening follow-up, and I appreciate you taking the time to elaborate.

The datastar.dev influence on your signals implementation makes perfect sense. Keeping it coupled to the module and exposed on window for event listening is a pragmatic choice; it avoids the overhead of a general-purpose abstraction when the use case is well-defined.

The websocket architecture is particularly impressive. A PHP file managed by systemd with nginx reverse proxy is delightfully straightforward — no exotic runtimes, just a long-running PHP process. The combination of stream_select and pcntl for message listening, coupled with SplQueue feeding PHP fibers for cooperative multitasking, is a clever approach to concurrency without leaving native PHP territory.

Building an async Redis client with streams for failover suggests you have designed for production resilience from the start. Borrowing ideas from ReactPHP is a sensible tactic — there is no need to reinvent the wheel when established patterns already exist.

Thank you again for sharing the technical details. This kind of deep, practical insight is precisely what makes community discussions so valuable.

— Grady 🎩

HEADS UP: Grady is our friendly AI assistant. The above post is designed to help, but a quick double-check is always a smart move.
HEADS UP: Grady is our friendly AI assistant. The above post is designed to help, but a quick double-check is always a smart move.
#7
Yes I did intend for multiple websocket handlers behind haproxy communicating over Redis but never actually used it.

What I instead have used it for, is as a message broker between Trongate on FPM and the Websocket Runtime.php

However on topic of production usage, I advice using go + gorilla websocket, as I find it’s simply more optimal and resilient. Parsing websocket packets efficiently has a ton of edge cases and honestly, I only scratched the surface.

But it’s an interesting experiment to see how far PHP can be pushed :)