• 2 Posts
  • 37 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle




  • Now I doubt that this is the problem, because those pages shouldn’t become completely blank, but here’s an explanation:

    A single page application is like a native app in the way it behaves, but made with web technologies and manually fit to the browser workflow, in the older, standard approach we just delivered single web pages and maybe added a little interactivity on top with JavaScript so we had routes like these:

    • example.org/index.html
    • example.org/about.html
    • etc.

    Each page is its own html file and you access it with its path.
    Now there is no rule that what goes into the URL bar should match 1 to 1 with the filesystem on the server so you could go on example.org/news.html and actually get served a page that is under 2023/07/28/something-interesting.html, there is logic running on the server that decides that if a client requests the news page, the server should send over today’s news page.
    You’ll see that all the time when you try to go to a page that doesn’t exist anymore and so you are redirected to example.org/404.html saying you asked for some resource, but it wasn’t found.

    In the same vein you can handle these routes on the client , you could send all the content to the user when they enter example.org, but you let JavaScript take care of what to display, so all the text of index, about, etc. is already on your PC and by clicking the links, which will have the same format, maybe minus the .html (though you could absolutely do that before too, just that here it conveys a specific meaning that in fact you aren’t sending requests for html files, but just “routes”):

    • example.org/index
    • example.org/about
    • etc.

    And even if those links appear in your URL bar they have all been resolved on the client with JavaScript, by simply changing the content appearing on the screen and never getting a completely new page, that would have no problem always resolving.

    But when adding state to the mix, where you have something that is really a web app, you can’t always get the same thing back, suppose I have a task list (in reference to technical React example) and create two items, I click on the second and I get example.org/tasks/2, I send you that link and you open the page for the first time on your computer, it won’t work, it will probably fall back to a home route, because your state was different than mine, you had no task 2 yet, this is also called deep-linking. For that to work you have to store that state and since you’re working in the browser you have to rely on its storge APIs, usually there is no storage that is guaranteed to be permanent on a browser, because its settings could affect when/if the storage gets cleared and suddenly I can’t see my task 2 anymore either after some time.







  • Yeah, actually I don’t know how I ended up responding to you, I have since deleted that comment, I meant it for the OP.
    Aside from that, when you’re as experienced as you, you generally don’t end up breaking your system anyway, if one really wanted I think the real good thing to do regardless of distro would be using one of the few packaging solutions that are siloed from the rest system




  • I usually end up in need of redoing a fresh install until it breaks up again.

    That’s common when you start adding random PPAs, running some commands without understanding (we all do 👀) and whatnot, but you can save yourself from reinstalling over and over by using an immutable distribution so at any point you will know what changed in your system and if it breaks you can just roll back to the previous working point and either fix your mistake or wait for a fix from upstream when an issue happens there (this year there were a few kinda major hiccups on Fedora for example).
    I suggest you try one of the Fedora immutable spins (Silverblue, Kinoite, Sericea) or Vanilla OS, though I would hold off from it until Orchid comes out.
    If you want to go all in you can use NixOS, but it takes a lot of reading


  • You can save yourself from reinstalling over and over by using an immutable distribution so at any point you will know what changed in your system and if it breaks you can just roll back to the previous working point and either fix your mistake or wait for a fix from upstream when an issue happens there (this year there were a few kinda major hiccups on Fedora for example).
    I suggest you try one of the Fedora immutable spins (Silverblue, Kinoite, Sericea) or Vanilla OS, though I would hold off from it until Orchid comes out.
    If you want to go all in you can use NixOS, but it takes a lot of reading








  • Everyone talks about the fact that Bash is what it is because it is first and foremost an interactive shell, but nowadays some design decisions are just inexcusable in my opinion, like the awful syntax of common programming constructs, the if in particular, that would only benefit from following how every other language works even if they aren’t meant as shells.
    Some also argue against the non-modularity with the fact that you should use it for only quick and easy stuff, but that’s just an excuse, if the language runtime that comes preinstalled in your system had modern features and sane syntax you would stick to that and save yourself from installing Python/Ruby if they’re not needed; and it is clear that there is a need for modularity, otherwise plugin managers wouldn’t exist, many swear by downloading the scripts directly and sourcing them in the name of “KISS”, but that is just silly when there is a good system set in place that makes it actually easier to manage it all.
    Then there’s the issue of the holy pipelining, that has more or less been overcome by some languages already, this example in Rust shows that it can be easy, so there’s no reason why a terse scripting language couldn’t achieve the same.

    In the end I don’t know what’s holding the landscape back, I noticed Xonsh that looks very interesting, but I never tried it, I wonder if it is POSIX compliant and if that aspect even is so fundamental to the success of a shell