mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Add clj-kondo and fix most linting warnings
This commit is contained in:
parent
c214622495
commit
c4e84c2875
47 changed files with 178 additions and 181 deletions
6
.clj-kondo/config.edn
Normal file
6
.clj-kondo/config.edn
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{;;:skip-comments true
|
||||||
|
:lint-as {potemkin/def-derived-map clojure.core/defrecord}
|
||||||
|
:linters {:if {:level :off}
|
||||||
|
:unused-binding {:level :off}
|
||||||
|
:unused-referred-var {:exclude {clojure.test [deftest testing is are]
|
||||||
|
cljs.test [deftest testing is are]}}}}
|
||||||
10
Justfile
Normal file
10
Justfile
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
help:
|
||||||
|
@just --list
|
||||||
|
|
||||||
|
# Initializes lint
|
||||||
|
init-lint:
|
||||||
|
clj-kondo --lint $(lein classpath)
|
||||||
|
|
||||||
|
# Lints the project
|
||||||
|
lint:
|
||||||
|
./lint.sh
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.easy :as rfe]
|
[reitit.frontend.easy :as rfe]
|
||||||
[reitit.frontend.controllers :as rfc]
|
[reitit.frontend.controllers :as rfc]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.schema :as rsc]
|
[reitit.coercion.schema :as rsc]
|
||||||
[schema.core :as s]
|
[schema.core :as s]
|
||||||
[fipp.edn :as fedn]))
|
[fipp.edn :as fedn]))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.easy :as rfe]
|
[reitit.frontend.easy :as rfe]
|
||||||
[reitit.frontend.controllers :as rfc]
|
[reitit.frontend.controllers :as rfc]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.schema :as rsc]
|
[reitit.coercion.schema :as rsc]
|
||||||
[schema.core :as s]
|
[schema.core :as s]
|
||||||
[fipp.edn :as fedn]))
|
[fipp.edn :as fedn]))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
(:require [clojure.string :as string]
|
(:require [clojure.string :as string]
|
||||||
[fipp.edn :as fedn]
|
[fipp.edn :as fedn]
|
||||||
[reagent.core :as r]
|
[reagent.core :as r]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.spec :as rss]
|
[reitit.coercion.spec :as rss]
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.easy :as rfe]
|
[reitit.frontend.easy :as rfe]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
(ns frontend.core
|
(ns frontend.core
|
||||||
(:require [fipp.edn :as fedn]
|
(:require [fipp.edn :as fedn]
|
||||||
[reagent.core :as r]
|
[reagent.core :as r]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.spec :as rss]
|
[reitit.coercion.spec :as rss]
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.easy :as rfe]
|
[reitit.frontend.easy :as rfe]))
|
||||||
[spec-tools.data-spec :as ds]))
|
|
||||||
|
|
||||||
;; Implementing conditional prompt on navigation with Reitit frontend.
|
;; Implementing conditional prompt on navigation with Reitit frontend.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
(ns frontend-re-frame.core
|
(ns frontend-re-frame.core
|
||||||
(:require
|
(:require [re-frame.core :as re-frame]
|
||||||
[re-frame.core :as re-frame]
|
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[reitit.core :as r]
|
[reitit.core :as r]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.spec :as rss]
|
[reitit.coercion.spec :as rss]
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.controllers :as rfc]
|
[reitit.frontend.controllers :as rfc]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns backend.server
|
(ns backend.server
|
||||||
(:require [clojure.java.io :as io]
|
(:require [ring.util.response :as resp]
|
||||||
[ring.util.response :as resp]
|
|
||||||
[ring.middleware.content-type :as content-type]))
|
[ring.middleware.content-type :as content-type]))
|
||||||
|
|
||||||
(def handler
|
(def handler
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
(:require [reagent.core :as r]
|
(:require [reagent.core :as r]
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[reitit.frontend.easy :as rfe]
|
[reitit.frontend.easy :as rfe]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.coercion.spec :as rss]
|
[reitit.coercion.spec :as rss]
|
||||||
[spec-tools.data-spec :as ds]
|
[spec-tools.data-spec :as ds]
|
||||||
[fipp.edn :as fedn]))
|
[fipp.edn :as fedn]))
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,10 @@
|
||||||
[reitit.http.interceptors.muuntaja :as muuntaja]
|
[reitit.http.interceptors.muuntaja :as muuntaja]
|
||||||
[reitit.http.interceptors.exception :as exception]
|
[reitit.http.interceptors.exception :as exception]
|
||||||
[reitit.http.interceptors.multipart :as multipart]
|
[reitit.http.interceptors.multipart :as multipart]
|
||||||
[reitit.http.interceptors.dev :as dev]
|
;; Uncomment to use
|
||||||
[reitit.http.spec :as spec]
|
; [reitit.http.interceptors.dev :as dev]
|
||||||
[spec-tools.spell :as spell]
|
; [reitit.http.spec :as spec]
|
||||||
|
; [spec-tools.spell :as spell]
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[aleph.http :as aleph]
|
[aleph.http :as aleph]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
[reitit.http.interceptors.muuntaja :as muuntaja]
|
[reitit.http.interceptors.muuntaja :as muuntaja]
|
||||||
[reitit.http.interceptors.exception :as exception]
|
[reitit.http.interceptors.exception :as exception]
|
||||||
[reitit.http.interceptors.multipart :as multipart]
|
[reitit.http.interceptors.multipart :as multipart]
|
||||||
[reitit.http.interceptors.dev :as dev]
|
;; Uncomment to use
|
||||||
[reitit.http.spec :as spec]
|
; [reitit.http.interceptors.dev :as dev]
|
||||||
[spec-tools.spell :as spell]
|
; [reitit.http.spec :as spec]
|
||||||
[io.pedestal.http :as server]
|
; [spec-tools.spell :as spell]
|
||||||
[reitit.pedestal :as pedestal]
|
[reitit.pedestal :as pedestal]
|
||||||
[clojure.core.async :as a]
|
[clojure.core.async :as a]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
(ns example.server-test
|
(ns example.server-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer [deftest testing is]]
|
||||||
[example.server :refer [app]]
|
[example.server :refer [app]]
|
||||||
[ring.mock.request :refer [request json-body]]))
|
[ring.mock.request :refer [request json-body]]))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,10 @@
|
||||||
[reitit.ring.middleware.exception :as exception]
|
[reitit.ring.middleware.exception :as exception]
|
||||||
[reitit.ring.middleware.multipart :as multipart]
|
[reitit.ring.middleware.multipart :as multipart]
|
||||||
[reitit.ring.middleware.parameters :as parameters]
|
[reitit.ring.middleware.parameters :as parameters]
|
||||||
[reitit.ring.middleware.dev :as dev]
|
;; Uncomment to use
|
||||||
[reitit.ring.spec :as spec]
|
; [reitit.ring.middleware.dev :as dev]
|
||||||
[spec-tools.spell :as spell]
|
; [reitit.ring.spec :as spec]
|
||||||
|
; [spec-tools.spell :as spell]
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
(ns example.server-test
|
(ns example.server-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer [deftest testing is]]
|
||||||
[example.server :refer [app]]
|
[example.server :refer [app]]
|
||||||
[ring.mock.request :refer [request json-body]]))
|
[ring.mock.request :refer [request json-body]]))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,10 @@
|
||||||
[reitit.ring.middleware.exception :as exception]
|
[reitit.ring.middleware.exception :as exception]
|
||||||
[reitit.ring.middleware.multipart :as multipart]
|
[reitit.ring.middleware.multipart :as multipart]
|
||||||
[reitit.ring.middleware.parameters :as parameters]
|
[reitit.ring.middleware.parameters :as parameters]
|
||||||
[reitit.ring.middleware.dev :as dev]
|
;; Uncomment to use
|
||||||
[reitit.ring.spec :as spec]
|
; [reitit.ring.middleware.dev :as dev]
|
||||||
[spec-tools.spell :as spell]
|
; [reitit.ring.spec :as spec]
|
||||||
|
; [spec-tools.spell :as spell]
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
[clojure.java.io :as io]))
|
[clojure.java.io :as io]))
|
||||||
|
|
|
||||||
15
lint.sh
Executable file
15
lint.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
EXIT=0
|
||||||
|
|
||||||
|
clj-kondo --lint modules/*/src test perf-test
|
||||||
|
EXIT=$(( EXIT + $? ))
|
||||||
|
|
||||||
|
for file in examples/*/src; do
|
||||||
|
echo
|
||||||
|
echo "Linting $file"
|
||||||
|
clj-kondo --lint "$file"
|
||||||
|
EXIT=$(( EXIT + $? ))
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $EXIT
|
||||||
|
|
@ -4,11 +4,9 @@
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[meta-merge.core :as mm]
|
[meta-merge.core :as mm]
|
||||||
[reitit.trie :as trie]
|
[reitit.trie :as trie]
|
||||||
[reitit.exception :as exception]
|
|
||||||
[reitit.exception :as ex])
|
[reitit.exception :as ex])
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(:import (java.util.regex Pattern)
|
(:import (java.util HashMap Map)
|
||||||
(java.util HashMap Map)
|
|
||||||
(java.net URLEncoder URLDecoder))))
|
(java.net URLEncoder URLDecoder))))
|
||||||
|
|
||||||
(defn parse [path opts]
|
(defn parse [path opts]
|
||||||
|
|
@ -138,7 +136,7 @@
|
||||||
(when-not (every? #(contains? path-params %) required)
|
(when-not (every? #(contains? path-params %) required)
|
||||||
(let [defined (-> path-params keys set)
|
(let [defined (-> path-params keys set)
|
||||||
missing (set/difference required defined)]
|
missing (set/difference required defined)]
|
||||||
(exception/fail!
|
(ex/fail!
|
||||||
(str "missing path-params for route " template " -> " missing)
|
(str "missing path-params for route " template " -> " missing)
|
||||||
{:path-params path-params, :required required}))))
|
{:path-params path-params, :required required}))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
[reitit.exception :as exception]
|
[reitit.exception :as exception]
|
||||||
[arrangement.core]
|
[arrangement.core]
|
||||||
;; spell-spec
|
;; spell-spec
|
||||||
[spec-tools.spell :as spell]
|
|
||||||
[spell-spec.expound]
|
[spell-spec.expound]
|
||||||
;; expound
|
;; expound
|
||||||
[expound.ansi]
|
[expound.ansi]
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
(ns reitit.frontend
|
(ns reitit.frontend
|
||||||
(:require [clojure.set :as set]
|
(:require [clojure.set :as set]
|
||||||
[reitit.coercion :as coercion]
|
[reitit.coercion :as coercion]
|
||||||
[reitit.coercion :as rc]
|
|
||||||
[reitit.core :as r])
|
[reitit.core :as r])
|
||||||
(:import goog.Uri
|
(:import goog.Uri
|
||||||
goog.Uri.QueryData))
|
goog.Uri.QueryData))
|
||||||
|
|
||||||
(defn- query-param [^goog.Uri.QueryData q k]
|
(defn- query-param [^QueryData q k]
|
||||||
(let [vs (.getValues q k)]
|
(let [vs (.getValues q k)]
|
||||||
(if (< (alength vs) 2)
|
(if (< (alength vs) 2)
|
||||||
(aget vs 0)
|
(aget vs 0)
|
||||||
|
|
@ -14,7 +13,7 @@
|
||||||
|
|
||||||
(defn query-params
|
(defn query-params
|
||||||
"Given goog.Uri, read query parameters into Clojure map."
|
"Given goog.Uri, read query parameters into Clojure map."
|
||||||
[^goog.Uri uri]
|
[^Uri uri]
|
||||||
(let [q (.getQueryData uri)]
|
(let [q (.getQueryData uri)]
|
||||||
(->> q
|
(->> q
|
||||||
(.getKeys)
|
(.getKeys)
|
||||||
|
|
@ -51,7 +50,7 @@
|
||||||
([raw-routes]
|
([raw-routes]
|
||||||
(router raw-routes {}))
|
(router raw-routes {}))
|
||||||
([raw-routes opts]
|
([raw-routes opts]
|
||||||
(r/router raw-routes (merge {:compile rc/compile-request-coercers} opts))))
|
(r/router raw-routes (merge {:compile coercion/compile-request-coercers} opts))))
|
||||||
|
|
||||||
(defn match-by-name!
|
(defn match-by-name!
|
||||||
"Logs problems using console.warn"
|
"Logs problems using console.warn"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
"Provides integration to hash-change or HTML5 History
|
"Provides integration to hash-change or HTML5 History
|
||||||
events."
|
events."
|
||||||
(:require [reitit.core :as reitit]
|
(:require [reitit.core :as reitit]
|
||||||
[reitit.core :as r]
|
|
||||||
[reitit.frontend :as rf]
|
[reitit.frontend :as rf]
|
||||||
[goog.events :as gevents])
|
[goog.events :as gevents])
|
||||||
(:import goog.Uri))
|
(:import goog.Uri))
|
||||||
|
|
@ -59,9 +58,10 @@
|
||||||
el
|
el
|
||||||
(recur (.-parentNode el)))))))
|
(recur (.-parentNode el)))))))
|
||||||
|
|
||||||
(defn- event-target [event]
|
(defn- event-target
|
||||||
"Read event's target from composed path to get shadow dom working,
|
"Read event's target from composed path to get shadow dom working,
|
||||||
fallback to target property if not available"
|
fallback to target property if not available"
|
||||||
|
[event]
|
||||||
(let [original-event (.getBrowserEvent event)]
|
(let [original-event (.getBrowserEvent event)]
|
||||||
(if (exists? (.-composedPath original-event))
|
(if (exists? (.-composedPath original-event))
|
||||||
(aget (.composedPath original-event) 0)
|
(aget (.composedPath original-event) 0)
|
||||||
|
|
@ -176,7 +176,7 @@
|
||||||
(href history k params nil))
|
(href history k params nil))
|
||||||
([history k params query]
|
([history k params query]
|
||||||
(let [match (rf/match-by-name! (:router history) k params)]
|
(let [match (rf/match-by-name! (:router history) k params)]
|
||||||
(-href history (r/match->path match query)))))
|
(-href history (reitit/match->path match query)))))
|
||||||
|
|
||||||
(defn push-state
|
(defn push-state
|
||||||
"Sets the new route, leaving previous route in history."
|
"Sets the new route, leaving previous route in history."
|
||||||
|
|
@ -186,7 +186,7 @@
|
||||||
(push-state history k params nil))
|
(push-state history k params nil))
|
||||||
([history k params query]
|
([history k params query]
|
||||||
(let [match (rf/match-by-name! (:router history) k params)
|
(let [match (rf/match-by-name! (:router history) k params)
|
||||||
path (r/match->path match query)]
|
path (reitit/match->path match query)]
|
||||||
;; pushState and replaceState don't trigger popstate event so call on-navigate manually
|
;; pushState and replaceState don't trigger popstate event so call on-navigate manually
|
||||||
(.pushState js/window.history nil "" (-href history path))
|
(.pushState js/window.history nil "" (-href history path))
|
||||||
(-on-navigate history path))))
|
(-on-navigate history path))))
|
||||||
|
|
@ -199,6 +199,6 @@
|
||||||
(replace-state history k params nil))
|
(replace-state history k params nil))
|
||||||
([history k params query]
|
([history k params query]
|
||||||
(let [match (rf/match-by-name! (:router history) k params)
|
(let [match (rf/match-by-name! (:router history) k params)
|
||||||
path (r/match->path match query)]
|
path (reitit/match->path match query)]
|
||||||
(.replaceState js/window.history nil "" (-href history path))
|
(.replaceState js/window.history nil "" (-href history path))
|
||||||
(-on-navigate history path))))
|
(-on-navigate history path))))
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@
|
||||||
(let [coercers (coercion/response-coercers coercion responses opts)]
|
(let [coercers (coercion/response-coercers coercion responses opts)]
|
||||||
{:leave (fn [ctx]
|
{:leave (fn [ctx]
|
||||||
(let [request (:request ctx)
|
(let [request (:request ctx)
|
||||||
response (:response ctx)]
|
response (:response ctx)
|
||||||
(let [response (coercion/coerce-response coercers request response)]
|
response (coercion/coerce-response coercers request response)]
|
||||||
(assoc ctx :response response))))})))})
|
(assoc ctx :response response)))})))})
|
||||||
|
|
||||||
(defn coerce-exceptions-interceptor
|
(defn coerce-exceptions-interceptor
|
||||||
"Interceptor for handling coercion exceptions.
|
"Interceptor for handling coercion exceptions.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
(ns reitit.swagger-ui
|
(ns reitit.swagger-ui
|
||||||
(:require [clojure.string :as str]
|
#?(:clj (:require [reitit.ring :as ring]
|
||||||
[reitit.ring :as ring]
|
[jsonista.core :as j])))
|
||||||
#?@(:clj [
|
|
||||||
[jsonista.core :as j]])))
|
|
||||||
|
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(defn create-swagger-ui-handler
|
(defn create-swagger-ui-handler
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,10 @@
|
||||||
(defn- swagger-path [path opts]
|
(defn- swagger-path [path opts]
|
||||||
(-> path (trie/normalize opts) (str/replace #"\{\*" "{")))
|
(-> path (trie/normalize opts) (str/replace #"\{\*" "{")))
|
||||||
|
|
||||||
(defn create-swagger-handler []
|
(defn create-swagger-handler
|
||||||
"Create a ring handler to emit swagger spec. Collects all routes from router which have
|
"Create a ring handler to emit swagger spec. Collects all routes from router which have
|
||||||
an intersecting `[:swagger :id]` and which are not marked with `:no-doc` route data."
|
an intersecting `[:swagger :id]` and which are not marked with `:no-doc` route data."
|
||||||
|
[]
|
||||||
(fn create-swagger
|
(fn create-swagger
|
||||||
([{::r/keys [router match] :keys [request-method]}]
|
([{::r/keys [router match] :keys [request-method]}]
|
||||||
(let [{:keys [id] :or {id ::default} :as swagger} (-> match :result request-method :data :swagger)
|
(let [{:keys [id] :or {id ::default} :as swagger} (-> match :result request-method :data :swagger)
|
||||||
|
|
@ -95,11 +96,11 @@
|
||||||
(strip-top-level-keys swagger))]))
|
(strip-top-level-keys swagger))]))
|
||||||
transform-path (fn [[p _ c]]
|
transform-path (fn [[p _ c]]
|
||||||
(if-let [endpoint (some->> c (keep transform-endpoint) (seq) (into {}))]
|
(if-let [endpoint (some->> c (keep transform-endpoint) (seq) (into {}))]
|
||||||
[(swagger-path p (r/options router)) endpoint]))]
|
[(swagger-path p (r/options router)) endpoint]))
|
||||||
(let [map-in-order #(->> % (apply concat) (apply array-map))
|
map-in-order #(->> % (apply concat) (apply array-map))
|
||||||
paths (->> router (r/compiled-routes) (filter accept-route) (map transform-path) map-in-order)]
|
paths (->> router (r/compiled-routes) (filter accept-route) (map transform-path) map-in-order)]
|
||||||
{:status 200
|
{:status 200
|
||||||
:body (meta-merge swagger {:paths paths})})))
|
:body (meta-merge swagger {:paths paths})}))
|
||||||
([req res raise]
|
([req res raise]
|
||||||
(try
|
(try
|
||||||
(res (create-swagger req))
|
(res (create-swagger req))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(ns reitit.bide-perf-test
|
(ns reitit.bide-perf-test
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.core :as reitit]
|
[reitit.core :as reitit]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [suite title]]
|
||||||
|
|
||||||
[bidi.bidi :as bidi]
|
[bidi.bidi :as bidi]
|
||||||
[ataraxy.core :as ataraxy]
|
[ataraxy.core :as ataraxy]
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
(ns reitit.calf-perf-test
|
(ns reitit.calf-perf-test
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
|
||||||
[ring.util.codec]
|
[ring.util.codec]
|
||||||
[reitit.impl]
|
[reitit.impl]
|
||||||
[clojure.edn :as edn]
|
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
[reitit.core :as r]))
|
[reitit.core :as r]))
|
||||||
|
|
||||||
|
|
@ -24,11 +22,10 @@
|
||||||
|
|
||||||
|
|
||||||
(defn test! [f input]
|
(defn test! [f input]
|
||||||
(do
|
|
||||||
(println "\u001B[33m")
|
(println "\u001B[33m")
|
||||||
(println (pr-str input) "=>" (pr-str (f input)))
|
(println (pr-str input) "=>" (pr-str (f input)))
|
||||||
(println "\u001B[0m")
|
(println "\u001B[0m")
|
||||||
(cc/quick-bench (f input))))
|
(cc/quick-bench (f input)))
|
||||||
|
|
||||||
(defn h11 [id type] {:status 200
|
(defn h11 [id type] {:status 200
|
||||||
:headers {"Content-Type" "text/plain"}
|
:headers {"Content-Type" "text/plain"}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
(ns reitit.coercion-perf-test
|
(ns reitit.coercion-perf-test
|
||||||
(:require [clojure.test :refer [deftest testing is]]
|
(:require [criterium.core :as cc]
|
||||||
[criterium.core :as cc]
|
[reitit.perf-utils :refer [bench! suite title]]
|
||||||
[reitit.perf-utils :refer :all]
|
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[spec-tools.core :as st]
|
[spec-tools.core :as st]
|
||||||
[muuntaja.middleware :as mm]
|
[muuntaja.middleware :as mm]
|
||||||
[muuntaja.core :as m]
|
|
||||||
[jsonista.core :as j]
|
[jsonista.core :as j]
|
||||||
[reitit.ring.coercion :as rrc]
|
[reitit.ring.coercion :as rrc]
|
||||||
[reitit.coercion.spec :as spec]
|
[reitit.coercion.spec :as spec]
|
||||||
|
|
@ -91,7 +89,7 @@
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
(doseq [coercion [nil (->NoOpCoercion) spec/coercion]]
|
(doseq [coercion [nil (->NoOpCoercion) spec/coercion]]
|
||||||
(suite (str (if coercion (protocol/get-name coercion))))
|
(suite (str (if coercion (coercion/-get-name coercion))))
|
||||||
(let [routes ["/api"
|
(let [routes ["/api"
|
||||||
["/ping" {:parameters {:body {:x int?, :y int?}}
|
["/ping" {:parameters {:body {:x int?, :y int?}}
|
||||||
:responses {200 {:body {:total pos-int?}}}
|
:responses {200 {:body {:total pos-int?}}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
(ns reitit.cors-perf-test
|
(ns reitit.cors-perf-test
|
||||||
(:require [reitit.perf-utils :refer :all]
|
(:require [reitit.perf-utils :refer [b!]]
|
||||||
[ring.middleware.cors :as cors]))
|
[ring.middleware.cors :as cors]))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
(ns reitit.go-perf-test
|
(ns reitit.go-perf-test
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [suite title]]
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
[reitit.trie :as trie]
|
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
(ns reitit.impl-perf-test
|
(ns reitit.impl-perf-test
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [suite]]
|
||||||
[ring.util.codec]
|
[ring.util.codec]
|
||||||
[reitit.impl]
|
|
||||||
[reitit.impl :as impl])
|
[reitit.impl :as impl])
|
||||||
(:import (java.net URLDecoder URLEncoder)))
|
(:import (java.net URLDecoder URLEncoder)))
|
||||||
|
|
||||||
|
|
@ -23,11 +22,10 @@
|
||||||
|
|
||||||
|
|
||||||
(defn test! [f input]
|
(defn test! [f input]
|
||||||
(do
|
|
||||||
(println "\u001B[33m")
|
(println "\u001B[33m")
|
||||||
(println (pr-str input) "=>" (pr-str (f input)))
|
(println (pr-str input) "=>" (pr-str (f input)))
|
||||||
(println "\u001B[0m")
|
(println "\u001B[0m")
|
||||||
(cc/quick-bench (f input))))
|
(cc/quick-bench (f input)))
|
||||||
|
|
||||||
(defn url-decode-naive [s]
|
(defn url-decode-naive [s]
|
||||||
(URLDecoder/decode
|
(URLDecoder/decode
|
||||||
|
|
@ -190,5 +188,4 @@
|
||||||
(url-encode!)
|
(url-encode!)
|
||||||
(form-decode!)
|
(form-decode!)
|
||||||
(form-encode!)
|
(form-encode!)
|
||||||
(url-encode-coll!)
|
(url-encode-coll!))
|
||||||
(split!))
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(ns reitit.json-perf
|
(ns reitit.json-perf
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [title]]
|
||||||
|
|
||||||
;; aleph
|
;; aleph
|
||||||
[aleph.http :as http]
|
[aleph.http :as http]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(ns reitit.json-size-perf
|
(ns reitit.json-size-perf
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [title]]
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
[muuntaja.middleware :as mm]
|
[muuntaja.middleware :as mm]
|
||||||
[reitit.coercion.spec]
|
[reitit.coercion.spec]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns reitit.lupapiste-perf-test
|
(ns reitit.lupapiste-perf-test
|
||||||
(:require [clojure.test :refer [deftest testing is]]
|
(:require [reitit.perf-utils :refer [bench!! handler valid-urls]]
|
||||||
[reitit.perf-utils :refer :all]
|
|
||||||
[reitit.core :as reitit]
|
[reitit.core :as reitit]
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(ns reitit.middleware-interceptor-perf
|
(ns reitit.middleware-interceptor-perf
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [title]]
|
||||||
[reitit.middleware :as middleware]
|
[reitit.middleware :as middleware]
|
||||||
[reitit.interceptor :as interceptor]
|
[reitit.interceptor :as interceptor]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
(ns reitit.nodejs-perf-test
|
(ns reitit.nodejs-perf-test
|
||||||
(:require [reitit.perf-utils :refer :all]
|
(:require [reitit.perf-utils :refer [title]]
|
||||||
[immutant.web :as web]
|
[immutant.web :as web]
|
||||||
[reitit.ring :as ring]))
|
[reitit.ring :as ring]))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
[io.pedestal.http.route.definition.table :as table]
|
[io.pedestal.http.route.definition.table :as table]
|
||||||
[io.pedestal.http.route.map-tree :as map-tree]
|
[io.pedestal.http.route.map-tree :as map-tree]
|
||||||
[io.pedestal.http.route.router :as pedestal]
|
[io.pedestal.http.route.router :as pedestal]
|
||||||
[reitit.core :as r]
|
|
||||||
[criterium.core :as cc]))
|
[criterium.core :as cc]))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
@ -592,10 +591,6 @@
|
||||||
["/v1/orgs/:org-id/members/invitation-data/:user-id" :get (constantly "") :route-name :test/route39]]))
|
["/v1/orgs/:org-id/members/invitation-data/:user-id" :get (constantly "") :route-name :test/route39]]))
|
||||||
{:path-info "/v1/orgs/0/members/invitation-data/1" :request-method :get})
|
{:path-info "/v1/orgs/0/members/invitation-data/1" :request-method :get})
|
||||||
|
|
||||||
(require '[io.pedestal.http.route.definition.table :as table])
|
|
||||||
(require '[io.pedestal.http.route.map-tree :as map-tree])
|
|
||||||
(require '[io.pedestal.http.route.router :as pedestal])
|
|
||||||
|
|
||||||
(pedestal/find-route
|
(pedestal/find-route
|
||||||
(map-tree/router
|
(map-tree/router
|
||||||
(table/table-routes
|
(table/table-routes
|
||||||
|
|
@ -640,7 +635,7 @@
|
||||||
router (reitit/router routes)
|
router (reitit/router routes)
|
||||||
reitit-f #(reitit/match-by-path router (:uri %))
|
reitit-f #(reitit/match-by-path router (:uri %))
|
||||||
reitit-ring-f (ring/ring-handler (ring/router opensensors-routes))
|
reitit-ring-f (ring/ring-handler (ring/router opensensors-routes))
|
||||||
reitit-ring-linear-f (ring/ring-handler (ring/router opensensors-routes {:router r/linear-router}))
|
reitit-ring-linear-f (ring/ring-handler (ring/router opensensors-routes {:router reitit/linear-router}))
|
||||||
reitit-ring-fast-f (ring/ring-handler (ring/router opensensors-routes) nil {:inject-router? false, :inject-match? false})
|
reitit-ring-fast-f (ring/ring-handler (ring/router opensensors-routes) nil {:inject-router? false, :inject-match? false})
|
||||||
bidi-f #(bidi/match-route opensensors-bidi-routes (:uri %))
|
bidi-f #(bidi/match-route opensensors-bidi-routes (:uri %))
|
||||||
calfpath-macros-f opensensors-calfpath-macro-handler
|
calfpath-macros-f opensensors-calfpath-macro-handler
|
||||||
|
|
@ -727,7 +722,7 @@
|
||||||
;; 293ns (pre-defined parameters)
|
;; 293ns (pre-defined parameters)
|
||||||
(let [app (ring/ring-handler (ring/router opensensors-routes) {:inject-match? false, :inject-router? false})
|
(let [app (ring/ring-handler (ring/router opensensors-routes) {:inject-match? false, :inject-router? false})
|
||||||
request {:uri "/v1/users/1/devices/1", :request-method :get}]
|
request {:uri "/v1/users/1/devices/1", :request-method :get}]
|
||||||
(doseq [[p r] (-> app (ring/get-router) (r/routes))]
|
(doseq [[p r] (-> app (ring/get-router) (reitit/routes))]
|
||||||
(when-not (app {:uri p, :request-method :get})
|
(when-not (app {:uri p, :request-method :get})
|
||||||
(println "FAIL:" p)))
|
(println "FAIL:" p)))
|
||||||
(println (app request))
|
(println (app request))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns reitit.prefix-tree-perf-test
|
(ns reitit.prefix-tree-perf-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [io.pedestal.http.route.prefix-tree :as p]
|
||||||
[io.pedestal.http.route.prefix-tree :as p]
|
|
||||||
[reitit.trie :as trie]
|
[reitit.trie :as trie]
|
||||||
[criterium.core :as cc]))
|
[criterium.core :as cc]))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(ns reitit.request-perf
|
(ns reitit.request-perf
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
[reitit.perf-utils :refer [title]]
|
||||||
[potemkin :as p]))
|
[potemkin :as p]))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
@ -25,8 +25,7 @@
|
||||||
(-request-method [this])
|
(-request-method [this])
|
||||||
(-path-params [this]))
|
(-path-params [this]))
|
||||||
|
|
||||||
(p/def-derived-map
|
(p/def-derived-map ZeroCopyRequest
|
||||||
ZeroCopyRequest
|
|
||||||
[raw]
|
[raw]
|
||||||
:uri (-uri raw)
|
:uri (-uri raw)
|
||||||
:request-method (-request-method raw)
|
:request-method (-request-method raw)
|
||||||
|
|
@ -42,6 +41,8 @@
|
||||||
:request-method (-request-method raw)
|
:request-method (-request-method raw)
|
||||||
:path-params (-path-params raw)})
|
:path-params (-path-params raw)})
|
||||||
|
|
||||||
|
(defrecord RecordRequest [uri request-method path-params])
|
||||||
|
|
||||||
(defn record-request [raw]
|
(defn record-request [raw]
|
||||||
(->RecordRequest (-uri raw) (-request-method raw) (-path-params raw)))
|
(->RecordRequest (-uri raw) (-request-method raw) (-path-params raw)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
(ns reitit.ring-perf-test
|
(ns reitit.ring-perf-test
|
||||||
(:require [criterium.core :as cc]
|
(:require [criterium.core :as cc]
|
||||||
[reitit.perf-utils :refer :all]
|
|
||||||
[reitit.ring :as ring]))
|
[reitit.ring :as ring]))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(ns reitit.static-perf-test
|
(ns reitit.static-perf-test
|
||||||
(:require [reitit.perf-utils :refer :all]
|
(:require [immutant.web :as web]
|
||||||
[immutant.web :as web]
|
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
|
[reitit.ring.mime :as reitit-mime]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[criterium.core :as cc]
|
[criterium.core :as cc]
|
||||||
[ring.util.response]
|
[ring.util.response]
|
||||||
|
|
@ -48,8 +48,7 @@
|
||||||
(ring.middleware.defaults/wrap-defaults ring.middleware.defaults/site-defaults)))
|
(ring.middleware.defaults/wrap-defaults ring.middleware.defaults/site-defaults)))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
(def server (web/run #'app {:port 3000, :dispatch? false, :server {:always-set-keep-alive false}}))
|
(def server (web/run #'app1 {:port 3000, :dispatch? false, :server {:always-set-keep-alive false}})))
|
||||||
(routing-test))
|
|
||||||
|
|
||||||
(defn bench-resources []
|
(defn bench-resources []
|
||||||
|
|
||||||
|
|
@ -104,4 +103,4 @@
|
||||||
|
|
||||||
;; 106ns
|
;; 106ns
|
||||||
(cc/quick-bench
|
(cc/quick-bench
|
||||||
(reitit.ring.mime/ext-mime-type name reitit.ring.mime/default-mime-types))))
|
(reitit-mime/ext-mime-type name reitit-mime/default-mime-types))))
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
(ns reitit.core-test
|
(ns reitit.core-test
|
||||||
(:require [clojure.test :refer [deftest testing is are]]
|
(:require [clojure.test :refer [deftest testing is are]]
|
||||||
[reitit.core :as r #?@(:cljs [:refer [Match Router]])]
|
[reitit.core :as r #?@(:cljs [:refer [Router]])]
|
||||||
[reitit.impl :as impl])
|
[reitit.impl :as impl])
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(:import (reitit.core Match Router)
|
(:import (reitit.core Router)
|
||||||
(clojure.lang ExceptionInfo))))
|
(clojure.lang ExceptionInfo))))
|
||||||
|
|
||||||
(deftest reitit-test
|
(deftest reitit-test
|
||||||
|
|
@ -241,10 +241,10 @@
|
||||||
(is (= 2 @compile-times))))))
|
(is (= 2 @compile-times))))))
|
||||||
|
|
||||||
(testing "default compile"
|
(testing "default compile"
|
||||||
(let [router (r/router ["/ping" (constantly "ok")])]
|
(let [router (r/router ["/ping" (constantly "ok")])
|
||||||
(let [{:keys [result]} (r/match-by-path router "/ping")]
|
{:keys [result]} (r/match-by-path router "/ping")]
|
||||||
(is result)
|
(is result)
|
||||||
(is (= "ok" (result)))))))
|
(is (= "ok" (result))))))
|
||||||
|
|
||||||
(testing "custom router"
|
(testing "custom router"
|
||||||
(let [router (r/router ["/ping"] {:router (fn [_ _]
|
(let [router (r/router ["/ping"] {:router (fn [_ _]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
(ns reitit.swagger-test
|
(ns reitit.swagger-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer [deftest is testing]]
|
||||||
[reitit.ring :as ring]
|
[reitit.ring :as ring]
|
||||||
[reitit.swagger :as swagger]
|
[reitit.swagger :as swagger]
|
||||||
[reitit.swagger-ui :as swagger-ui]
|
[reitit.swagger-ui :as swagger-ui]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
(ns reitit.frontend.history-test
|
(ns reitit.frontend.history-test
|
||||||
(:require [clojure.test :refer [deftest testing is are async]]
|
(:require [clojure.test :refer [deftest testing is are async]]
|
||||||
[reitit.core :as r]
|
[reitit.core :as r]
|
||||||
[reitit.frontend :as rf]
|
|
||||||
[reitit.frontend.history :as rfh]
|
[reitit.frontend.history :as rfh]
|
||||||
[reitit.frontend.test-utils :refer [capture-console]]
|
[reitit.frontend.test-utils :refer [capture-console]]
|
||||||
[goog.events :as gevents]))
|
[goog.events :as gevents]))
|
||||||
|
|
@ -43,8 +42,8 @@
|
||||||
(gevents/removeAll js/window goog.events.EventType.HASHCHANGE)
|
(gevents/removeAll js/window goog.events.EventType.HASHCHANGE)
|
||||||
|
|
||||||
(async done
|
(async done
|
||||||
(let [n (atom 0)
|
(let [n (atom 0)]
|
||||||
history (rfh/start! router
|
(rfh/start! router
|
||||||
(fn [match history]
|
(fn [match history]
|
||||||
(let [url (rfh/-get-path history)]
|
(let [url (rfh/-get-path history)]
|
||||||
(case (swap! n inc)
|
(case (swap! n inc)
|
||||||
|
|
@ -67,8 +66,8 @@
|
||||||
"go back after replace state")
|
"go back after replace state")
|
||||||
(rfh/stop! history)
|
(rfh/stop! history)
|
||||||
(done))
|
(done))
|
||||||
(do (is false "extra event")))))
|
(is false "extra event"))))
|
||||||
{:use-fragment true})]))))
|
{:use-fragment true})))))
|
||||||
|
|
||||||
(deftest html5-history-test
|
(deftest html5-history-test
|
||||||
(when browser
|
(when browser
|
||||||
|
|
@ -100,12 +99,12 @@
|
||||||
(gevents/removeAll js/window goog.events.EventType.HASHCHANGE)
|
(gevents/removeAll js/window goog.events.EventType.HASHCHANGE)
|
||||||
|
|
||||||
(async done
|
(async done
|
||||||
(let [n (atom 0)
|
(let [n (atom 0)]
|
||||||
history (rfh/start! router
|
(rfh/start! router
|
||||||
(fn [match history]
|
(fn [match history]
|
||||||
(let [url (rfh/-get-path history)]
|
(let [url (rfh/-get-path history)]
|
||||||
(case (swap! n inc)
|
(case (swap! n inc)
|
||||||
1 (do (rfh/push-state history ::frontpage))
|
1 (rfh/push-state history ::frontpage)
|
||||||
2 (do (is (= "/" url)
|
2 (do (is (= "/" url)
|
||||||
"start at root")
|
"start at root")
|
||||||
(rfh/push-state history ::foo))
|
(rfh/push-state history ::foo))
|
||||||
|
|
@ -125,8 +124,8 @@
|
||||||
"go back after replace state")
|
"go back after replace state")
|
||||||
(rfh/stop! history)
|
(rfh/stop! history)
|
||||||
(done))
|
(done))
|
||||||
(do (is false "extra event")))))
|
(is false "extra event"))))
|
||||||
{:use-fragment false})]))))
|
{:use-fragment false})))))
|
||||||
|
|
||||||
(deftest html5-history-link-click-test
|
(deftest html5-history-link-click-test
|
||||||
(when browser
|
(when browser
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue