Explorar o código

Update rewrite-edn and hickory deps

shadow workaround for hickory is no longer needed since hickory got node
support
Gabriel Horner %!s(int64=2) %!d(string=hai) anos
pai
achega
7a5310eb5d

+ 2 - 5
deps.edn

@@ -4,9 +4,7 @@
   rum/rum                               {:mvn/version "0.12.9"}
   datascript/datascript                 {:mvn/version "1.3.8"}
   datascript-transit/datascript-transit {:mvn/version "0.3.0"}
-  ;; TODO: bump to mvn/version when released
-  borkdude/rewrite-edn                  {:git/url "https://github.com/borkdude/rewrite-edn"
-                                         :sha     "80f246139b1a43b6f2cbab329521d060ee7c1b7b"}
+  borkdude/rewrite-edn                  {:mvn/version "0.4.6"}
   funcool/promesa                       {:mvn/version "4.0.2"}
   medley/medley                         {:mvn/version "1.4.0"}
   metosin/reitit-frontend               {:mvn/version "0.3.10"}
@@ -18,8 +16,7 @@
   cljs-drag-n-drop/cljs-drag-n-drop     {:mvn/version "0.1.0"}
   cljs-http/cljs-http                   {:mvn/version "0.1.46"}
   org.babashka/sci                      {:mvn/version "0.3.2"}
-  hickory/hickory                       {:git/url "https://github.com/clj-commons/hickory"
-                                         :sha     "a308fafdf1e0483087a105544f2cb190cc3289b0"}
+  org.clj-commons/hickory               {:mvn/version "0.7.3"}
   hiccups/hiccups                       {:mvn/version "0.3.0"}
   tongue/tongue                         {:mvn/version "0.4.4"}
   org.clojure/core.async                {:mvn/version "1.3.610"}

+ 1 - 3
shadow-cljs.edn

@@ -70,9 +70,7 @@
          :closure-defines {frontend.util/NODETEST true}
          :devtools        {:enabled false}
          ;; disable :static-fns to allow for with-redefs and repl development
-         :compiler-options {:static-fns false
-         ;; For custom conditional reading, see https://shadow-cljs.github.io/docs/UsersGuide.html#_conditional_reading
-                            :reader-features #{:node-test}}
+         :compiler-options {:static-fns false}
          :main            frontend.test.frontend-node-test-runner/main}
 
   :publishing {:target        :browser

+ 0 - 12
src/main/frontend/extensions/hickory.cljc

@@ -1,12 +0,0 @@
-(ns frontend.extensions.hickory
-  "A shim for conditional reading of the hickory lib in Node,
-   which requires DOM"
-  (:require #?(:node-test [lambdaisland.glogi :as log]
-               :default   [hickory.core :as hickory])))
-
-#?(:node-test (defn html->hiccup
-                [html]
-                (log/error :exception "Calling hickory from Node test environment is not expected!"))
-   :default (defn html->hiccup
-              [html]
-              (hickory/as-hiccup (hickory/parse html))))

+ 2 - 2
src/main/frontend/extensions/html_parser.cljs

@@ -4,7 +4,7 @@
             [clojure.walk :as walk]
             [frontend.config :as config]
             [frontend.util :as util]
-            [frontend.extensions.hickory :as hickory]))
+            [hickory.core :as hickory]))
 
 (defonce *inside-pre? (atom false))
 (defn- hiccup-without-style
@@ -271,7 +271,7 @@
 (defn convert
   [format html]
   (when-not (string/blank? html)
-    (let [hiccup (hickory/html->hiccup html)
+    (let [hiccup (hickory/as-hiccup (hickory/parse html))
           decoded-hiccup (html-decode-hiccup hiccup)]
       (hiccup->doc format decoded-hiccup))))
 

+ 0 - 2
src/test/frontend/extensions/zotero/extractor_test.cljs

@@ -1,5 +1,3 @@
-;; FIXME
-;; this test is not focusable (unable to feed :node-test as reading feature?)
 (ns frontend.extensions.zotero.extractor-test
   (:require [clojure.edn :as edn]
             [clojure.test :as test :refer [deftest is testing]]