This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-07
Channels
- # announcements (32)
- # asami (11)
- # babashka (5)
- # babashka-sci-dev (4)
- # beginners (65)
- # biff (11)
- # calva (35)
- # clerk (2)
- # clj-kondo (14)
- # clj-on-windows (4)
- # clojars (4)
- # clojure (122)
- # clojure-canada (1)
- # clojure-europe (31)
- # clojure-italy (6)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-spec (3)
- # clojure-uk (2)
- # clojurescript (3)
- # core-async (7)
- # core-logic (1)
- # data-science (13)
- # datalog (3)
- # datavis (3)
- # datomic (15)
- # deps-new (4)
- # emacs (34)
- # figwheel-main (1)
- # fulcro (1)
- # funcool (1)
- # holy-lambda (10)
- # lsp (41)
- # malli (24)
- # membrane (5)
- # midje (1)
- # off-topic (5)
- # polylith (3)
- # proletarian (6)
- # re-frame (6)
- # reitit (6)
- # remote-jobs (4)
- # sci (1)
- # shadow-cljs (96)
- # sql (31)
- # testing (23)
- # xtdb (49)
In a frontend context, I'm trying to push-state
but also include an anchor parameter (so e.g. the constructed url is /foo/bar/baz#comment-section
- but I can't figure out how page anchors are handled in reitit, since push-state
accepts only [k params query]
Perhaps you need to do the navigation yourself (implementation in reitit): https://github.com/metosin/reitit/blob/master/modules/reitit-frontend/src/reitit/frontend/history.cljs#L216-L220)
We have our own push-state-by-path
:
(.pushState js/window.history nil <path>)
(rfh/-on-navigate @rfe/history <path>)
with rfh
= reitit.frontend.history
and rfe
= reitit.frontend.easy
When doing spec coercion in reitit i noticed that inst? isn't coerced if the date has more than millisecond precision, eg:
development> (spec-tools.transform/string->date nil "2023-02-07T18:04:18.146333Z")
"2023-02-07T18:04:18.146333Z"
development> (spec-tools.transform/string->date nil "2023-02-07T18:04:18.146Z")
#inst "2023-02-07T18:04:18.146-00:00"
Might make sense to use clojure.instant/read-instant-date in that spec-tools.transfor/string->date?
development> (clojure.instant/read-instant-date "2023-02-07T18:04:18.146111Z")
#inst "2023-02-07T18:04:18.146-00:00"
development> (clojure.instant/read-instant-date "2023-02-07T18:04:18.146Z")
#inst "2023-02-07T18:04:18.146-00:00"
development> (clojure.instant/read-instant-date "2023-02-07T18:04:18.146")
#inst "2023-02-07T18:04:18.146-00:00"
development> (clojure.instant/read-instant-date "2023-02-07T18:04:18.146")
#inst "2023-02-07T18:04:18.146-00:00"
it does bump the required version of clojure to 1.11 though https://github.com/yenda/spec-tools/commit/275fdf92608894cdb6838010b12702cfca6add6e