WebDev

keithjgrant,
@keithjgrant@front-end.social avatar

I’m sorry, but I think HTMX is just gross.

A worthwhile experiment, absolutely, but I can’t see myself ever using this for a serious production application. I hope we keep iterating on this before settling for a non-turing complete, directive-driven language that gives Angular 1.0 PTSD flashbacks

#webdev #JavaScript #htmx

sergi,
@sergi@floss.social avatar

@keithjgrant @skwee357 you are correct, it's a simple library, not aimed to replace everything a big framework like Angular or React provides. I recommend reading this essay to better understand when and when not to use it: https://htmx.org/essays/when-to-use-hypermedia/

vintprox,
@vintprox@techhub.social avatar

@sergi @keithjgrant @skwee357

OK, I get what's happening here. Example goes hard out of scope than what HTMX serves. No wonder we get confussed Pikachus around this breathe of fresh air.

sarajw,
@sarajw@front-end.social avatar

My dudes, dudx and dudettes we really need to figure out smartphone font sizes.

I'm only a little bit old and I've only popped my android phone system font up by one level, but it messes up so many links and buttons all over the web.

What is happening? Why is this so broken?

patrickbrosset,
@patrickbrosset@mas.to avatar

@sarajw if you are reporting through the feedback tool, then you can likely add them as attachments. Otherwise, anything you can give me, repro pages, screenshots, code samples, etc… would be great, and I’ll report the issue for you.

sarajw,
@sarajw@front-end.social avatar

@patrickbrosset awesome thank you!

@cheeaun I've just sent along the same screenshots I sent you, in DM

elly,
@elly@front-end.social avatar

I finally finished updating the colour scheme/theme picker on my website. 🎉

Now you can pick a colour scheme of either: auto, light or dark, and then a theme hue.

🔗 https://ellyloel.com

Check it out and tell me how broken it is :blobcatfingerguns:

elly,
@elly@front-end.social avatar

@betterways_dev Huh, I did push up some changes but nothing that would have affected it working or not. I don't think? 🤨 Very confusing.

betterways_dev,

@elly I'm not sure what caused the glitch, but it works now - both on Linux and Android.

btw. nice website, I wish we'll see more people in this space in the future.

evan,
@evan@cosocial.ca avatar

What's the best place to host a single page client-side app in 2023 on one's own domain with SSL?

Is the answer still “GitHub Pages”, or is there something better?

coldfish,
@coldfish@sfba.social avatar

@evan well, for me, I've got a synology NAS that's got a webserver built in. I open up port 80, 443 and set the firewall to port forward there and that's the end of it.

Personally, I have an amazon account and I use cloudfront to proxy my sites, that way I get free ssl and I can scope my port opening to CloudFront's IP

maybeanerd,
@maybeanerd@bumscode.com avatar

@evan I personally use netlify since it's nice to combine with CI/CD, in my experience nicer than GitHub pages.
Best feature: preview deployments of PRs.

I think you should be able to take a look at it as an example implementation without needing to create an account: https://app.netlify.com/sites/diluzio/overview

Edent,
@Edent@mastodon.social avatar

🆕 blog! “Let's build a website using XML!”

It is 2023. XHTML is dead and buried. HTML is a "living standard" with billions of users. So what kind of idiot would want to build a website using XML? Me. I am that idiot. Last year, I launched a "web page" which didn't use HTML. Called, appropriately enough, "YOU DON'T NEED HTML!" That (ab)used […]

👀 Read more: https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/

danjac,
@danjac@masto.ai avatar

@Edent been a long time since I've looked at XSLT.

divclassbutton,
@divclassbutton@hachyderm.io avatar

@doug @tanepiper @Edent Version 4 of XSLT is being specced right now.

https://github.com/qt4cg/qtspecs

VincentTunru,
@VincentTunru@fosstodon.org avatar

Question for the @frontend community:

What benefits would you say Web Components have over a framework's components, besides not being tied to a framework?

VincentTunru,
@VincentTunru@fosstodon.org avatar

@mnmlst @frontend

Combined with CSS modules to scope styles to particular components only (while still being able to take advantage of the cascade if needed), that feels like there's no real difference in terms of composability? Anything I'm overlooking?

mnmlst,

@VincentTunru @frontend yes, css modules handle the scoping quite well in something like jsx. One difference with shadow css is that even element rules from the light dom (e.g., anything in the page’s css reset) is not applied. A common conflict with css component libraries is that they rely on different resets.

