This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-29
Channels
- # adventofcode (9)
- # announcements (2)
- # aws (78)
- # babashka (55)
- # beginners (97)
- # biff (9)
- # calva (11)
- # cherry (2)
- # cider (8)
- # clerk (7)
- # clj-kondo (6)
- # clj-on-windows (4)
- # clojure (213)
- # clojure-austin (6)
- # clojure-europe (63)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-spec (10)
- # clojure-uk (1)
- # clojurescript (14)
- # clr (2)
- # community-development (3)
- # conjure (14)
- # datomic (2)
- # deps-new (5)
- # dev-tooling (10)
- # editors (3)
- # emacs (3)
- # etaoin (19)
- # events (4)
- # fulcro (71)
- # holy-lambda (20)
- # java (3)
- # jobs (2)
- # leiningen (4)
- # lsp (24)
- # malli (15)
- # membrane (107)
- # music (1)
- # off-topic (29)
- # pedestal (4)
- # polylith (1)
- # portal (2)
- # rdf (5)
- # releases (7)
- # scittle (5)
- # shadow-cljs (8)
- # tools-build (15)
- # tools-deps (6)
- # xtdb (13)
fulcro-rad-semantic-ui has a bug in the container renderer. (container/id-child-pairs children)
should be (container/id-child-pairs container-instance)
Hi Eva. I think the containers are mainly used in the demo, and not heavily tested…they have a number of issues I’m sure. If you could make an issue and describe things better, I’ll see if I can get to it. (line/diff)
I made a Material UI plugin that I'm on the fence about making public so I've been looking through the Semantic UI plugin for inspiration
> I made a Material UI plugin that I'm on the fence about making public so I've been looking through the Semantic UI plugin for inspiration > Hi, @eoogbe — I'd be super interested and would get a ton of value out of checking out your Material UI plugin. @tony.kay Is there a 30s answer to "what is the state of the React Native rendering plugin?" The reason for all these questions/requests: I have been having so much fun writing some simple apps in #membrane by @smith.adriane that I'm finding the temptation to write some tabular data display apps. ...and then tempted to leverage all the fantastic work you've done in Fulcro RAD reports. I must admit, I've been studying the Semantic UI plugin source for a couple of days, pondering the level of effort to just get a working RAD report in Membrane. I've successfully modified the SUI controls before, which was confidence inspiring. But lots of things scare/deter me from jumping into this, including the absence of the Fulcro Inspector, not knowing at all what absence of routes means, how an RAD app would support two rendering plugins (membrane and SUI), etc. But it's been fun to ponder. Thank you, all!
(To clarify: all this is enabled by the fact the @smith.adriane has already built/ported Fulcro that can be used by Membrane — a working defsc
already exists, so I'm presuming that it's possible to just built upon that...)
I readily admit that I don't totally comprehend all the different pieces involved, but I'm happy to share what I do know to see if we can make @U6VPZS1EK’s vision a reality. There's lots of cool stuff in fulcro. It would be great to see if there's a way to leverage it with membrane.
It's been a while, but one of the major hurdles was that most fulcro components rely on HTML. If there are components that use primitives that can be automatically translated to shapes, text, and images, then there might be a big opportunity here. I know some of react native's primitives are closer to membrane's view model.
Fulcro components do not, in fact, rely on HTML. Not sure what you’re referring to there. Depending on the namespaces you use, you can end up with a hard React dependency.
It does expect there to be some kind of rendering alg to exist that allows it to “root render” every frame. React is the tool normally used for that. So, some kind of “vdom” concept has to exist for any target. In terms of the “state of react native”, it worked last time I used it (including electron-based Inspect), but native moves quickly, and I’ve not kept up with it, so it is likely out of date.
I didn't mean that fulcro itself relied on HTML, but that components returned html elements for the most part. Is that not the case?
no. The rendering pipeline is fully pluggable, though it does, by default, want to render from root as a tree
Right, but I couldn't find any existing components that returned anything other than HTML (maybe I wasn't looking hard enough).
everything I’ve written has been for react/native, so yes, all the code from me will be returning react elements, but in native those are not html. They are just elements, which React defines.
Now, if you were to write a react look-alike say for Swing or something, where you output a data structure that could be diff’d against backing mutable components, it would also work just fine.
Cool, as long as it returns something that can be turned into shapes, text, and images (and is much less work than writing a full HTML engine)
Yeah, I wrote a reconciler for a hobby project a few years ago that reconciled to three.js, but I did that as a separate kind of reconciler from the state of the FUlcro app itself.
So Fulcro was doing state management (and React UI for managing the non-3d stuff), but there was a side-reconciler that did the three.js updates from the normalized Fulcro database.
I'm not sure if @U6VPZS1EK’s plan involves using existing components and if those existing components require some soft of HTML engine.
This is great — one plan of attack I had in mind was taking an working Fulcro RAD app, cloning it, and modifying the SUI report.cljc to return not DOM
elements, but membrane ui
, and see how far I can get.
The hope is that by the end, I would have a defsc
component that membrane would actually be able to render. (With plenty of stuff stubbed out that membrane can't immediately handle.)
And I'd build the membrane equivalent of table, td, tr, etc.
I'm just catching up on some Fulcro RAD reading. > Fulcro works quite well on the web, in React Native, and in Electron. Notice that the core of RAD is built around auto-generation of UI, meaning that many features of RAD will work equally well in any of these settings. This sounds very interesting!
No, absolutely no reliance on HTML — converting from DOM elements to membrane UI elements.
Yeah, most of RAD is data loading, paginating, etc. Data management stuff. I think RAD is going to give you a code dependency on React, though, because it outputs defsc
components that support React lifecycle methods. It’s not built on “raw” Fulcro components.
The process: • remove dom ns, so it won't compile any more • one by one, replace all dom elements with membrane ui elements, until it compiles again • have membrane render it Voila. Working Fulcro RAD app on membrane. 😆
It does not.
There are ways to mimic lifecycle events (although no library or documentation support).
No. Think about the terminal TODO app that @smith.adriane wrote. That would be the potential target -- no react there. 😆
So, there’s no need for lifecycle. You can add use-hooks? true
and you’ll get a pure function.
but you’ll still have to have React in package,json because it’ll be required by the various nses…doesn’t mean yo uhave to use it.
And fair warning, the fulcro proof of concept with membrane was pretty minimal, so there might be more support needed on membrane's end. My recollection was that fulcro was pretty good at managing state and returning views. Hopefully membrane can do its part.
from RAD at least. I actually wrote the raw.components and raw.application nses in response to interest from @smith.adriane. 😉 So, those do not use React at all. But if you want RAD you’re going to get a React dependency
Is the RAD stuff cljc? I think the goal was a JVM app. Would the clj stuff pull in react?
but that side is nowhere near as well-tested, since it’s there primarily for SSR, which few ppl do
In my ideal, imagine having working RAD app. add one more dependency for membrane rendering plugin, and now you can get desktop window with RAD report running, No need for shadow-cljs, or browser. That would delight me!
in CLJ the use-hooks?
trick isn’t even necessary. They aren’t real components there. The SSR stuff just returns nested data that code in FUlcro can turn into HTML (server.dom), but it’s just data.
RAD also has explicit call support for starting the state machines that go with reports/forms, so that should work fine as well
You'd have to install the membrane ui plugin in client.cljs. And then REPL, do something like "skia/run #'report-name." What do you think, Tony? am I totally off my rocker?
I'm sure there are some sharp edges on membrane's side, but sounds plausible.
and dynamic routing in Fulcro is the default way to “start” things for RAD, but I don’t know that DR will work right in CLJ
If you want networking you’d have to write your own “remote” implementation for the client in CLJ, but that’s pretty easy
(On DR: honestly, I still don't actually know what DR is... I rely on the RAD Demo code to do all that. :) so, some magic needed to get all that machinery started... Oh, I haven't thought through carefully enough how the CLJ client would build up its state -- I got as far as "RAD report will do the df/load! for me." But many things are fuzzy for me on what that actually means. Your reaction of that being "easy" is reassuring, tho!
and df/load!
requires networking code. http_remote is a component that is only CLJS. So, I lied, not everything I do is CLJC 😄
Just read http_remote.cljs and ape the structure, but convert the networking calls to CLJ stuff
Tony, quick question: is there an example of df/load running on the JVM? Ah, you just answered this. Perfect! That doesn’t seem to difficult! Have a great night all!
@U6VPZS1EK @eoogbe Definitely interested in the MaterialUI plugin as well, I was planning on working on that in the future, but would start using now and contribute if there was already one available
I'm running into an issue with RAD and nested subforms. When creating a subform that contains nested subforms, those nested subforms are given tempids and expanded on-create. These nested subforms are not required data, and, if left empty, prevent saving. I was hoping to find something similar to ::form/autocreate-on-load? false
to control this, but haven't come up with anything yet.
exploring the form create!
options now
Don’t create the edge with anything in it. Make the user press a button to add the optional data. Otherwise you’ll have to customize the top-level validator on your form to make that a valid case AND update your save middleware to handle the case (and not try to create an empty entity)
That's exactly right, and an issue I ran into with a previous application. So, will I need to forgo nesting subforms to achieve this in RAD?
I see the desired behavior happen when existing data is loaded into the subform. In that case, only the nested subforms/edges with data exist, and the rest present a 'Create' button. Perfect! But in the case of creating new data, clicking 'Create' on the top-level subform produces a form where all nested subforms/edges exist, and the user must delete those empty subform entries to successfully save. I've tried a few options, such as ::form-options/default-values
, to no avail.
Default values is supposed to work on that…but I’d have to review things to be able to say exactly how to do it. The intention is for you to have to option for create to either pre-create them or leave them out…are these to-one or to-many?
I use RAD in production, but there are still a number of rough edges and use-cases that I have not personally stressed. Of course the documentation could also use a bit of a boost. Did you look at the RAD book around this? I thought I documented forms pretty well, but I’m sure I missed some things
I've created a PR: https://github.com/fulcrologic/fulcro-rad/pull/101
We can move the convo there. In short, I did a bit of digging yesterday and solved the problem by overriding the default form-machine's add-row
event, essentially duplicating it but modifying the function default-state
in form.cljc
. The docstring for default-state
says that to-one ref's without default value(s) will not be included, but they were!
> I made a Material UI plugin that I'm on the fence about making public so I've been looking through the Semantic UI plugin for inspiration > Hi, @eoogbe — I'd be super interested and would get a ton of value out of checking out your Material UI plugin. @tony.kay Is there a 30s answer to "what is the state of the React Native rendering plugin?" The reason for all these questions/requests: I have been having so much fun writing some simple apps in #membrane by @smith.adriane that I'm finding the temptation to write some tabular data display apps. ...and then tempted to leverage all the fantastic work you've done in Fulcro RAD reports. I must admit, I've been studying the Semantic UI plugin source for a couple of days, pondering the level of effort to just get a working RAD report in Membrane. I've successfully modified the SUI controls before, which was confidence inspiring. But lots of things scare/deter me from jumping into this, including the absence of the Fulcro Inspector, not knowing at all what absence of routes means, how an RAD app would support two rendering plugins (membrane and SUI), etc. But it's been fun to ponder. Thank you, all!