Skip to content
Snippets Groups Projects
  • Noah Moss's avatar
    dfd93579
    Bump shadow-cljs to 2.19.6 (#24647) · dfd93579
    Noah Moss authored
    * Bump shadow-cljs
    
    This lets us use the template tag functionality
    
    ```
    add experimental support for creating js template strings
    
    used like str but emits native JS `` template
    
      (js-template "foo" (+ 1 2) "bar")
    
    emits the literal
    
      `foo${(1 + 2)}bar`
    ```
    
    But this required a few changes on our side as well.
    
    Required for this:
    
    -- LOGGING
    
    Bumped glogi
    ```diff
       ;; new stuff
    -  [lambdaisland/glogi "1.0.106"]]
    -
    +  [com.lambdaisland/glogi "1.1.144"]]
    ```
    Annoying because it had a group name change due to Clojars policy. This
    had the same error as us below. That's why I'm hopeful that it will
    actually just work.
    
    There were some changes with the Google Closure library with things not
    included or referenceable. So I just removed these imports and the
    typehints that used them. We'll need to verify that this still works but
    both compiling for dev and release (with advanced compilation)
    work. Still possible there will be some runtime errors but i'm hopeful
    there wont be. We can grab a jar from CI and poke around
    
    ```shell
    ❯ npx shadow-cljs compile app
    shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
    shadow-cljs - connected to server
    [:app] Compiling ...
    [:app] Build completed. (100 files, 0 compiled, 0 warnings, 1.65s)
    
    metabase on  nm-all-options-formatting [$!+?] via :coffee: v17.30 on :cloud:
    
      metabase-query took 2s
    ❯ npx shadow-cljs release app
    shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
    shadow-cljs - connected to server
    [:app] Compiling ...
    [:app] Build completed. (100 files, 30 compiled, 0 warnings, 28.04s)
    ```
    
    ```diff
                 [lambdaisland.glogi.console :as glogi-console])
    -  (:require-macros metabase.shared.util.log)
    -  (:import goog.debug.Logger
    -           goog.debug.Logger.Level))
    +  (:require-macros metabase.shared.util.log))
    ```
    
    ```diff
    @@ -37,4 +35,4 @@
     (defn is-loggable?
       "Part of the impl for [[metabase.shared.util.log/js-logp]] and [[metabase.shared.util.log/js-logf]]."
       [logger-name level]
    -  (.isLoggable ^Logger (log/logger logger-name) ^Level (log/levels level)))
    +  (.isLoggable (log/logger logger-name) (log/levels level)))
    ```
    
    -- WARNINGS ABOUT shadowing `abs`
    
    -  [medley "1.3.0"]
    +  [medley "1.4.0"]
    
    Similar to what we bumped for the backend. ClojureScript 1.11.x has an
    `abs` function.
    
    * use update-keys and update-vals in cljs
    
    * bump clj-kondo in CI
    
    Co-authored-by: default avatardan sutton <dan@dpsutton.com>
    Bump shadow-cljs to 2.19.6 (#24647)
    Noah Moss authored
    * Bump shadow-cljs
    
    This lets us use the template tag functionality
    
    ```
    add experimental support for creating js template strings
    
    used like str but emits native JS `` template
    
      (js-template "foo" (+ 1 2) "bar")
    
    emits the literal
    
      `foo${(1 + 2)}bar`
    ```
    
    But this required a few changes on our side as well.
    
    Required for this:
    
    -- LOGGING
    
    Bumped glogi
    ```diff
       ;; new stuff
    -  [lambdaisland/glogi "1.0.106"]]
    -
    +  [com.lambdaisland/glogi "1.1.144"]]
    ```
    Annoying because it had a group name change due to Clojars policy. This
    had the same error as us below. That's why I'm hopeful that it will
    actually just work.
    
    There were some changes with the Google Closure library with things not
    included or referenceable. So I just removed these imports and the
    typehints that used them. We'll need to verify that this still works but
    both compiling for dev and release (with advanced compilation)
    work. Still possible there will be some runtime errors but i'm hopeful
    there wont be. We can grab a jar from CI and poke around
    
    ```shell
    ❯ npx shadow-cljs compile app
    shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
    shadow-cljs - connected to server
    [:app] Compiling ...
    [:app] Build completed. (100 files, 0 compiled, 0 warnings, 1.65s)
    
    metabase on  nm-all-options-formatting [$!+?] via :coffee: v17.30 on :cloud:
    
      metabase-query took 2s
    ❯ npx shadow-cljs release app
    shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
    shadow-cljs - connected to server
    [:app] Compiling ...
    [:app] Build completed. (100 files, 30 compiled, 0 warnings, 28.04s)
    ```
    
    ```diff
                 [lambdaisland.glogi.console :as glogi-console])
    -  (:require-macros metabase.shared.util.log)
    -  (:import goog.debug.Logger
    -           goog.debug.Logger.Level))
    +  (:require-macros metabase.shared.util.log))
    ```
    
    ```diff
    @@ -37,4 +35,4 @@
     (defn is-loggable?
       "Part of the impl for [[metabase.shared.util.log/js-logp]] and [[metabase.shared.util.log/js-logf]]."
       [logger-name level]
    -  (.isLoggable ^Logger (log/logger logger-name) ^Level (log/levels level)))
    +  (.isLoggable (log/logger logger-name) (log/levels level)))
    ```
    
    -- WARNINGS ABOUT shadowing `abs`
    
    -  [medley "1.3.0"]
    +  [medley "1.4.0"]
    
    Similar to what we bumped for the backend. ClojureScript 1.11.x has an
    `abs` function.
    
    * use update-keys and update-vals in cljs
    
    * bump clj-kondo in CI
    
    Co-authored-by: default avatardan sutton <dan@dpsutton.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.