ColdFusion on Wheels Blog


CFWheels Added to the htmx Server-Side Examples Page

Back in March we published an example app where we took the TodoMVC spec and built a reference implementation of the app with CFWheels and htmx. Here is a quick graphic of the UI of the app.

Todo app implemented with CFWheels and htmx

This app has now been added to the list of Server-Side integration examples on the htmx website.

htmx at it’s core is html over the wire. Instead of returning JSON from backend APIs and consuming them with Javascript to build page interactivity, htmx takes a different approach. It expects actual html snippets to be returned that are swapped into the DOM. How it does it, is by extending html with a handful of additional attributes, that probably should have been there in the first place, which enable any HTML element to issue an AJAX call to the backend, specify what triggers the call, and specify how the returned HTML should be added to the DOM.

We’ll be doing more with HTMX in the future so it’s great to get CFWheels on the radars of the htmx project.


Two New Repositories Published

We have published two new repositories named cfwheels/cfwheels-www and cfwheels/cfwheels-api which handle the CFWheels.org landing page site and the api.cfwheels.org API documentation site respectively.

The cfwheels-api repository is a good example of how you can structure your own projects and keep sensitive information and the core framework files out of your project’s source control repository. The project used a .gitignore file that keeps these files out of the repo. It also uses a box.json file to specify some dependencies to pull the required files back in.

Using dependencies in a box.json file is nothing new but what’s interesting is that cfwheels/cfwheels-api has three dependencies defined. One is the core framework itself and pulls in the latest framework folder. The second is the newly published CFWheels DotEnvSettings Plugin which allows keeping sensitive information out of the repository by using a locally defined .env file. The last dependency is probably the most interesting, cause that one pulls in the Semantic Version module from ForgeBox which is a module that wasn’t specifically written for CFWheels but can be pulled in and used none the less. This opens up the potential of using many more modules from ForgeBox instead of being confined to just CFWheels Plugins.


CFWheels DotEnvSettings Plugin published

A new plugin was published to provide support for .env settings files in a production environment. This plugin is based on Eric Peterson’s CommandBox module and allows the use of .env or similarly named files to store your application secrets so they can be kept out of source control.

LICENSE

Apache License, Version 2.0.

SYSTEM REQUIREMENTS

  • Lucee 5+
  • ColdFusion 9+
  • CFWheels 2+

Instructions

Just drop the zip file into your plugins folder and restart your application or use CommandBox cli to install. Simply type the following at the root of your project:

box install cfwheels-dotenvsettings

Usage

Create a .env file in your project root and add to .gitignore or your version control’s equivalent (don’t commit secrets to your repo!) The file can contain JSON or Java properties style key value pairs:

// property style
MY_SECRET_KEY=somevalue
MY_OTHER_SECRET=shh

// json style
{
  "MY_SECRET_KEY"="somevalue"
 ,"MY_OTHER_SECRET"="shh"
};

The default file name supported is .env but you can use any file name you want. You could even have multiple files for various environment.

In your CFWheels app you can read in your secrets by adding readDotEnvSettings() to your application. The most logical point to do this would be in your events\onApplicationStart.cfm file, but you could do it in your environment specific settings.cfm files as well. You can then access the secrets contained in the file processed using get("MY_SECRET_KEY").

If you want to customize the secrets file to use, you can specify the file name by passing in the file name like so readDotEnvSettings(".env-second").


CFWheels has moved to GitHub Discussions

Although Google Groups has served us well over the years, it’s started to lose some essential abilities and it’s looking a little long in the tooth.

We have decided that it would be a benefit to the community to migrate to GitHub Discussions. GitHub Discussions allows us to bring our community closer to where the code lives.

“People around the world are turning to open source—and to GitHub. It is becoming not only the home for developers, but a platform where people in many roles, doing diverse work, come to learn, engage with the community, and contribute to projects that advance the greater good.”

GitHub Octoverse 2020 Report

The benefits of moving to Github Discussions are numerous, but at a glance, we look forward to having better syntax highlighting, marking comments as answers, flagging threads as Answered, easily turning a discussion into an issue, and many more.

