membrane

genekim 2023-03-02T19:58:32.816129Z

@smith.adriane Holy cow. I managed to get all of the Fulcro RAD machinery working (well, shambling is probably a better word. 🙂 . Am now dealing with membrane hanging on show! and show-sync! — I’ll get a video posted shortly. Some windows even showing up.

phronmophobic 2023-03-02T19:59:34.747229Z

👍 I have a bit of time today if you want to pair to help get you up and running.

genekim 2023-03-02T20:17:36.453499Z

https://capture.dropbox.com/bvwuKkfzjyX64bzO OMG, that would be fabulous! Anytime after 30m from now and before 3pm would work! Here’s a quick description of current state. I’ll check code into repo as well, but this is so shaky, I don’t expect you’ll be able to reproduce anything. Actually, let me work on giving you exact steps to reproduce. 5m.

phronmophobic 2023-03-02T20:19:35.301359Z

I'll check out the video, but if it's hanging while trying to show the window, it's most likely that something is blocking on the main thread.

genekim 2023-03-02T20:26:09.752559Z

https://capture.dropbox.com/FWLj5jx0XSF3slrz

phronmophobic 2023-03-02T20:43:52.805249Z

It looks like something is updating. What do you mean by hanging?

genekim 2023-03-02T20:44:20.937319Z

REPL session never returns from sync show.

genekim 2023-03-02T20:44:48.676999Z

I have to break the evaluation to get repl prompt back. Is that expected behavior?

phronmophobic 2023-03-02T20:45:16.476899Z

Yes. The sync versions are mainly when running from app main. It will block until you close the window.

genekim 2023-03-02T20:46:27.753329Z

Oh!!! Wonderful! Umm, the main issue is that the current rows “var” in current state is still empty. Isn’t being… gosh, I don’t even know the words. Isn’t being passed in.

genekim 2023-03-02T20:48:42.889259Z

I’m available anytime now. Will be putting in more code to figure out what the “component state” actually is…. DM me whenever you’re ready.

genekim 2023-03-02T20:50:22.699909Z

props (the map being passed in to defsc component) is nil. Don’t know what that means…

phronmophobic 2023-03-02T20:52:30.624059Z

It's been quite a while since I've looked into this so I don't exactly remember how all the pieces fit.

genekim 2023-03-02T20:53:19.766229Z

I’ve been using Fulcro for 3 years, and I still don’t know how all the pieces fit. Gimme 5m: doing a simpler component to render a story/article. That will teach me something about how this works…

phronmophobic 2023-03-02T20:58:10.754129Z

I seem to be missing a namespace: com.example.components.database-queries

genekim 2023-03-02T20:58:46.442689Z

Oh. You also need to get the back-end working. Here. Let me start a video of the full startup sequence from scratch.

genekim 2023-03-02T21:02:16.095209Z

https://capture.dropbox.com/At5m9cSN30ccMCbi Puzzling over something, but here’s the video on how to startup

genekim 2023-03-02T21:02:23.166119Z

less than 2m.

genekim 2023-03-02T21:02:25.608259Z

2m long

genekim 2023-03-02T21:02:50.506749Z

• use datomic alias when starting up • go to datomic/development.clj • run (restart) That gets the backend running.

genekim 2023-03-02T21:07:43.523469Z

FWIW, I think the data is all there. I just don’t understand how components actually get rendered. 🙂 Wanna jump on a call, and see if we can get the Fulcro machinery to issue queries and get its data/state loaded?

genekim 2023-03-02T21:08:58.230609Z

Maybe bound it to 30m — if we can’t get it running, maybe we ask if Tony can jump in and give us some pointers…

genekim 2023-03-02T21:10:14.552049Z

…sorry for barfing more stuff here… What seems to be missing. We should be passing in “client/app” somewhere, which contains all the state, which components query.

phronmophobic 2023-03-02T21:19:32.957149Z

I think membrane fulcro tries to wrap all that up for you

phronmophobic 2023-03-02T21:19:58.135269Z

I'm making a cup of coffee, but I'll be ready after that.

phronmophobic 2023-03-02T22:01:25.674419Z

https://book.fulcrologic.com/#_rendering_with_initial_state

genekim 2023-03-02T23:28:02.644519Z

@smith.adriane OMG, Fulcro RAD report is working!!!! My question: when I update the defsc form and reload, the view doesn’t update. (Maybe I just need to go back to the dev-view? Gotta admit: I’m a little foggy-headed now, and probably should leave this alone until tomorrow. But exciting!) https://capture.dropbox.com/SWpwbu5Gc2OAtY0K

🎉 1
genekim 2023-03-02T23:44:21.252929Z

https://capture.dropbox.com/8A3FEU5kiBi4EGz0 Complete demo of how to run — things to note! • when you manually get the RAD report running (I show you how — it’s a report/run and report/start), the view updates! That’s amazing! It shows that Fulcro updates are making it to membrane. • The mystery: when you update a defsc component, it doesn’t trigger an update. I wonder how we can trigger that? (I will look into Fulcro docs and see if live coding update/experience works in your TODO demo.)

phronmophobic 2023-03-03T00:18:24.643859Z

> • The mystery: when you update a defsc component, it doesn’t trigger an update. I wonder how we can trigger that? (I will look into Fulcro docs and see if live coding update/experience works in your TODO demo.) I believe renders get triggered from fulcro so you need to trigger a rerender when you redefine a component. I'm not sure where you ended up putting the render-root! function, but you'll need to call that after you redefine a component. Not sure what the best way to make it easy to automatically rerender when you define a component. Maybe either a macro that wraps defsc, some repl middleware, or add watches on the component vars.

genekim 2023-03-03T00:19:35.613779Z

I tried manually rendering, but that didn’t seem to do anything. I will look into it again when I get home. And I was just reading this! :) https://github.com/thiru/clj-reloader/blob/master/src/reloader/core.clj

genekim 2023-03-03T00:21:27.421439Z

In the meantime, thinking of just adding a counter to force a refresh every second. :)

genekim 2023-03-03T00:24:33.065769Z

(That probably won’t work. I think it requires remounting the component — I was banging away on that when I had to step away.. will look at it. I think hot code reload is what I’ll work on next. What’s so compelling about membrane is how immediate everything is.)

genekim 2023-03-03T03:06:43.446719Z

Got live-reloading to work! 50m video posted: Some triumphant moments! • 17m: got rows rendering • 23m: got row numbers working • 27m: rendering all 7000 stories! https://capture.dropbox.com/YaC4HT24weWLR1WE

genekim 2023-03-03T03:07:20.035339Z

Got stuck trying to figure out why report isn’t paginating, instead rending all 7K entries. 🙂 Wrapping up soon, but so fun!

genekim 2023-03-03T18:03:28.308259Z

PS: at around 17m, I finally figured out that I needed apply to get things to render. That was a couple of min trying to figure out what was going wrong.

genekim 2023-03-03T18:08:25.853439Z

(Everything after 30m was me trying to figure out how to get RAD pagination working — I forgot to add a required map key. Oops. not worth watching.)