6 ms·
I thought generating html from function calls went out with the dinosaurs. We back doing it again?
by uhtred 3y ago
I thought generating html from function calls went out with the dinosaurs. We back doing it again?
- uhtred 3y agoI feel like I'm talking to kids who have never used anything that came before react in this thread.
- loloquwowndueo 3y agohttps://htmx.org/ https://htmx.org/ Says otherwise, so does https://blog.appsignal.com/2022/07/06/get-started-with-hotwire-in-your-ruby-on-rails-app.html https://blog.appsignal.com/2022/07/06/get-started-with-hotwi...
- uhtred 3y agoI haven't used htmx but it looks nothing like pyreact. htmx is about adding attributes to html, so again, you are still writing html.
- loloquwowndueo 3y agoHtmx is not only about adding attributes to HTML :) check how responses to requests are expected to contain full or partial HTML instead of, say, json.
- uhtred 3y agoyeah I get that, but the html that is returned from the server doesn't have to be generated with things like html.div(html.p('hello this is a p tag inside a div')) you could still have your html in a template file and parse and return the contents of that.
- cantSpellSober 3y agoWhy?
- nawgz 3y agoHe means API calls, obviously overloaded the term "function calls" a bit In this case, I think it's also clear that most things you'd call an "application" abhor this behavior, which is why heavy clients are so popular, and small shops without frontend engineering talent are making a big push away from heavy clients which raises all the hubbub about HTMX etc
- Izkata 3y agoNo, he meant function calls as opposed to JSX, clarified in another comment.
- resoluteteeth 3y ago> He means API calls, obviously overloaded the term "function calls" a bit No they literally meant generating html like h1() rather than <h1></h1> in something like jsx templates (I initially wasn't sure if they were talking about the model of server side rendering with client side events passed back to the server through a websocket either though)
- uhtred 3y ago> He means API calls, obviously overloaded the term "function calls" a bit lol, no he doesn't
- uhtred 3y agobecause ASP .NET webforms suck to work with
- recursive 3y agoI mean, react does it. It never left. JSX compiles to function calls.
- uhtred 3y agoyes but no one generates html from the function calls directly in react (even though you could if you wanted), they use jsx which is at least a bit like writing html.
- neurostimulant 3y agoFirefox's Devtools uses React and it doesn't use JSX. Example: https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/devtools/client/netmonitor/src/components/MonitorPanel.js#LL203C10-L203C10 https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b... Their reasoning: https://firefox-source-docs.mozilla.org/devtools/frontend/react-guidelines.html#why-no-jsx https://firefox-source-docs.mozilla.org/devtools/frontend/re...
- acemarke 3y agoThat page is very out of date. They did later adopt a build step and switch to using JSX in much of the FF DevTools codebase. As an example, here's the Editor main component (same "latest" commit you pointed to): https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/devtools/client/debugger/src/components/Editor/index.js#L686-L722 https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b... The codebase is a mish-mash of very old-style React+Redux code, with newer files and usages. (I know this because I work at Replay.io, which started as a fork of the FF DevTools source, and we spent all of last year modernizing our fork :) Migrated the entire codebase to TS, ripped out all remaining uses of the ancient `React.DOM` helper functions and converted those to JSX, modernized the 2015-era Redux logic, etc: https://github.com/replayio/devtools/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+merged%3A2022-03-05..2022-11-30+ https://github.com/replayio/devtools/pulls?q=is%3Apr+sort%3A... )
- 3y ago
- shrimpx 3y agoTo be clear, what this comment is talking about is using `p()` and `div()` calls instead of `<p>` and `<div>` tags like in JSX. On first read, I thought by "generating html from function calls" the author was referring the react-style way of building a UI by writing a reactive function that returns HTML.
- Stephen_0xFF 3y agoStill very much alive. This implementation with python, to me, doesn’t look promising, but Elixirs LiveView does.
- innocentoldguy 3y agoLiveView is awesome. We've completely replaced React with LiveView and the user and developer experience is significantly better.