File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
(ns devtools.async
2
2
(:require-macros [devtools.oops :refer [oset ocall]])
3
- (:require [goog.async.nextTick :as next-tick]))
3
+ (:require [goog.async.nextTick :as next-tick]
4
+ [goog.labs.userAgent.browser :as ua]
5
+ [devtools.context :as context]))
4
6
5
7
(defn ^:dynamic available? []
6
8
(exists? js/Promise))
7
9
10
+ (def ^:dynamic fixed-chrome-version-for-async " 65.0.3321" )
11
+
12
+ (defn ^:dynamic needed? []
13
+ (not (and (ua/isChrome ) (ua/isVersionOrHigher fixed-chrome-version-for-async))))
14
+
15
+ (defn ^:dynamic get-not-needed-message []
16
+ (str " cljs-devtools: the :async feature is no longer needed since Chrome " fixed-chrome-version-for-async " , "
17
+ " see https://github.com/binaryage/cljs-devtools/issues/20" ))
18
+
8
19
(def ^:dynamic *installed* false )
9
20
(def ^:dynamic *original-set-immediate* nil )
10
21
35
46
(set! *installed* true )
36
47
(oset js/Error [" stackTraceLimit" ] js/Infinity)
37
48
(install-async-set-immediate! )
49
+ (when-not (needed? )
50
+ (.info (context/get-console ) (get-not-needed-message )))
38
51
true ))
39
52
40
53
(defn uninstall! []
You can’t perform that action at this time.
0 commit comments