(defn
enforce-figwheel-version-plugin
[opts]
(fn
[msg-hist]
(when-let
[figwheel-version (-> msg-hist first :figwheel-version)]
(when
(not= figwheel-version _figwheel-version_)
(socket/close!)
(.error
js/console
"Figwheel: message received from different version of Figwheel.")
(when
(:heads-up-display opts)
(go
(<! (timeout 2000))
(heads-up/display-system-warning
"Figwheel Client and Server have different versions!!"
(str
"Figwheel Client Version <strong>"
_figwheel-version_
"</strong> is not equal to "
"Figwheel Sidecar Version <strong>"
figwheel-version
"</strong>"
". Shutting down Websocket Connection!"
"<h4>To fix try:</h4>"
"<ol><li>Reload this page and make sure you are not getting a cached version of the client.</li>"
"<li>You may have to clean (delete compiled assets) and rebuild to make sure that the new client code is being used.</li>"
"<li>Also, make sure you have consistent Figwheel dependencies.</li></ol>"))))))))