The Google Group will remain available, but we have disabled posting to the group, and we’ll treat it as a read-only archive of past discussions.


CFWheels Announces a Bug Bounty

We are happy to launch a new program that we hope will lead to a more stable framework for all of us. Effective immediately we are launching our Bug Bounty program. When we first conceived of the bounty program we were looking at programs from IssueHunt and BountySource and the main goal was to widen the field of contributors to the CFWheels project as well as crush some of the long standing bugs in the framework.

Most of these bugs are edge cases that don’t effect the core functionality of the framework and for the most part users have found work arounds for. In the past it’s been difficult to dedicate our limited resources towards some of these bugs but now that we have a growing list of monthly sponsors we would like to launch out bounty program to compensate contributors who are willing to tackle some of these.

The easiest way to get started participating in this program is to visit the issues list and look for the $50 Bounty tag. Pick an issue that interests you, clone the repo, and start working on your solution. When you think you have a working solution create a PR and submit it for review. Please read the Contributing to CFWheels chapter in the guides or the contributing guidelines in the repository for details on how to contribute to the CFWheels project.

We look forward to see how the community responds to this bounty program. Depending on how things go, we can envision expanding this program to include enhancements as well as sponsorship of individual enhancements.


CFWheels 2.3.0 Released

This is the official v2.3.0 release. It is dropping a little over a week from Release Candidate 1. We simply wanted to make sure the new CI/CD workflow was functioning before calling the release final. We feel confident that we’re good to mark this release as final. There are no new enhancement or bug fixes in this release from 2.3.0.rc.1.

Download Zip

If updating from CFWheels 2.2.x:

If should be an easy upgrade, just swap out the wheels folder.

Changelog

Please refer to release 2.3.0.rc.1 for details.


CFWheels Guides Moved to GitBook

We are glad to announce that the CFWheels Guides have been moved to GitBook.com. The good folks at GitBook are proud to support CFWheels and have granted us an Open Source Community account. We have migrated all the guides from our old provider to GitBook and will be making some more changes as we review all the links now that the domain has been switched. A few things you’ll notice right off the bat.

There is now a PDF download link to the right of the screen when viewing the guides. The link allows you to download the section you are on or the entire CFWheels Guides. Which by the way, is nearly 300 pages long. There is also a new search feature that will allow you to find topics easier. But the biggest change comes from the fact that by moving to GitBook we were able to move the guides to GitHub as well.

In fact the guides have been added as a sub directory in the cfwheels/cfweels GitHub repository. By moving the guides within the codebase, you can finally include both code changes and documentation changes in the same PR. This will make the guides more accessible to our contributors and make it easier to keep the codebase and guides in sync.

Please have a look through the new guides and let us know what you think. Oh, and if you find something that needs to be updated, you know the drill, clone, edit, and submit a PR.


CFWheels 2.3.0-rc.1 Released

This version has been cooking for a while and there have been many contributors. But since this is my first release a the helm with a new CI pipeline in place, I felt more comfortable doing a Release Candidate first.

Download Zip

If updating from CFWheels 2.2.x:

If should be an easy upgrade, just swap out the wheels folder.

Changelog

View Enhancements

  • Adds association error support via includeAssociations argument #1080 – [Nikolaj Frey]

