Fork me on GitHub
#hyperfiddle
<
2023-02-27
>
bherrmann04:02:17

fyi: Small electric clojure program to display the unix "fortune" into a web page. https://gist.github.com/bherrmann7/765f4074dfac013527402fa7f4016ee5 This electric clojure is very very cool.

😎 6
Dustin Getz13:02:55

All – help Electric by sending me your demos if you haven't already! I am writing a launch recap blog post. If you don't have a video, tell us what you're working on, here in this thread or by DM!

Dustin Getz17:02:06

Heads up: in master we just landed a changeset that stabilizes uncommon shadow-cljs hot code reloading problems. Also it makes #?(:cljs (:require-macros user.demo-1-hello-world)) no longer needed, you don't have to remember to put it at the top of your files anymore. We think the changeset is stable, would love if more people tested it this week and if you have any hot code reloading issues please tell us!

👍 10
vincent18:02:48

wishlist: built-in analytics

👀 2
markaddleman18:02:06

What kind of analytics are you thinking? Performance? Usage? Workflow?

nakkaya21:02:59

Is there a gist/doc somewhere that shows how to use history and routing with a little more detail? I am currently using an atom, a watch and a condp to handle routing within the app. Now I would like to store some state in the url so I can support reloading/bookmarking and also get browser back/forward working. I could not figure out how it works from going through the examples in src-dev

2
Dustin Getz21:02:10

the hyperfiddle.history module has those features but is highly experimental

Dustin Getz21:02:20

are you looking for a straightforward html5 history integration?

nakkaya21:02:24

> are you looking for a straightforward html5 history integration? Yes nothing complicated just browser back/forward working. My current implementation is,

(e/def !route #?(:cljs (atom ::patients)))
(e/def route (e/watch !route))

;; then in main view

      (condp = route
         ::patients (Patients.)
         ::add-patient (AddPatient.)
         (NotFound.))
also is there a built in mechanism to set/get URL params so I can keep/retrieve additional information about the route within the URL or should I resort to js.

Dustin Getz21:02:53

This has not been tested recently, there may be typos

Dustin Getz22:02:36

Also note this is not public API, we are working on refactoring our git repos so this file may or may not move, just a heads up

Dustin Getz22:02:00

You can definitely use it

nakkaya22:02:50

👍 thank you

Dustin Getz14:03:44

Hey @U5H4U2HEH did you get it working?

nakkaya14:03:35

@U09K620SG I got working a while ago I was gonna post a gist for others but it slipped my mind. Had to modify things a little from the example to get it work but it works as expected.

👍 2
Dustin Getz14:03:22

Would love to see the gist, will turn it into a tutorial

Dustin Getz14:03:37

Feel free to PR to the main repo if you want the github contributor badge

denik23:02:23

trying to run electric from source (current master)

denik23:02:35

getting in cljs

Caused by:
RuntimeException: Can't resolve find-ns

👀 2
2
denik23:02:40

(e/client (dom/div (dom/text "foo")))                     ;; works
  #_(e/server
      (e/client (dom/div (dom/text "foo"))))                ;; breaks

denik05:02:25

works as off this commit

denik05:02:25

commit 9be03dd66f012971716544aa56c197bf5d0a85b2 (HEAD) Author: Dustin Getz <<mailto:[email protected]|[email protected]>> Date: Thu Feb 23 14:15:51 2023 -0500 electric: efficient clocks moved to core

Geoffrey Gaillard06:02:39

We'll look into it and keep you posted

👍 2
denik23:02:55

anything besides clojure -T:build compile-java I need to run before it should work?

2
Dustin Getz23:02:10

that should not be needed

Geoffrey Gaillard06:02:17

I confirm it should not be needed. Looking into it