In the flip side i find that i end up needing to apply a simple reset in every web component’s css. Would be nice to be able to inherit css rules from another shadow root.

talon, (edited )
@talon@dragonscave.space avatar

Alright, to all my webdevs, hit me. Feel free to reply with reasons, too.

talon,
@talon@dragonscave.space avatar

Oh no I forgot React and Angular whatever will I dooooo

talon,
@talon@dragonscave.space avatar

I wonder how much more performant modern websites would be if people had to be explicit about what gets rendered when and updated how.
presses a key in an edit box
the entire website explodes and redraws

scy,
@scy@chaos.social avatar

I've spent a few days playing around with , and I'd like some insights from people who are using it in production. Doesn't need to be a paid project, but more than just "my pet experiment".

What are you using it for?

Like, to me it feels as if either the backend needs to be really tailored to HTMX, with HTML fragments and custom headers and stuff, or you need to start writing non-trivial amounts of JS in the frontend for anything but the most basic tasks.

pa,
@pa@chaos.social avatar

@scy @odrotbohm sorry, didn’t mean to splain you :)
I was at a similar moment, fuzzing a lot around how to build requests and how to treat the requests from htmx, hoping to find a way that feels elegant.
If you continue to try out things and find a way, I’d be happy to see your approach whatever you find.

scy,
@scy@chaos.social avatar

@pa Accessing form data in a FastAPI endpoint is easier (and comes with validation) if you use Form() by the way:

https://fastapi.tiangolo.com/tutorial/request-forms/

kubikpixel, (edited )
@kubikpixel@chaos.social avatar

I'm a and try learning / , what is the "best" stable distro about? I don't like @manjarolinux any more.

@rockylinux vs. @opensuse

:BoostOK:

inlovewithpda,
@inlovewithpda@chaos.social avatar

@kubikpixel @fedora KDE Plasma also works, but I was never a KDE guy. Personally like gnome more. And this is the great thing about Linux ... you have the choice

kubikpixel,
@kubikpixel@chaos.social avatar

@inlovewithpda @fedora yes‼️ ✌️🤓👍

Edent,
@Edent@mastodon.social avatar

Hey, nerds, how do I align variable length lines so one word is in the same horizontal position?

Eg.

 Try RICE today  
Delicious RICE cooked here  
 Got RICE?  
 RICE is nice!  

I want the RICE to be aligned.

Would be easy with a monospace font, but I need to use variable width.

Any clever thoughts?

jsit,
@jsit@social.coop avatar

@ppk Haha, beautiful. Thanks! Is there a website for the forthcoming book?

ppk,
@ppk@front-end.social avatar

@jsit Nope.

og,

Are there any peeps that can be of some sort of a help?

I’m wanting to get back into web development again and I need to get back in the game.

cornflour,

@og I see I see
You mentioned getting back, that means you used to work in webdev before right? What was it like then for you?

shaedrich,
@shaedrich@mastodon.online avatar

@og Indie labels sounds quite cool 👍🏻

schizanon, (edited )
@schizanon@mas.to avatar

If there was an element that changes it's content when users interact with other elements on the page, what name would it have?

PLEASE NOTE: I am not suggesting that this element needs to exist; I am only asking what it would be called. I'm building a CustomElement, I just want it to have a name that makes sense.

Vote and suggest others in replies. Please boost for reach!

wiverson,
@wiverson@mas.to avatar

@schizanon This is literally the idea behind HTMX. They have a bunch of stuff on this topic. They just add attribute[s] to existing elements.

https://htmx.org/

schizanon, (edited )
@schizanon@mas.to avatar

Round 2; because I've gotten some good suggestions

This <HTML> element updates itself with the result of an HTTP request that some other element on the page made. It can replace, append or prepend it's contents.

What should it be called?

ppk,
@ppk@front-end.social avatar

Do you have a favourite non-obvious use of #css #grid? I'm looking for nice examples for my Grid chapter that will expand beyond "here's how you make a responsive four-column grid"

jfree,
AmeliaBR,
@AmeliaBR@front-end.social avatar

@ppk People often don't think about Grid for overlaid content, like a caption on top of an image.

Also non-obvious when first learning, but incredibly useful: centering a single element in its parent.

tournesol,
@tournesol@peculiar.florist avatar

Je suis assez fan du rendu, même si c’est pas parfait, ça fonctionne et ça me satisfait.

