Skip to content

Commit

Permalink
Merge pull request #143 from walmartlabs/hls/jetty-0.7.0-beta-1
Browse files Browse the repository at this point in the history
Update for Pedestal 0.7.0
  • Loading branch information
hlship authored Jul 12, 2024
2 parents 8db03e5 + 660b6c4 commit 55d29b9
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 124 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@v4.1.7
- name: Setup Java
uses: actions/setup-java@v3.10.0
uses: actions/setup-java@v4.2.1
with:
java-version: '11'
distribution: 'corretto'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@10.2
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 1.11.1.1165
cli: 1.11.3.1463

- name: Cache clojure dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.m2/repository
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 1.3 -- UNRELEASED

*BREAKING CHANGES*

Function `com.walmartlabs.lacinia.pedestal.subscriptions/listener-fn-factory`
was renamed to `subscription-websocket-endpoint`, and its behavior and options
have changed. Fortunately, most Lacinia applications only use this function
indirectly, via `com.walmartlabs.lacinia.pedestal2/enable-subscriptions`, which
hasn't changed.

Other changes:

* Bumped many dependencies to latest
* Bumped Pedestal dependency to 0.7.0

## 1.2 -- 23 Jun 2023

Logging from the `com.walmartlabs.lacinia.pedestal.subscriptions` namespace
Expand Down
26 changes: 15 additions & 11 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
com.walmartlabs/lacinia {:mvn/version "1.2.1"}
com.fasterxml.jackson.core/jackson-core {:mvn/version "2.15.2"}
io.pedestal/pedestal.service {:mvn/version "0.6.0"}
io.pedestal/pedestal.jetty {:mvn/version "0.6.0"}
com.rpl/proxy-plus {:mvn/version "0.0.9"}}
{:deps {org.clojure/clojure {:mvn/version "1.11.3"}
com.walmartlabs/lacinia {:mvn/version "1.2.2"}
com.fasterxml.jackson.core/jackson-core {:mvn/version "2.17.2"}
io.pedestal/pedestal.service {:mvn/version "0.7.0"}
io.pedestal/pedestal.jetty {:mvn/version "0.7.0"}
com.rpl/proxy-plus {:mvn/version "0.0.11"}}
:mvn/repos {"redplanetlabs" {:url "https://nexus.redplanetlabs.com/repository/maven-public-releases"}}
:paths ["src" "resources"]
:deps/prep-lib {:alias :build
:fn prep
:ensure "target/classes"}
:aliases
{:dev
{:extra-deps {clj-http/clj-http {:mvn/version "3.12.3"}
{:extra-deps {clj-http/clj-http {:mvn/version "3.13.0"}
com.walmartlabs/test-reporting {:mvn/version "1.2"}
com.stuartsierra/component {:mvn/version "1.1.0"}
expound/expound {:mvn/version "0.9.0"}
hato/hato {:mvn/version "0.9.0"}
io.github.hlship/trace {:mvn/version "v1.0"}
io.aviso/logging {:mvn/version "1.0"}}
hato/hato {:mvn/version "1.0.0"}
nubank/matcher-combinators {:mvn/version "3.9.1"}
io.github.hlship/trace {:mvn/version "1.3"}
org.clj-commons/pretty {:mvn/version "3.0.0"}
io.github.tonsky/clj-reload {:mvn/version "0.7.1"}
ch.qos.logback/logback-classic {:mvn/version "1.5.6"}}

:jvm-opts ["-Xmx500m"]
:extra-paths ["test" "dev-resources"
Expand All @@ -36,7 +40,7 @@

:build
{:deps
{io.github.hlship/build-tools {:git/tag "0.9" :git/sha "4efa3c9"}}
{io.github.hlship/build-tools {:git/tag "0.10.2" :git/sha "3c446e4"}}
:ns-default build}}

:net.lewisship.build/scm
Expand Down
1 change: 1 addition & 0 deletions dev-resources/data_readers.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{trace/result net.lewisship.trace/trace-result-reader}
3 changes: 2 additions & 1 deletion dev-resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
<logger name="com.walmartlabs.lacinia" level="warn"/>
<logger name="com.walmartlabs.lacinia.test-utils" level="warn"/>

<logger name="org.eclipse.jetty.websocket" level="warn"/>
<logger name="clj-antlr.common" level="error"/>
<logger name="demo" level="debug"/>

<logger name="com.walmartlabs.lacinia.pedestal.subscriptions" level="warn"/>

</configuration>
8 changes: 8 additions & 0 deletions dev-resources/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
com.walmartlabs.lacinia.expound
[clojure.spec.alpha :as s]
[net.lewisship.trace :as trace]
[clj-commons.pretty.repl :as repl]
matcher-combinators.test
[expound.alpha :as expound]))

(s/check-asserts true)

(trace/setup-default)

(repl/install-pretty-exceptions)

(alter-var-root #'s/*explain-out* (constantly expound/printer))

(comment
(trace/set-enable-trace! false)
)
12 changes: 2 additions & 10 deletions src/com/walmartlabs/lacinia/pedestal/internal.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
[io.pedestal.log :as log]
[clojure.java.io :as io]
[ring.util.response :as response]
[io.pedestal.http.jetty.websockets :as ws]
[io.pedestal.http :as http]
[io.pedestal.interceptor.chain :as chain]
[com.walmartlabs.lacinia.pedestal.subscriptions :as subscriptions]
Expand Down Expand Up @@ -265,12 +264,5 @@

(defn add-subscriptions-support
[service-map compiled-schema subscriptions-path subscription-options]
(assoc-in service-map
[::http/container-options :context-configurator]
;; The listener-fn is responsible for creating the listener; it is passed
;; the request, response, and the ws-map. In sample code, the ws-map
;; has callbacks such as :on-connect and :on-text, but in our scenario
;; the callbacks are created by the listener-fn, so the value is nil.
#(ws/add-ws-endpoints % {subscriptions-path nil}
{:listener-fn
(subscriptions/listener-fn-factory compiled-schema subscription-options)})))
(assoc-in service-map [::http/websockets subscriptions-path]
(subscriptions/subscription-websocket-endpoint compiled-schema subscription-options)))
Loading

0 comments on commit 55d29b9

Please sign in to comment.