Skip to content

Commit

Permalink
feat(interns.clj): remove interns.clj to deprecate custom defnk macro
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removal of custom defnk macro may affect existing codebases that rely on this macro from interns.clj. Users should replace usages with equivalent core or third-party macros.
  • Loading branch information
ccfontes committed Dec 20, 2023
1 parent 602c753 commit b88e970
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The most recent commit of the `main` branch.

Template's Dockerfile image uses `babashka/babashka:1.3.187-SNAPSHOT` so the template might change unpredictably. We use SNAPSHOT version to be able to use `defnk`. Once Babashka 1.3.187 is released, will upgrade to `babashka/babashka:1.3.187`.
Template's Dockerfile image uses `babashka/babashka:1.3.187-SNAPSHOT` so the template might change unpredictably. We use SNAPSHOT version to be able to use `defnk` from [plumbing](https://github.com/plumatic/plumbing). Once Babashka 1.3.187 is released, will upgrade to `babashka/babashka:1.3.187`.

## Reporting a vulnerability
Please send an email to [email protected].
Expand Down
2 changes: 1 addition & 1 deletion examples/bb-hiccup/handler.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns handler
(:require view))

(defnk handler [body]
(defn handler [{:keys [body]}]
(view/render-page "My Page" body))
2 changes: 1 addition & 1 deletion examples/bb-map-context/handler.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns handler)

(defnk handler [body headers context]
(defn handler [body headers context]
[(keys body) (vals body) (:content-type headers) (:upstream-url context)])
2 changes: 1 addition & 1 deletion examples/bb-map/handler.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns handler)

(defnk handler [body]
(defn handler [{:keys [body]}]
[(keys body) (vals body)])
2 changes: 1 addition & 1 deletion examples/bb-routes/handler.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns handler)

(defnk handler [request-method uri]
(defn handler [{:keys [request-method uri]}]
(case [request-method uri]
[:get "/"] "root"
[:get "/foo"] "foo"))
1 change: 0 additions & 1 deletion template/bb/bb.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{:paths ["." "function"]
:deps {prismatic/plumbing {:mvn/version "0.6.0"}}
:tasks {run-function index/-main
test test.run-tests/-main
merge-config merge-config/-main}}
1 change: 0 additions & 1 deletion template/bb/index.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
[ring.util.walk :as ring-walk]
[secrets :refer [->secrets]]
[compojure.response :as response]
[interns] ; side-effects before 'handler' ns
[handler :as function]))

(def keywords? #(if (nil? %) true %))
Expand Down
6 changes: 0 additions & 6 deletions template/bb/lib/interns.clj

This file was deleted.

0 comments on commit b88e970

Please sign in to comment.