Readit News logoReadit News
devnull3 commented on The Rise and Fall of Music Ringtones: A Statistical Analysis   statsignificant.com/p/the... · Posted by u/gmays
devnull3 · 6 days ago
There was a time when my main aim of a choosing a certain ringtone was to appear edgy and cool ... and how annoying and wrong was I!

A sample of bad ringtone (auto-tuned baby crying) which was trending back then (2007-2008) was [1]. Thankfully I never used it.

[1] https://www.youtube.com/watch?v=SVvFRzMWdL8

devnull3 commented on Windows XP Professional   win32.run/... · Posted by u/pentagrama
rayiner · 19 days ago
How was it better than Win2K?
devnull3 · 19 days ago
For me the look and feel of Win XP was breath of fresh air compared to Windows 98. WinXP was more user friendly and I was not a power user back then.
devnull3 commented on Windows XP Professional   win32.run/... · Posted by u/pentagrama
devnull3 · 19 days ago
Win XP remains my favourite OS till date. I was in college and getting hands on a pirated copy back then makes me so nostalgic.

There was a cambrian explosion of tools to customize the look and feel. TweakXP pro is the one I remember. All pirated off-course.

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
thefreeman · 22 days ago
Thats... basically what the guy did? He just put the sessionId in the form data instead of a cookie.
devnull3 · 22 days ago
> He just put the sessionId in the form data instead of a cookie.

This does not have the benefit of being usable across different tabs or even closing and re-opening the page. Besides, (a minor point) shoving all the state in the cookie makes code simple i.e. don't have use URL params.

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
sgt · 22 days ago
Doesn't datastar require an async backend? I prefer Django without async.
devnull3 · 22 days ago
Not really. DS v1.0 has HTMX like request/response option as well.

You might need async if there are lot of concurrent users and each of them using long duration SSE. However, this is not DS specific.

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
spiffytech · 22 days ago
Cookies are more appropriate for whole-site or whole-session data. There's no natural segregation of "this cookie belongs to this instance of this form". You could figure that out, but the additional moving parts cut down on the appeal.
devnull3 · 22 days ago
Cookie is what we make of it. For browser, its opaque data anyway.

So, when /upload is requested, the backend in response sets a cookie with a random uploadId (+ TTL). At the backend, we tie sessionId and uploadId.

With every step which is called, we verify sessionId and uploadId along with additional state which is stored.

This means even if the form is opened on a different tab, it will work well.

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
spiffytech · 22 days ago
Unrelated: datastar doesn't use a two-way connection for interaction <-> updates. It uses two unconnected one-way channels: a long-lived long-lived SSE for updates, and new HTTP requests for interaction.

I didn't see guidance in the docs for routing one tab's interaction events to the backend process managing that tab's SSE. What's the recommend practice? A global, cross-server event bus? Sticky sessions with no multiprocessing, and an in-process event bus?

If a user opened the same page in two tabs, how should a datastar backend know which tab's SSE to tie an interaction event to?

devnull3 · 22 days ago
With DS (and HTMX) the backend is the source of truth. In the context of the blog post, the state will be made-up of: step no, file content, file path, etc. This can be stored against the session ID in a database.

So when opened on a different tab, the backend would do authentication and render the page depending on the store state.

In general, the backend must always compare the incoming state/request with stored state. E.g the current step is step 2 but the client can forces it to go to step 4 by manipulating the URL.

DS v1.0 now supports non-SSE (i.e. simple request/response interaction as well) [1]. This is done by setting appropriate content-type header.

[1] https://data-star.dev/reference/actions#response-handling

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
meander_water · 22 days ago
HTMX has out of band updates too [0], what's the differentiator?

[0] https://htmx.org/attributes/hx-swap-oob/

devnull3 · 22 days ago
In DS, with SSE you can paint different parts of the page with ease. So in this case, it can update <form> and <label> separately. So instead of one update the backend fires 2. There is not separate marker or indicator for OOB.

I think it is best seen in examples on DS website.

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
devnull3 · 22 days ago
> Challenge 2: Passing data down each step

Why not use cookies?

devnull3 commented on HTMX is hard, so let's get it right   github.com/BookOfCooks/bl... · Posted by u/thunderbong
devnull3 · 22 days ago
This should be trivial with the HTMX alternative: datastar [1]

In datastar the "Out Of Band" updates is a first class notion.

[1] https://data-star.dev

u/devnull3

KarmaCake day722August 2, 2021View Original