News for hackers. Stuff that matters.
Re:Htmx 2.0.0 has been released by unsupp0rted on Tuesday June 18, 2024 @07:15AM (#40716374)
Isn’t that moving code around, not deleting it?
Re:Htmx 2.0.0 has been released by dlisboa on Tuesday June 18, 2024 @07:20AM (#40716415)
Most likely that code already existed server-side and was duplicated client-side. It's what usually happens since frontend code can't enforce invariants.
Re:Htmx 2.0.0 has been released by simonbarker87 on Tuesday June 18, 2024 @10:15AM (#40718128)
Near enough exactly this
Re:Htmx 2.0.0 has been released by waivek on Tuesday June 18, 2024 @06:31PM (#40722772)
Could you elaborate on what you mean by "frontend code can't enforce invariants" ?
Re:Htmx 2.0.0 has been released by dlisboa on Wednesday June 19, 2024 @12:28PM (#40729795)
Frontend code can be easily bypassed or changed so you can't trust it to keep the state of your application in good condition. Nothing prevents me from picking the same username as someone else if there is no server-side code stopping it. Nothing prevents me from replying to a deleted comment if I don't check with the server.

That means that any validation that you do client-side you need to repeat server-side. Any business logic that you have client-side you also need to repeat server-side.