learned that trick from fixi.js
I thought I'd include an example of replacing fetch for anyone that come across this.
const originalFetch = window.fetch;
window.fetch = function(url, options) {
if (url.includes('/api/user')) {
const mockUser = {id: 1, name: 'John Doe', email: 'john@example.com'};
return Promise.resolve(new Response(JSON.stringify(mockUser)));
}
return originalFetch(url, options);
};
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWork... <button hx-get="/foo" hx-on:htmx:config:request="ctx.fetch = myCustomFetch">
Do It
</button>htmx 1 htmx 2 htmx 4
I look forward to version 8 in 2030.
(Meaning there always was a version 3! Just include both htmx1 and htmx2 onto your webpage!)
It seems odd to me to treat these as different properties on their own? might as well keep it as an extension if it is not going to be more deeply integrated and let htmx 4.0 be smaller? Possible I may not be understanding the use case though
We treat everything as integers server-side (because floating point is the devil) and defer all formatting to the client. Implicit cascade means I can change fmt-x="currency:USD:decimals:2" in one place and watch it ripple down the entire table. It's 'maddening' the way CSS is maddening - which is to say, it becomes second nature after you stop fighting it.
That said, I fully understand the support ticket burden. Maybe the real lesson is: implicit inheritance is great when you control the domain (like 'format all money the same way'), but terrible when people want to do arbitrary things at arbitrary levels. I will bear that in mind as I complete genx.software
"Couldn't find the requested release version 4.0.0-alpha."
you can replace the fetch() function used w/ an event callback, etc
should allow you to do pretty much anything w/o any hacks
It sounds like they are referring to hx-swap and not arbitrary javascript callbacks though, and in that case, I don't see why calling JSON.parse() inside htmx (when the content-type is json) is that big of a deal.
1. make an MPA 2. each page is a resource 3. keep a stream open on the current state of that resource 4. ship, touch grass, repeat
Uh, yes? They wrote a literal book about why they think this is important: https://hypermedia.systems/