NOTE: Whenever upgrading versions of pedestal-app, please be sure to clean your project's out
directory by running lein clean
.
Bug fix release preceding some exciting (and breaking) 0.3.0 changes. Unless any major bugs are discovered, no further work will continue on the 0.2.x stream.
For a full list of changes, please see this comparison of 0.2.1...0.2.2.
Small bug fix for app-template.
For a full list of changes, please see this comparison of 0.2.0...0.2.1.
This is a big one folks. Developer tooling has moved from generated projects into the app- and service-tools libraries.
If you want to take advantage of all the super-awesome new features then further action is required. See the respective changelogs in App and Service for more info.
-
Developer tooling has moved in its entirety to app-tools.
Notable improvements:
- Tooling functions are automatically included when running
lein repl
. - App configuration can be reloaded with
(reload-config)
- Future upgrades to tooling will be incorporated more easily.
Additionally, app configuration is specified by an EDN file (instead of an executable Clojure file.) New projects will make use of this feature, but pre-0.2.0 generated projects will not.
You do not have to make this upgrade, but we suggest you do.
The easiest way to upgrade is to re-generate your application with the 0.2.0 app-template and transfer your existing code into it. It is possible, however, to migrate your existing application.
How to migrate a 0.1.x project to 0.2.0: 1. Upgrade your project's pedestal-app dependencies to version
"0.2.0"
2. Remove thedev/
folder. 3.$ touch config/user.clj
-- This is needed for:repl-options
with:init user
to work. 4. Update yourproject.clj
's:main
and:repl-options
keys like so. 5. Add the piggieback dependency to yourproject.clj
([com.cemerick/piggieback "0.1.0"]
). 6. Update your application'sconfig.clj
file. There are two ways to do this... 1. *If you have not modified yourconfig.clj
: Generate a new application with the same name as your existing application, and steal theconfig.edn
file from it. 2. If you have changed yourconfig.clj
, or you're a glutten for punishment perform these steps (looking like this is our goal): 1.mv config/config.clj config/config.edn
2. Remove thens
declaration. 3. Unwrap theconfigs
def into a raw map. 4. Remove quotes from quoted namespaces. Look in :main and :renderer keys. 5. At path[:build :watch-files]
,(compile/html-files-in "app/templates")
should become a map of tags to regex pattern strings like{:html ["^app/templates"]}
. Note these are string regex patterns, not regexps--regexps aren't supported by EDN. 6. At path[:build :triggers]
, existing strings should be converted to string regex patterns. For example, the original{:html ["project-name/rendering.js"]}
would become{:html ["project-name//rendering\\.js$"]}
. - Tooling functions are automatically included when running
-
Tooling's
cljs-repl
is now provided by Chas Emerick's Piggieback. -
Tooling's
cljs-repl
is now more clear about usage. This fixes #93, #90. -
App's ClojureScript dependency has been bumped to r1835. Namespaced keywords are now allowed (
::msg/topic
)! -
Logging in the browser is now grouped. #95
-
The template now includes a
:ui
aspect for rendering thesimulated
behavior. #184, #187 -
Added the
:read-as
option formsg/param
. Setting to:data
causes collected values to be parsed by the Clojure reader. #166*
-
Service tooling has moved out of generated projects into a service-tools library.
Notable improvements:
- Tooling functions are automatically included when running
lein repl
. - Future upgrades to tooling will be incorporated more easily.
There is a bit of migration necessary to move existing projects to 0.2.0 tooling. You don't have to make this change, but we suggest you do.
How to migrate a 0.1.x project to 0.2.0: 1. Update your project's dependencies to match the new ones: 1. Upgrade your project's pedestal-service dependencies to version
"0.2.0"
. 2. Add[io.pedestal/pedestal.service-tools "0.2.0"]
as a dependency. 3. Remove logback and slf4j logging dependencies. 2. Remove thedev/
folder 3.$ touch config/user.clj
-- This is needed for:repl-options
with:init user
to work. 4. Update yourproject.clj
's:main
and:repl-options
keys to match the new template project.clj. 5. Pare down your src/**/server.clj file to match the new template server.clj. - Tooling functions are automatically included when running
-
Service now uses Cheshire instead of clojure.data.json for constructing
json-response
s and parsing json bodies. #162This change does eliminate some JSON parsing options that were previously possible in 0.1.10. Specifically the following options are no longer supported:
:eof-error?
- "If true (default) will throw exception if the stream is empty.":eof-value
- "Object to return if the stream is empty and eof-error? is false. Default is nil."
If your application makes use of these options you will need to construct a
body-params
interceptor with aparser-map
where you have swapped in your own#"^application/json"
key with acustom-json-parser
similar to the old version.That might look something like this:
;; In a utility namespace (require '[io.pedestal.service.http.body-params :as bp]) (defn old-style-json-parser ...) (def my-body-params (bp/body-params (-> (bp/default-parser-map) (assoc #"^application/json" (old-style-json-parser)))))
-
The default behavior of the
body-params
interceptor now keywordizes JSON keys. To retain the old behavior, create abody-params
interceptor like so:(require '[io.pedestal.service.http.body-params :as bp]) (def string-keys-body-params (bp/body-params (bp/default-parser-map :json-options {:key-fn nil})))
-
A bug with CORS headers has been fixed.
-
The default MIME type has been returned to text/plain (it was a bug that it changed to octet-stream.)
For a full list of changes, please see this comparison of 0.1.10...0.2.0.
- The messages queue is now a priority queue. Specify
msg/priority :high
in a message for that message to be processed before all other unadorned messages. 2495b9a5 - Various improvements that make it easier to run in a web worker (more on that to follow, 😉)
io.pedestal.service.http.route/url-for
now accepts a:fragment
option for specifying URL fragments (i.e `http://example.com/#foobars). #85io.pedestal.service.http.body-params
's edn and json parsers can now be configured (both alone and as part ofdefault-parser-map
). #96, #97, #98
For a full list of changes, please see this comparison of 0.1.9...0.1.10.
- All Pedestal libraries now properly depend on Clojure 1.5.1.
- The dataflow engine now properly reports changes when nodes have nil or falsey values. #78
- Messages that throw exceptions during processing now log an error message.
- Templates can now insert content at a specific index with
io.pedestal.app.render.push.templates/insert-t
. #81 - Generated
dev/dev.clj
now uses(start)
instead of(run)
, bringing it in line with pedestal-service. #84
For a full list of changes, please see this comparison of 0.1.8...0.1.9.
-
App and service templates now allow creating projects with namespaces #68.
$ lein new pedestal-app com.example/foo ... creates foo/ with src/com/example/foo/*.clj
- Corrected a test error in the generated service template project.
For a full list of changes, please see this comparison of 0.1.7...0.1.8.
- The new simplified dataflow engine is here! We're working to update our documentation and samples now. Stay informed by following @pedestal_team on twitter.
- Existing applications will continue to function normally.
io.pedestal.app.templates/dtfn
now allows for more than one data field #60.
- Empty EDN responses are now handled gracefully #69.
- Resources for services can now be drawn from
resources/
#51. - Typo fixes in HTML and JSON interceptors #72.
- Corrected a few places the
Content-Type
header was not being set properly #58, #65.
For a full list of changes, please see this comparison of 0.1.6...0.1.7.
-
Context paths now work with JBoss
-
It is now possible to specify TCP port in routes (default: 8080). Specified ports will also be reflected in generated URL.
(defroutes routes [[:app1 8080 ["/" {:get app1-root}]] [:app2 8181 ["/" {:get app2-root}]]]
For a full list of changes, please see a comparison of 0.1.5...0.1.6.
We encountered a bug deploying version 0.1.4 so that release was re-done as version 0.1.5
lein clean
now correctly deletesout
directory.
- Added
text-as-html
anddata-as-json
interceptors. - Newly generated service apps assume content is
text/html
if not specified otherwise.
Special thanks to @ddeaguiar for grammar and spelling corrections, as well as his help in removing lein-marginalia as a dependency. We've updated the documentation with instructions on how to continue to generate marginalia documentation.
For a full list of changes, please see a comparison of 0.1.3...0.1.5.
- app-tools now serves every request with header Cache-Control: no-cache (#44) - @rkneufeld
- Add CORS support to SSE and service template - @timewald
For a full list of changes, please see a comparison of 0.1.2...0.1.3.
- Travis CI integration has been enabled (#27) - @cldwalker
- lein repl history is now ignored by git (#38) - @crimeminister
- app tests no longer have non-deterministic timing problems (#39) - @brentonashworth
- app-tools now plays (more) nicely with Windows (#23, #29, #31) - @djpowell, @rkneufeld
- Add support for Heroku (#18) - @aredington, @cldwalker, @hiredman, @timewald
- An HTTP status is now sufficient to bypass the not-found interceptor (whereas it used to require headers) (#30, #34) - @hiredman, @rkneufeld
- Removed a number of incorrect :or keys (#32) - @cldwalker
- Usage of 'read-string' has been audited and corrected (#40) - @stuartsierra
- io.pedestal.service.http.body-params/set-content-type now uses correct casing for HTTP headers (#35) - @stuarth