Bug Fixes

  • onerror handler should increase user defined requestTimeout value #1056 – [Adam Chapman]
  • deletedAt should also respect timestamp mode (UTC) #1063 – [David Belanger]
  • Fixes No output from Debug() usage in plugin test cases #1061 – [Tom King]
  • Development mode will now properly return a 404 status if view not found #1067 – [Adam Cameron, Tom King]
  • 404 status now properly returned without URL rewriting #1067 – [Adam Cameron, Tom King]
  • Internal Docs in ACF2018 should now not display duplicate categories [Tom King]
  • Internal Docs search now resets itself properly on backspace with empty value #982 – [Brandon Shea, Tom King]
  • ValidatesConfirmationOf() now correctly enforces prescence of confirmation property #1070 – [Adam Cameron, Tom King]
  • resource()/resources() now allows empty only property to utilise as non-route parent #1083 – [Brian Ramsey]
  • Handle XSS Injection in development enviroment – [Michael Diederich]
  • Fix params bug in CLI API [#1106] – [Peter Amiri]

Miscellaneous

  • Update Docker Lucee Commandbox version to 5.2.0 – [Adam Chapman, Tom King]
  • Minor internal obselete reference to modelComponentPath removed – [Adam Chapman, Tom King]
  • Minor visual fix for long migration logs overflow in modal (scroll) – [Brian Ramsey]
  • Add test suite for Lucee and H2 Database to the GitHub Actions test suite. – [Peter Amiri]
  • On going changes to update the H2 drivers [#1107] – [Peter Amiri]
  • Fixes some syntax formating introduced by cfformat [#1111] – [Adam Chapman]
  • Minimum ColdFusion version is now ColdFusion (2018 release) Update 3 (2018,0,03,314033) / ColdFusion (2016 release) Update 10 (2016,0,10,314028) / ColdFusion 11 Update 18 (11,0,18,314030) #923 – [Michael Diederich]
  • Wheels save(allowExplicitTimestamps=true) doesn’t produce the expected result [#1113] – [SebastienFCT]

Potentially Breaking Changes

  • Automatic Time Stamps: the deletedAt column was using the server’s local time for the timestamp while createdAt / updatedAt were using the timestamp selected for the timestamp mode. The default for CFWheels’ timestamp mode is UTC and therefore all future deletedAt timestamps will be in UTC unless you’ve changed the default. Please review any SQL that uses deletedAt for datetime comparison.

CFWheels Fully Embraces ForgeBox Packages

As you may know, many years ago CFWheels embraced the distribution of Plugins via ForgeBox packages instead of maintaining our own directory. But the framework itself remains illusive. There was some work done in the last few months to put up packages for the framework but those packages were being maintained by hand which made them a show stopper for a long term solution.

Well, thanks to a new CI workflow based on GitHub Actions we now have the building and publishing of the packages fully automated. Giving credit where credit is due, the new workflow borrows heavily from the ColdBox workflow. It used GitHub Actions, Ant, and CommandBox to automate the process.

So what does all this mean for you, let’s cut to the chase. This means you can now install a fresh copy of the framework using the following command:

box install cfwheels-base-template

This will pull down a copy of the latest stable release of the template files and then pull down a copy of the latest stable release of the framework via package dependencies. In fact the CI workflow mentioned about publishes two packages cfwheels which is the core framework directory and cfwheels-base-template which is all the other files you need to scaffold the framework.

We’ve even backfilled all the prior released versions of the framework all the way back to version 1.0.0. So you can install a particular version of the framework using the following command:

box install [email protected]

In addition you can install the bleeding edge which includes all the work in process towards the next major release using:

box install cfwheels-base-template@be

And if you ever just need to get a copy of the latest framework files simply use the following command:

box install cfwheels

All this means that upgrading to a newer version of the framework should be much easier going forward. Frankly you should just need to modify the version of the dependency in the box.json file and issue a box update command. But we’ll document that more fully when we make our next release.

For now please feel free to play with all this package goodness and let us know if we fumbled anything.


CFWheels Joins Open Source Collective

We are happy to announce that CFWheels has joined Open Source Collective. According to their website, Open Collective enables all kinds of groups to raise, manage, and spend money transparently. We’re also in good company in the collective. Other projects hosted by the Open Source Collective include Lucee, WebPack, PHP Foundation, Vue, LinuxServer, ESLint, Bower, Svelte, and the list literally goes on and on.

So what does this mean for CFWheels. Well, it allows us to finally be able to accept donations from our community. Many of you have offered your donations to us in the past but we really had no good way to do accept them legally. Plus we felt strongly that as an open source project we needed to adopt an open and transparent accounting practices. As a member of the collective, you’ll be able to donate and see every dollar we raise and what it is spent on. Creating a sustainable ecosystem is important for the long term viability of the CFWheels project. So how do you donate, visit Open Source Collective directly or any of our GitHub projects and look for the Sponsor this project link in the right side bar.

We’ve already received our first monthly donation and we are truly grateful. These funds will allow us to offer bounties for small issues or bugs, commission larger works, and pay for marketing, logo, or branding services.