Blog

No more page refreshing with CBWIRE and Turbo Drive

Grant Copley September 12, 2022

Spread the word

Grant Copley

September 12, 2022

Spread the word


Share your thoughts

tl;dr

Turbo Drive can significantly enhance the user experience of your server-side apps by removing unnecessary page refreshes, and it doesn't take much to implement. Once Turbo Drive is installed, link clinks and form submissions will happen in the background via AJAX. You can use Turbo Drive with or without CBWIRE. If you are using CBWIRE, you can now use a plugin to make CBWIRE and Turbo Drive play together nicely.

CBWIRE and Turbo Drive

One of our core goals with the v2 release of CBWIRE was to get it working with Turbo Drive. Initially, we ran into a bunch of JS errors.

Turbo Drive, formerly Turbolinks, is a JavaScript library that watches for link clicks and form submissions, performs them in the background via AJAX, and updates the page without a full reload. Turbo Drive allows you to build apps that look and feel like single-page applications without completely overhauling your code. Even better, it only takes a couple of lines of code to implement.

Setup

NPM

You can install Turbo by running the following npm command at the root of your project.

npm i @hotwired/turbo

Then you can require or import Turbo.

import * as Turbo from "@hotwired/turbo"

Skypack

There is also a Skypack available which you can add to the <head></head> of your layout.


CBWIRE / Livewire Plugin

For Turbo to work correctly with Livewire ( and therefore CBWIRE ), you will need to include the Turbo plugin below your wireScripts() call in your layout.


Note: You MUST have either the data-turbolinks-eval="false" or data-turbo-eval="false" attributes added to the script tag (having both won't hurt).

Enjoy!

Once Turbo is installed, you should find that clicking links and submitting forms within your app does not require any page refreshes.

Turbo listens for various UI events and fetches the updated content from the server via background XHR requests.

For additional information on how Turbo can be used and configured, please see https://turbo.hotwired.dev/.

Also, you can find the CBWIRE documentation at https://cbwire.ortusbooks.com/.

Build something extraordinary.✌️

Add Your Comment

Recent Entries

BoxLang Jsoup: Powerful HTML Parsing, Cleaning and Fluent Navigation

BoxLang Jsoup: Powerful HTML Parsing, Cleaning and Fluent Navigation

We're excited to announce the release of bx-jsoup, a powerful new BoxLang module that brings enterprise-grade HTML parsing and cleaning capabilities to your applications. Built on top of the proven Jsoup library, this module provides developers with safe, flexible tools for handling HTML content while maintaining BoxLang's signature ease of use. It also enhances the core document classes to provide you with a fluent BoxDocument result that you can navigate, query, and even convert your HTML representation to XML or JSON.

Luis Majano
Luis Majano
July 15, 2025
CBWire: Smarter UIs, Simpler Development!

CBWire: Smarter UIs, Simpler Development!

CBWire isn’t just a productivity boost, it’s a shift in how we think about building modern web apps in CFML. It empowers developers to create rich, responsive interfaces while keeping development clean, fast, and focused on what matters.

If you’re building ColdBox applications and want to streamline your front-end work, CBWire is one of the most impactful tools you can add to your stack.

Maria Jose Herrera
Maria Jose Herrera
July 14, 2025
Ortus Monthly Digest: June 2025

Ortus Monthly Digest: June 2025

June was a transformative month at Ortus Solutions as we crossed the halfway point of the year. With major product updates, powerful community engagements, and continued improvements across the BoxLang ecosystem, our mission to modernize development and empower engineers took center stage. Whether you're a longtime member of the Ortus community or just joining us, here's everything we accomplished in June packed with announcements, tools, and opportunities to grow.

Victor Campos
Victor Campos
July 08, 2025