Fork me on GitHub
#matrix
<
2024-03-31
>
Weathercold19:03:08

Hello, I'm trying out flutter-mx. I cloned https://github.com/kennytilton/flutter-mx-starter, followed the tutorial, ran clj -M:cljd flutter -d linux , but got the following error:

ERROR: Error: unable to find directory entry in pubspec.yaml: /.clojuredart/deps/f10c8917af92d491bc6de51c22066f9e5fcdd3ca4bfcb423d5d6192691d37377/audio/
ERROR: Error: unable to find directory entry in pubspec.yaml: /.clojuredart/deps/f10c8917af92d491bc6de51c22066f9e5fcdd3ca4bfcb423d5d6192691d37377/image/
ERROR: Error: unable to locate asset entry in pubspec.yaml: "fonts/RobotoMono-Thin.ttf".
ERROR: Target debug_bundle_linux-x64_assets failed: Exception: Failed to bundle asset files.
Exception: Build process failed
Looking into .clojuredart/deps/f10c8917af92d491bc6de51c22066f9e5fcdd3ca4bfcb423d5d6192691d37377, there is indeed no audio/, image/ nor fonts/RobotoMono-Thin.ttf, only pubspec.yaml. I manually modified pubspec.yaml and the build succeded, but it gets overwritten every time I run the build command. How to solve this issue?

Weathercold19:03:06

Also, the https://github.com/kennytilton/flutter-mx-starter/blob/e73f479c9cb6177842b8101c5c1016d274d16ace/doc/counter-app.md?plain=1#L187 mentions in-my-context and as-dart-callback, but they seem to have been removed from tilton.fmx.api. What should they be replaced with?

kennytilton23:03:18

as-dart-callback becomes just dart-cb in-my-context becomes within-ctx: Example:

(fx/container
  {:decoration (fx/within-ctx [me context]
                 (m/BoxDecoration .border
                   (m/Border .top (m/BorderSide .width 0.5
                                    .color (.-dividerColor (.of m/Theme context))))))}...etc etc
I will try to sort out the doc ASAP, but feel free to ping me for anything else tha comes up. And if you want to pair for an hour or three to get rolling I will be happy to do so.

Weathercold21:04:02

Thanks for fixing the issue! It works now.

kennytilton22:04:58

🎉 Btw, the starter app is literally meant to be the starting point for an app. If you are just tire-kicking, I suggest grabbing the whole repo so (a) the source is immediately at hand and (b) several dozen examples are also immediately at hand for global searches. Still hoping to review the doc...

kennytilton19:03:32

Let me check that repo out. I have not touched it in months. Lessee, as-dart-callback became the terser dart-cb . I'll have to check in-my-context. Sorry for the bit rot!

kennytilton20:03:09

Hmmm, this entry in pubspec.yaml is a mystery:

matrix:
    path: .clojuredart/deps/f0d26e0fb9c1342eb8f77274162dff30b31e822809d111fa81bb8cadc113d6f3
I will keep digging, but gonna lose that ^^^^ and see if and how it gets created.

kennytilton20:03:49

OK, that matrix path is just part of the normal build process. I have recreated the problem, added both the audio and image directories, no better. btw, you should not have to edit the generated pubspec.yaml. I will dig on, might have to ask for ideas from the CLJD crew.

kennytilton22:03:58

Actually, I now recall a problem with pulling in f/mx commit as a dependency, if assets were involved. Let me carve out an asset-free commit of the latest f/mx and see if that is the problem.

kennytilton23:03:28

OK, I am running flutter-mx-starter directly, not a clone, with this deps.edn:

{:paths     ["src"]
 :deps      {tensegritics/clojuredart
             {:git/url ""
              :sha     "a6bff55cb69298d79869362e8026c65dafb4d417"}
             kennytilton/flutter-mx
             {:git/url ""
              ;; next must be an assetless f/mx SHA, else benign (?) errors thrown
              :sha     "2c4642c30c3ebd1c0ee2ebcf596e9e60850353a9"}}
 :aliases   {:cljd {:main-opts ["-m" "cljd.build"]}}
 :cljd/opts {:kind :flutter
             :main acme.main}}
You can try changing just the f/mx SHA. Now I will see what in-my-context became.

kennytilton23:03:55

I see a my-ctx macro, but I want to research this further and review all that tutorial doc to get it updated.

kennytilton23:03:18

as-dart-callback becomes just dart-cb in-my-context becomes within-ctx: Example:

(fx/container
  {:decoration (fx/within-ctx [me context]
                 (m/BoxDecoration .border
                   (m/Border .top (m/BorderSide .width 0.5
                                    .color (.-dividerColor (.of m/Theme context))))))}...etc etc
I will try to sort out the doc ASAP, but feel free to ping me for anything else tha comes up. And if you want to pair for an hour or three to get rolling I will be happy to do so.