> js frameworks don't mean you can't do stuff on the server anymore though.
I know. But it's mostly to compensate for latency and related issues that were created by their own front-end code. Meanwhile HTML templates have been a thing for well over 20 years already. There's nothing really new or revolutionary about it that you couldn't achieve with some engineering in the first place. Slashdot for example has been doing that forever using Perl, which is widely regarded as one of the slowest scripting languages out there. And yet there's this thing called the "Slashdot effect" which they themselves never succumbed to.
Personally, I have nothing against dynamically loaded HTML, *after* the page loads. Like if you're paging through content in a single page app, or fetching the next level of a very wide/deep set of submenus, or stuff like that. But my personal feeling is to avoid JavaScript like the plague whenever possible. It's nothing against JS per se. I actually really like JS. But it get's waaay overused to do stuff that was entirely routine with server side templates and static site generation like 20 years ago, and the end result is nothing better, just bloat and latency. Also it doesn't generally play nice with accessibility for screen readers and so on. But that's just me. I knee jerk despise JS frameworks whenever there's already a tried and true old school way to do the same thing. I feel like a lot of the JS framework developers are just reinventing the wheel with a new marketing package on top to justify their jobs and try to stay relevant long past their best-buy date.
@toiletpaper js frameworks don't mean you can't do stuff on the server anymore though. And idunno. I feel like you need to do. Both stuff in the client and on the server. I don't particularly like Ruby on rails for example. If you look at stuff like Hey. You click a button and it takes a second and then when it shows up in your browser it like loads in crap and snaps into place. I think they even take in multiple actions of you clicking a button before the server made the stuff.
@toiletpaper well I was just experimenting with styles to get it looking a very specific I want.. It's mostly just a top bar with 5 buttons and then a repeating background.
I have not thought about do I break it into livewire components that I can change individually or how do it do it... I basically just copied the whole page, changed the page title and what button was using my top-bar-button-active blade component. Just to see.
I'm rewatching that YT vid I pasted, and I notice that the wire:navigate feature is doing something similar to what the mcmaster-carr website does, except instead of waiting for the person to click the link, they load the HTML content on mouseover. It reminds me of the old days of using javascript to preload images (which I still do) for multiple pages of a gallery, etc.
Anyway, I guess you'll be better off using what is appropriate to your situation. I was just making an off the cuff remark because it seems a lot of JS frameworks out there are trying to reinvent the wheel to compensate for issues of their own creation.
@toiletpaper lol. Well I dont know what solution I want to go with. I think I will just make a lot more livewire components. And make it more interactive overall. Just like hiding page loads is silly... For actually for Design reasons. It would make sense if you saw it lol.
I want to try wire navigate though... Once I am home. And yes also watch that video. It's about the site I wanted to look at anyways.
@toiletpaper if there is another solution to not have flashes of white and the elements loading in unstyled. Of course I would use that. I just didn't look at that yet. I just saw this randomly out of coincidence and I think it would work for that issue.
Hmm. It's hard to say what the issue is without directly seeing the pages in question, but if the problem is FOUC, then yeah as you said you can do <html style="display:none"> and then reset that to display:initial in the final stylesheet or an inline style after the </body>.
Personally I never see that problem. Probably because, firstly, I load my external CSS synchronously in the head, or inline. I also I don't load that much content dynamically, which can cause the browser to rerender a bunch of times. I don't load too much content into a single page, which creates visible latency when pages load. I also use caching and other techniques to speed up rendering of static content.
But there are a whole bunch of possible reasons that could occur, and most of the time it's just poor design ime. It's hard to say exactly what the issue is without seeing it and fucking around with it for an afternoon.
@toiletpaper yes. But I want to prevent it from flashbanging the user with the white background and also don't want it to show unstyled elements while it's loading the rest. That looks ugly and stupid. My current solution is just show a full screen loading screen but that is really annoying.
This is like a middle ground between a real single page app and normal website with pages.
That sound like a consequence of bad web-design. I guess you could add more bad web-design to act as a work around, but if the content is under your control, better to implement some good web-design to fix the problem to start with.