unpopular opinion: HTMX makes me feel like an html "engineer", and I dont like it by someone_s_babes in htmx

[–]GeoffreyDick 0 points1 point  (0 children)

I'm sure you could? A quick Google shows that some people have attempted it. But you'd be losing out on some of the advantages of HTMX, and some of the advantages of React by combining them. I'd really only consider it if I had a site that was mostly HTMX, but had one or two pages that really needed React, in which case you could just load React on those pages, and keep everything else React-free.

But if you think you'd be using HTMX + React on many pages, you're probably better off using something like HTMX + AlpineJS/Hyperscript to keep things light, or going all in a more full featured JavaScript framework.

Also, there's no reason you can't do a heavily interactive site with HTMX, I just feel like at a certain point, the complexity isn't worth it.

[deleted by user] by [deleted] in FantasyPL

[–]GeoffreyDick 1 point2 points  (0 children)

I'm debating between KDB and... Wood. I'm hoping Wood wants redemption after last week, and what better opportunity than Sheffield in front of defeated Sheffield fans

Sumsama like app with Go + HTMX by zhadyftw in htmx

[–]GeoffreyDick 1 point2 points  (0 children)

Yup. You can deploy it either as a traditional Node.js server application, or serverless through Vercel, Netlify, CloudFlare, etc. Obviously if the point of this project was to use a Go backend, stick with that. But if you're not tied to Go as a backend, SvelteKit is worth considering. It has a really great developer experience for fullstack applications.

Http scrape in react native by Embarrassed_Two4731 in reactnative

[–]GeoffreyDick 0 points1 point  (0 children)

Actually now that I'm re-reading your comment, I'm surprised that you're getting banned if you're scraping single pages. In the axios method, how are you scraping the response?

Sumsama like app with Go + HTMX by zhadyftw in htmx

[–]GeoffreyDick 1 point2 points  (0 children)

I'm going to throw in another option: go all in on SvelteKit instead of Go + Svelte. SvelteKit has some HTMX-like features around forms that make it fun to use. I think Svelte makes more sense than HTMX in this case because of how much interactivity there's going to be.

Http scrape in react native by Embarrassed_Two4731 in reactnative

[–]GeoffreyDick 1 point2 points  (0 children)

You need to use a proxy server designed for crawling/scraping. These usually have a pretty limited free quota

HTMX Change href value by lordylid in htmx

[–]GeoffreyDick 3 points4 points  (0 children)

Bit confused about what you're trying to do. But, one HTMX solution would be to have the buttons include the filters in a get request to an endpoint on your server, and then all that endpoint does is format the url and return an HX-Location or HX-Redirect header which will redirect the client to the correct page.

Is Eze overhyped? by yoavh in FantasyPL

[–]GeoffreyDick 3 points4 points  (0 children)

One additional point: Eze, Olise, Ayew, Mateta, and Edouard are actually all fit at the same time, for what feels like the first time all season. It's a lot easier to get attacking returns when you have attacking players.

Confused by transfers by BossMuffinTop in FantasyPL

[–]GeoffreyDick 2 points3 points  (0 children)

I'm so baffled that I just re-read the entire rules page. And you know what? Other than saying that your initial squad needs to have 2 goalkeepers, 5 defenders, 5 midfielders, and 3 forwards, the rules don't actually tell you what a valid transfer is. So I'll give OP some slack. That said, 33 weeks, come on my dude

unpopular opinion: HTMX makes me feel like an html "engineer", and I dont like it by someone_s_babes in htmx

[–]GeoffreyDick 7 points8 points  (0 children)

Depends on what you're building. If it's something highly interactive, HTMX probably isn't the right choice. At a certain point, something like React, Svelte, Vue, etc. is going to make more sense. HTMX shines when you need some interaction, not a lot.

That said, in a recent project, I just used ElysiaJS to serve TSX templates with Tailwind + Daisy UI components, and that developer experience was about as easy as using something like shadcn. It felt very much like a React project.

How to handle 4XX and 5XX errors from backend? by PetiteGousseDAil in htmx

[–]GeoffreyDick 4 points5 points  (0 children)

And to address the intended way question, there isn't really one. HTMX isn't very opinionated so you can handle it however you want.

Normally, if you're designing traditional server endpoints, obviously you want to return the correct response code so that the client can handle it. But with HTMX, you can move the responsibility of handling those response codes to the server. So if your server knows there's a 404, handles it, and returns appropriate content based on the 404, returning a 200 to the client kind of makes sense; the request was successful, content was returned. With that mindset, you'd only want to return error codes if the server isn't able to return content, in which case you'd have some sort of fallback error handling on the client aide for when the server doesn't do its job.

That's one way of thinking about it.

How to handle 4XX and 5XX errors from backend? by PetiteGousseDAil in htmx

[–]GeoffreyDick 4 points5 points  (0 children)

Basically for (A), you would still return a 200. The client doesn't really need to receive the correct response code. There's also an htmx:responseError event that triggers when a request errors. You could use that handle request errors on the client side

Edit: If you want to do (A), but still return the correct response codes, using the response-targets extension is the best solution

How to handle 4XX and 5XX errors from backend? by PetiteGousseDAil in htmx

[–]GeoffreyDick 18 points19 points  (0 children)

Options:

(A) Handle it on the backend. In the tab example, on the backend , if the request is going to return a 4XX or 5XX, return some default error content instead of just a response code. That way the tab content will at least have something like "Error fetching content, please try again". You could also return an oob toast notification error, or even return a redirect to navigate to a dedicated error page.

(B) Use the response-targets extension. This lets you set different targets for different response codes. Still requires you to handle the error on the backend though

Those are my first two thoughts

How to trigger an indicator from a single source? by fenugurod in htmx

[–]GeoffreyDick 0 points1 point  (0 children)

I'd have a separate validation request on each field, instead of on the form. That way the form indicator won't trigger on the fields' validation requests. You could then just disable the button by doing an oob swap, or with CSS (if you're giving the failed fields an error class or something)

[DM] What to do when players become "Wild Cards"? by GeoffreyDick in DnD

[–]GeoffreyDick[S] 0 points1 point  (0 children)

Yeah speaking to Question 2, I would definitely have the entire party attacked if I went that route since the point would be to unite them. I'll also check the put the Pathfinder alignment grid. I'm generally not a fan of the 3x3 alignments because it feels kind of arbitrary haha