0.2.1 CHANGELOG.md [skip ci]

This commit is contained in:
Michiel Borkent 2020-09-23 14:32:11 +02:00 committed by GitHub
parent 2f445658bf
commit b7a3936595
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 11 deletions

View file

@ -2,6 +2,44 @@
For a list of breaking changes, check [here](#breaking-changes)
## v0.2.1 (SNAPSHOT)
Pre-release binaries:
- [Linux](https://11913-201467090-gh.circle-artifacts.com/0/release/babashka-0.2.1-SNAPSHOT-linux-amd64.zip)
- [macOS](https://11914-201467090-gh.circle-artifacts.com/0/release/babashka-0.2.1-SNAPSHOT-macos-amd64.zip)
- [Windows](https://ci.appveyor.com/api/buildjobs/wjhyh3acqi14dbex/artifacts/babashka-0.2.1-SNAPSHOT-windows-amd64.zip)
Thanks to [@RickMoynihan](https://github.com/RickMoynihan), [@joinr](https://github.com/joinr), [@djblue](https://github.com/djblue), [@lread](https://github.com/lread), [@teodorlu](https://github.com/teodorlu) for contributing to this release. Thanks to [Clojurists Together](https://www.clojuriststogether.org/) for sponsoring this release.
### New
- Include `org.httpkit.client`, a high performance async http client [#561](https://github.com/borkdude/babashka/issues/561)
- Include `org.httpkit.server`, an HTTP server
[#556](https://github.com/borkdude/babashka/issues/556). This namespace should
be considered experimental and may stay or be removed in a future version of
babashka, depending on feedback from the community. See [example](examples/httpkit_server.clj)
- Add `java.io.FileNotFoundException`, `java.security.DigestInputStream`, `java.nio.file.FileVisitOption` classes
- Support implementing `IDeref`, `IAtom` and `IAtom2` on records [sci#401](https://github.com/borkdude/sci/issues/401)
- Support compatibility with [version-clj](https://github.com/xsc/version-clj) [#565](https://github.com/borkdude/babashka/issues/565) [@lread](https://github.com/lread) and [@borkdude](https://github.com/borkdude)
- Support YAML roundtrip through `*input*` [#583](https://github.com/borkdude/babashka/issues/583)
- Support `clojure.core/find-var` [sci#420](https://github.com/borkdude/sci/issues/420) [@RickMoynihan](https://github.com/RickMoynihan)
### Fixed / enhanced
- Fix location printing in REPL (`--repl`) [#577](https://github.com/borkdude/babashka/issues/577)
- Babashka.curl sends form params incorrectly as multipart [babashka.curl#25](https://github.com/borkdude/babashka.curl/issues/25)
- Update Windows build instructions [#574](https://github.com/borkdude/babashka/issues/574)
- Set minimum macOS version in build explicitly [#588](https://github.com/borkdude/babashka/pull/588)
- Fix NPE in error handling logic [#587](https://github.com/borkdude/babashka/issues/587)
- Fix namespace switch in REPL (`--repl`) [#564](https://github.com/borkdude/babashka/issues/564)
- Fix location of errors in REPL (`--repl`) [#589](https://github.com/borkdude/babashka/issues/589)
- Support multi-arity methods in `defprotocol` [sci#406](https://github.com/borkdude/sci/issues/406)
- Constructor call not recognized in protocol impl [sci#419](https://github.com/borkdude/sci/issues/419)
- Improve handling of top-level do in macro expansion [sci#421](https://github.com/borkdude/sci/issues/421)
- Performance improvements suggested by [@joinr](https://github.com/joinr) [sci#415](https://github.com/borkdude/sci/issues/415)
- Throw when trying to redefine referred var [sci#398](https://github.com/borkdude/sci/issues/398)
## v0.2.0 (2020-08-28)
Thanks to [@cldwalker](https://github.com/cldwalker), [@dehli](https://github.com/dehli), [@djblue](https://github.com/djblue), [@GomoSDG](https://github.com/GomoSDG), [@grahamcarlyle](https://github.com/grahamcarlyle), [@j-cr](https://github.com/j-cr),

View file

@ -815,7 +815,11 @@ resources than on the JVM and will break down for some high value of `n`:
For making HTTP requests you can use:
- [babashka.curl](https://github.com/borkdude/babashka.curl). This library is
included with babashka and aliased as `curl` in the user namespace.
included with babashka and aliased as `curl` in the user namespace. The
interface is similar to that of
[clj-http](https://github.com/dakrone/clj-http) but it will shell out to
`curl` to make requests.
- [org.httpkit.client](https://github.com/http-kit/http-kit)
- `slurp` for simple `GET` requests
- [clj-http-lite](https://github.com/borkdude/clj-http-lite) as a library.
- `clojure.java.shell` or `java.lang.ProcessBuilder` for shelling out to your

View file

@ -3,21 +3,22 @@
;; This example creates a file serving web server
;; It accepts a single connection from a browser and serves content to the connected browser
;; after the connection times out, this script will serve no more.
;; Also see notes.clj for another web app example.
(import (java.net ServerSocket))
(require '[clojure.string :as string]
'[clojure.java.io :as io])
(require '[clojure.java.io :as io]
'[clojure.string :as string])
(with-open [server-socket (new ServerSocket 8080)
client-socket (.accept server-socket)]
(loop []
(let [out (io/writer (.getOutputStream client-socket))
in (io/reader (.getInputStream client-socket))
[req-line & headers] (loop [headers []]
(let [line (.readLine in)]
(if (string/blank? line)
headers
(recur (conj headers line)))))
[req-line & _headers] (loop [headers []]
(let [line (.readLine in)]
(if (string/blank? line)
headers
(recur (conj headers line)))))
[_ _ path _] (re-find #"([^\s]+)\s([^\s]+)\s([^\s]+)" req-line)
f (io/file (format "./%s" path))
status (if (.exists f)
@ -46,9 +47,10 @@
(apply html :pre
(for [i (.list f)]
(html :div
(html :a
{:href (str (if (> (count path) 1) path) "/" i)} i)
))))))))]
(html
:a
{:href
(str (when (> (count path) 1) path) "/" i)} i)))))))))]
(prn path)
(.write out (format "HTTP/1.1 %s OK\r\nContent-Length: %s\r\n\r\n%s"
status

View file

@ -0,0 +1,17 @@
(System/setProperty "babashka.httpkit-server.warning" "false")
(ns examples.httpkit-server
(:require [clojure.pprint :refer [pprint]]
[org.httpkit.server :as server]))
(defn handler [req]
(let [reply (str (slurp "examples/httpkit_server.clj")
"---\n\n"
(with-out-str (pprint (dissoc req
:headers
:async-channel))))]
{:body reply}))
(server/run-server handler {:port 8090})
@(promise) ;; wait until SIGINT