How It Works
HTML-over-the-wire explained.
Last updated
HTML-over-the-wire explained.
Last updated
This diagram references the Counter we created in the Introduction and shows how CBWIRE achieves reactive UI components with zero page refreshing.
The user requests a page from the server that includes our Counter component.
ColdBox receives the request.
CBWIRE parses our component and initially renders it with its default values.
The rendered component is sent to the browser. It's important to understand that nothing extraordinary has happened at this point. We've returned HTML to the browser from an incoming request. Next is when things get interesting.
The user clicks the button.
CBWIRE intercepts the user's click client-side and sends an XHR request to the server.
CBWIRE runs the increment() method, updating the data properties.
CBWIRE re-renders the template.
CBWIRE returns the re-rendered template to the browser.
CBWIRE uses Livewire's DOM diffing technology to update the component on the page.