Skip to content

New names for things πŸ™Œ

Compare
Choose a tag to compare
@swlkr swlkr released this 23 Mar 18:31
· 104 commits to master since this release

Why is this a x.2.0 release instead of a bug fix release?

I'll tell you why.

Coast relies heavily on an old Clojure library named ring, which it's still a great way to develop web apps with Clojure to this day, but Coast inherited some of the language from ye olden days (2014).

Here's the breakdown, in addition to the last few releases which dramatically simplified the route middleware code and the app middleware code as well, this release changes a few things that may break you, so semantic versioning is out the window at this point, but, it's only one change.

Before, in routes.clj, site-routes used to take an optional layout fn, and then the routes, that's gone now. It only takes routes, so this:

(coast/site-routes :components/layout
  [:get "/" :home/index])

is now this:

(coast/site-routes
  (coast/with-layout
    [:get "/" :home/index]))

That's the breaking change, so if anyone out there is having trouble after updating, this is why.

Also, why did this change happen? I was working on the docs site and noticed that it's more difficult than it should be to change the page title based on some data in a route. That is no longer the case, you can now set a middleware before the layout function and assoc a new page title and it works out as expected.

On to the rest of the changes that aren't breaking:

site-routes is now site
api-routes is now api
wrap-with-layout is now with-layout
wrap-routes is now with

The old functions still exist though, but the newer functions have much better names.