Fork me on GitHub
#re-frame
<
2022-06-03
>
romdoq14:06:04

Does anyone know if there's a way to stop some or all active async-flow-fxes? Eg. if you want to allow the user to reset part of an app to a clean state, but there's an async-flow which may be waiting on a response event from an HTTP request.

emccue01:06:07

Step 1. Please don't use async flow. Step 2. Really depends on the fx - if its an http effect you can conceptually keep around an id for it and cancel it later via another fx. I don't think the off the shelf http-fx supports this, but you can make it somewhat trivially

romdoq08:06:08

@U3JH98J4R thanks, why do you discourage async-flow? What would you suggest instead?

Benjamin15:06:41

jo I'm trying to run a re frame template

Failed to inspect file
  /home/benj/repos/lawn-mower-game/node_modules/highlight.js/lib/languages/isbl.js

it was required from
  /home/benj/repos/lawn-mower-game/node_modules/highlight.js/lib/index.js

Errors encountered while trying to parse file
  /home/benj/repos/lawn-mower-game/node_modules/highlight.js/lib/languages/isbl.js
  {:line 1, :column 1, :message "The file could not be parsed as JavaScript."}
do you recognize this somehow?

Benjamin15:06:00

shadow-cljs.edn

Benjamin15:06:28

{:source-paths ["src" "resources"]

 :nrepl        {:port 3333}

 :dependencies
 [[binaryage/devtools "1.0.4"]
  [reagent "1.1.0"]
  [re-frame "1.3.0-rc2"]
  [day8.re-frame/re-frame-10x "1.2.2"]
  [day8.re-frame/tracing "0.6.2"]]

 :builds       {:app {:target     :browser
                      :output-dir "public/js"
                      :asset-path "/js"

                      :modules    {:main
                                   {:entries [benjamin.lawnmower.core]
                                    :init-fn benjamin.lawnmower.core/init}}

                      :dev        {:compiler-options
                                   {:closure-defines {re-frame.trace.trace-enabled?        true
                                                      day8.re-frame.tracing.trace-enabled? true}}}

                      :release    {:build-options
                                   {:ns-aliases {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}

                      :devtools   {:http-root "public"
                                   :watch-dir "public"
                                   :http-host "0.0.0.0"
                                   :preloads  [day8.re-frame-10x.preload]
                                   :http-port 8000}}}}

p-himik16:06:41

Try using the latest Git version of re-frame-10x. There was an update that I think fixes that error but there hasn't been a new release yet.

Benjamin16:06:00

ah is there a special shadow-cljs way to do that? I tried doing :deps true and add

day8.re-frame/re-frame10x {:git/sha "c3ca2e1d50f9c2b1b4685d71702d1d6ffa195e56"
                                   :git/url "[email protected]:day8/re-frame-10x.git"}
to deps.edn but Error building classpath. Manifest type not detected when finding deps for day8.re-frame/re-frame10x

p-himik16:06:56

Try using https:// instead of git@... for that dep. Also, it's just :sha - not :git/sha.

p-himik16:06:07

So maybe git@... will work just fine with :sha.

p-himik16:06:51

Oh, my bad - :git/sha is a new version, :sha is left for backward compatibility. But no clue what your t.d.a version is - maybe it doesn't have a support for :git/sha.

Benjamin16:06:43

:sha + https works as well but I think :git/sha + ssh also worked. it cloned and afterwards cannot determine the project type

p-himik16:06:04

Ah, dang - re-frame-10x is not a deps.edn-based project. So no luck here. As an alternative, try adding an explicit dependency on superstructor/re-highlight "2.0.1".

Benjamin16:06:34

doesn't sound bad I try

p-himik16:06:11

Nice!

🎉 1
superstructor01:06:44

@U02CV2P4J6S Sorry this issue impacted you, and thanks for helping @U2FRKM4TW. I think if you had upgraded from 1.2.2 to 1.2.8 or later should have been enough to fix it. You shouldn't need to run a git sha. Otherwise if I am mistaken and there is an issue impacting users that is not in a release version I should tag a release ASAP so let me know if that is the case. Thanks

p-himik08:06:25

As far as I understand the issue, it's because https://github.com/superstructor/re-highlight/commit/704a66db960e97d0a2ec5b3773a9fb93a0d8ec04 hasn't made it to a release of re-frame-10x yet.

superstructor18:06:41

Thanks for confirming @U2FRKM4TW That change is in 10x 1.2.8 - https://github.com/day8/re-frame-10x/blob/master/CHANGELOG.md#128-2022-05-22 OP was running 1.2.2 prior to upgrading to git sha I think ?

Benjamin18:06:26

@U0G75S29H yea [day8.re-frame/re-frame-10x "1.2.2"] . I posted the shadow-cljs.edn 🙂

superstructor18:06:20

Ok cool thanks @U02CV2P4J6S I think then I do not urgently need to tag a release.

p-himik18:06:33

Ah, I was reading the commit messages wrong. :D The latest one says "changelog" all lower-case.

👍 1
😄 1