Je suis particulièrement fier la façon dont le site change de disposition en fonction de la taille de l’écran ​:meow_puffy_melt:​

J’ai encore pleins de choses à apprendre sur tout pour optimiser le site mais ça reste vachement cool

Site tournesol.me sur écran moyen. La biographie est au sommet et le reste des cartes est empilé sur plusieurs 2 colonnes
Site tournesol.me sur écran de portable. La biographie est au sommet et le reste des cartes est empilé sur une seule colonne

Theotime812,

@tournesol "J'ai mon cerveau pour ça"

and other jokes you can tell yourself

tournesol,
@tournesol@peculiar.florist avatar

@Theotime812 oui ouiiii ​:blobcat_eyes_owo:​

joelanman,
@joelanman@hachyderm.io avatar

Campaign to deprecate &lt;a&gt; and rename it &lt;link&gt; or maybe &lt;l&gt;
If you need to link to a position on a page you can use id

joelanman,
@joelanman@hachyderm.io avatar

@cferdinandi and theres a lot of deprecated stuff and its not all security, so I think you're overstating that a bit

https://css-tricks.com/why-do-some-html-elements-become-deprecated/

cferdinandi,
@cferdinandi@mastodon.social avatar

@joelanman But those aren't foundationally breaking changes. Deprecating &lt;center&gt; means text looks funny. Deprecating &lt;a&gt; means the very foundation of the web—hyperlinked pages—break.

scy,
@scy@chaos.social avatar

I need to convert to and I'm looking for a tool to do that.

The output should

