News for hackers. Stuff that matters.
Re:RawJS is a better way to call document.createElement() by 8organicbits on Wednesday January 03, 2024 @11:08AM (#38855664)
The demo is here.

https://rawjssample.pages.dev/

I immediately see that it ~hijacks my back button~ fills my back-stack such that I can't use the back button normally. Doesn't look promising.

Re:RawJS is a better way to call document.createElement() by nosefurhairdo on Wednesday January 03, 2024 @11:14AM (#38855761)
Anything that is supposed to replace web UI frameworks needs to be able to perform client side routing. You can argue that the different colors shouldn't represent a push to history, but that's a criticism of the implementation, not the library.
Re:RawJS is a better way to call document.createElement() by 8organicbits on Wednesday January 03, 2024 @11:39AM (#38856128)
Demos should cover the happy path really well. This opens modals that don't have an x to close them. If you click outside the modal, a common alternative way to close modals, it just picks a different color. The background fades to black so you can't see what you are picking. Then the back-stack grows large so you can't even back out of the demo normally. I'm not going to look at the code, even if it looks great this isn't an experience I'd ever want. There just too much basic stuff missing.

Maybe it's just a poor demo, are there better examples?

Re:RawJS is a better way to call document.createElement() by hanniabu on Wednesday January 03, 2024 @11:57AM (#38856380)
Anything that's like a combination of react and a static site generator? Where it has the ability to build a static site but also includes reactivity
Re:RawJS is a better way to call document.createElement() by giancarlostoro on Wednesday January 03, 2024 @11:13AM (#38855740)
I'm not a fan of websites with super huge font. I'm on a 1080, and a lot of the words fit in a smaller font just fine.
Re:RawJS is a better way to call document.createElement() by franky47 on Wednesday January 03, 2024 @11:10AM (#38855699)
The modal when showing a single colour also suffers from backdrop stacking issues, which the back button navigation doesn't undo.

I guess rendering the UI as a function of state still has its merits.

Re:RawJS is a better way to call document.createElement() by datadrivenangel on Wednesday January 03, 2024 @11:10AM (#38855692)
So it implements core SPA functionality?
Re:RawJS is a better way to call document.createElement() by manojlds on Wednesday January 03, 2024 @11:17AM (#38855827)
Why is that bad? That's implementation detail and I would say the right implementation.
Re:RawJS is a better way to call document.createElement() by jhardy54 on Wednesday January 03, 2024 @11:11AM (#38855721)
When you click links it changes the URL, so the back button takes you to the previous URL.

I absolutely hate when pages hijack the back button, but this ain’t it.

Re:RawJS is a better way to call document.createElement() by ncallaway on Wednesday January 03, 2024 @11:14AM (#38855773)
I mean, it’s not a dark pattern hijacking the back button, it’s a bug hijacking the back button.

It’s still a bad experience, though.

Re:RawJS is a better way to call document.createElement() by manojlds on Wednesday January 03, 2024 @11:18AM (#38855836)
It's not hijacking back like it happens with some sites that redirect and such. It's just pushing each color into history.