• preserve line breaks in paragraphs
• not contain additional, unnecessary linebreaks (e.g. 4 empty lines between paragraphs)
• be configurable (e.g. whether to use * or _ for emphasis, or * vs - for unordered lists)
• if possible, allow me to hook into details (e.g. to convert <pre class="shell"> to ```sh)

or . Alternatively, what's a really configurable prettifier?

:BoostOK:

weberc2,
@weberc2@stranger.social avatar

@scy Probably not a helpful response, but I’m pretty sure HTML is Markdown. The latter is a superset of the former AFAIK.

scy,
@scy@chaos.social avatar

@weberc2 All three statements in your post are correct ;P

sarajw,
@sarajw@front-end.social avatar

A question on :

Does anyone check their sites with the device font size set to a stop or two larger or smaller than default?

As I'm pushing 40 and now wearing varifocals, I have put my smartphone's system font size up a level.

This seems to occasionally mess with website layouts, sometimes text wraps in unexpected ways, or is partially hidden.

Sometimes it happens only in app-embedded browsers, not the full mobile browser.

cheeaun,
@cheeaun@mastodon.social avatar

@sarajw for web, I don't really check much since browsers use page zoom instead of font resize.

But I understand that there's OS-level font-resize. Weirdly I had to do font size check a lot when building mobile apps (React Native) due to user base catered towards older folks who changes to very huge font sizes and breaks literally everything. Had to talk with the designers often 😂

sarajw,
@sarajw@front-end.social avatar

@chriskirknielsen I've stripped all of my styling from the one that says test link. It's still the same size. Maybe it's a bug and all <a> tags just don't resize with the rest of the text on Android chromium (in my case, Edge)...

Have tried styling a {} with font-size: inherit and 1rem too, no dice.

Anyone else following the tag seen this? Links not following increased system font size on mobile (android, chromium)?

louis,
@louis@emacs.ch avatar

In the last few days I’m experimenting with substituting CRUD API code with Stored Procedures which directly produce the endpoints JSON as a single-row scalar value. API is then just a wrapper that authenticates, validates input and streams the DB’s JSON directly to the client.

  • No ORMs, no SQL generators etc.
  • All SQL is where it should belong: in the database
  • API does only single „CALL myfunc(…)“ db calls
  • A simple centralised error handler can accurately report errors from the database
  • No weird mixed row/json columns scanning into structs and re-marshalling everything to JSON
  • Codebase is collapsing to 20% (by LOCs)
  • Stored Procedures can use wonderfully declarative SQL code
  • Response times in the microseconds, even for multiple queries, all happens inside the DB

More side effects:

  • the data model can change and evolve without touching the API at all
  • Zero deploys mean zero downtime
  • the API application is so tiny, I could easily switch it to any programming language I want (yes, even Common Lisp) without worrying about available databases libraries, type mapping and rewriting tens of thousands of lines of intermixed language/SQL-code.

The general direction of the dev industry is heading in the opposite direction. More ORMs, more layers, more database abstraction. More weird proprietary cloud databases with each their own limited capabilities and query language.

So you tell me: Is it crazy? Is it wrong? Why do I have doubts despite everything working out beautifully?

dekkzz76,
@dekkzz76@emacs.ch avatar

@louis

more stuff to sell

louis, (edited )
@louis@emacs.ch avatar

Intermediate report on my "Stored Procedure" project (long post).

I've now written 35 stored procedures and functions ( in MySQL ) replacing a massive amount of application code.

MySQL's stored procedure syntax is very capable, I had to write only a few functions to add some JSON conversion comfort. I can use multi-result sets and had to modify the MySQL driver to Go to support OUT parameters, not a big issue.

What I can say is that a really good SQL editor that "understands" your code and provides some intellisense while writing helps a lot. So far I stick with , which also supports syncing the DB schema with Git, so every change can be properly tracked. It has a price tag though.

I've tried MySQL Workbench, DBWeaver, TablePlus, Querious. None of those help with writing stored procedures like DataGrip does.

's MySQL Studio could be another candidate but is Windows-only and painfully slow running with on macOS.

I've replaced really super-ugly dynamically generated SQL code with beautifully pure SQL queries, discovering a lot of bugs during the process. Now, looking at the code, I can see what it does, not just hoping that it will work out. Reminder: I have to work with a complex data model spanning many tables, so dynamically adding JOINs and ORDER BY clauses is not easy and amount to potentially hundreds of test cases. Not with Stored Procedures.

If you are really interested in a big-boy query involving spatial queries (distance from point, bounding box etc.), LATERAL CROSS JOINs and parameterised ordering, check this out:

https://pastebin.com/DKBzR19i

What surprised me most is that MySQL is fast and I mean really fast. In most cases involving complex JOINs over many tables much faster than PostgreSQL (which is everybody's darling, I understand). Having this performance at hand I could replace all hourly-updating MATERIALIZED VIEWs with real-time queries.

Also, MySQL has excellent Spatial functions and a decent FULLTEXT search, I don't miss anything from PostgreSQL right now. Also its native Event scheduler (a cron for SQL), makes table maintenance a breeze. No more separate SQL scripts running in a crontab anymore.

PostgreSQL pg/plsql syntax is bulky, ugly, and hard to read (with::all::those::automatically added::type::casts). MySQL doesn't need this.

What MySQL is not good at: error messages are super-crappy and don't help most of the time ("you have a syntax error, check that your code is correct ..."). So a high level of SQL confidence helps, but documentation is very accessible and will structured.

There is still a long way ahead, I think I've migrated about 50% of the application right now - there are still some complex use cases to solve but I feel confident about this approach.

If you still think about MySQL capabilities in terms of versions 5 or earlier, you will be surprised how far it came with the most recent version 8.

I know Oracle is universally hated in the Fediverse, but: don't forget that most of PostgreSQL recent "let's add hundreds of features every 6 months" party is also mostly driven (funded, developed) by commercial parties looking to lure away Oracle and SQL Server clients.

I can't wait to finish this project and will keep you all posted.


(#)PostgreSQL (let's not make half of the Fediverse angry... 🙂 )

5t3ph,
@5t3ph@front-end.social avatar

📝 New post:
"A Call for Consensus on Semantics"

Partly a rant, minorly educational, mostly a call for help.

https://thinkdobecreate.com/articles/a-call-for-consensus-on-html-semantics/

michelle,
@michelle@front-end.social avatar

@5t3ph Aaaaargghhh yes all of this!!! And I just learned about role=“note”, whelp 🫨 Honestly, I firmly believe HTML is the hardest part of our job

mia,
@mia@front-end.social avatar

@5t3ph 100% mood.

I see this as indictment of browsers as a "user agent". They seem so uninterested in exposing semantics in any interesting ways. Many A11y problems come from browsers failing to expose semantic info for readers. But beyond that: why do we still need a TOC?! The browser has that info, and could expose it on all sites!

If the browser showed us the semantics that would help us use the semantics.

(On the other hand, it's funny to imagine "solving semantics"…)

mahryekuh,
@mahryekuh@fosstodon.org avatar

Hello, front-end developers. Here's your infrequent reminder to make websites that also work on browsers NOT Google Chrome.

Forcing anyone to use Google's glorified spyware is not cool.

alcinnz,
@alcinnz@floss.social avatar

@Natanox @DrHyde @janneke @mahryekuh A couple thoughts on this conversation:

  1. While I think filesystems could have better UX, I reckon understanding that files are a thing is empowering. The only reason it is arcane knowledge is because it has been made so. If people can understand the concept of books they can understand files.

  2. HTML/CSS is incredibly versatile & can work as well for the commandline as it is for GUIs. JS & an over focus on visuals fights against this.

strypey,
@strypey@mastodon.nzoss.nz avatar

@mahryekuh
> websites that also work on browsers NOT Google Chrome

... with graceful fallback when the client can't run JavaScript.

> Forcing anyone to use Google's glorified spyware is not cool

It's like we learned nothing from the dominance of MS Internet Exploiter in the 90s.

mappingsupport,
@mappingsupport@m.ai6yr.org avatar

Got search?

When I searched on: cell phone follow property lines
I got 4.7+ billion hits
The first hit is a PDF for my consulting service.
New personal record for number of hits where one of my things is at the top.

AE4WX,
@AE4WX@mas.to avatar

@ai6yr @mappingsupport I oughtta learn GIS

Geojoek,
@Geojoek@mastodon.hams.social avatar

@kc2ihx @AE4WX

<cough> I am professionally obligated to post a link to my job here: https://sites.google.com/umass.edu/umass-gist

@ai6yr @mappingsupport

SeaFury,

Does anyone have recommendations for a lightweight self hosted alternative to wordpress? I'm done with WP.... I'm at the stage where I'm about to bust out notepad and write some HTML 😂 Please boost for more EYES 👀

wogan,

@SeaFury I've had some success with Laravel + TwillCMS.com . Prior to that I ran an OctoberCMS install (it's great), but I think their pricing model changed recently.

stpaultim,
@stpaultim@fosstodon.org avatar

@dhalucario

I have created a bunch of videos for how to configure sites and use contributed modules.

https://www.youtube.com/channel/UCuIXesHG-9f2RSopjXD6xJA

I'm not aware of video documentation of the API's.

Having said that, the current API's are VERY similar to Drupal 7, so most 7 videos on this topic would probably be pretty accurate.

Here is a link to written API documentation.

https://docs.backdropcms.org/api/backdrop/groups

@NonprofitBackdrop - Can you add anything?

brianleroux,

🌶️🥵 shadowdom is awesome but has many tradeoffs that put it in YAGNI territory and should only be a last resort not a default

(lightdom works great ! it got us here)

davatron5000,
@davatron5000@mastodon.social avatar

@brianleroux YAGNIDOM for the YAGNI gods

brianleroux,

@voxpelli indeed and our experiments have shown behavior is still divergent and, well, just not there yet. I do not like it when tech ppl champion an unimplemented solution to current irl problems so I try to avoid that sandpit.

lazyq2,

Anyone else feels heading ranks (h1 to h6) are meant for documents like MS Word documents/essays and that the HTML spec should have a generic <caption>/<legend> element for UI components like product lists, widgets, article lists, etc.?

In my interpretation <ol><li><a><article><h1>(product name... is the correct structure for a list of product thumbnails wise, but I doubt this is right for in practice.

horuskol,
@horuskol@phpc.social avatar

@lazyq2

A long time ago, as HTML5 and the living standard was coming together, it was proposed that heading levels would reset within an article or a section. This would make sections more "portable" - you could simply extract a section and put it in its own page without having to modify its heading tags.

But for some reason browsers and search engines pushed back on having this - and so we kept the h1-h6 hierarchy as it is.

SteveFaulkner,
@SteveFaulkner@mastodon.social avatar
Edent, (edited )
@Edent@mastodon.social avatar

A #SemanticWeb poll for all my
#HTML friends!

Suppose you have comments on your website. They all have a valid <time> element in them.

Comments are displayed in a nested list, with the oldest first.

Should you use:

tomayac,
@tomayac@toot.cafe avatar

@Edent The second example in the article section of the HTML spec got you there: https://html.spec.whatwg.org/multipage/sections.html#the-article-element.

Edent,
@Edent@mastodon.social avatar

@tomayac you don't expect me to actually read do you?!!?
😆

  • All
  • Subscribed
  • Moderated
  • Favorites
  • webdev
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines