Most active commenters

    ←back to thread

    306 points carlos-menezes | 11 comments | | HN request time: 1.435s | source | bottom
    Show context
    tjoff ◴[] No.41893322[source]
    Industry will do absolutely anything, except making lightweight sites.

    We had instant internet in the late 90s, if you were lucky enough to have a fast connection. The pages were small and there were barely any javascript. You can still find such fast loading lightweight pages today and the experience is almost surreal.

    It feels like the page has completely loaded before you even released the mousebutton.

    If only the user experience were better it might have been tolerable but we didn't get that either.

    replies(6): >>41893360 #>>41893625 #>>41893919 #>>41894650 #>>41895649 #>>41896257 #
    1. OtomotO ◴[] No.41893360[source]
    I am currently de-javascripting a React app of some project I am working on.

    It's a blast. It's faster and way more resilient. No more state desync between frontend and backend.

    I admit there is a minimum of javascript (currently a few hundred lines) for convenience.

    I'll add a bit more to add the illusion this is still a SPA.

    I'll kill about 40k lines of React that way and about 20k lines of Kotlin.

    I'll have to rewrite about 30k lines of backend code though.

    Still, I love it.

    replies(3): >>41893417 #>>41893847 #>>41904214 #
    2. NetOpWibby ◴[] No.41893417[source]
    Nature is healing. Love to see it.
    3. pushupentry1219 ◴[] No.41893847[source]
    Honestly I used to be on the strict noscript JavaScript hate train.

    But if your site works fast. Loads fast. With _a little_ JS that actually improves the functionality+usability in? I think that's completely fine. Minimal JS for the win.

    replies(3): >>41893980 #>>41894499 #>>41894626 #
    4. OtomotO ◴[] No.41893980[source]
    Absolutely.

    I want the basic functionality to work without JS.

    But we have a working application and users are not hating it and used to it.

    We rely on modals heavily. And for that I added (custom) JS. It's way simpler than alternatives and some things we do are not even possible without JS/WASM (via JS apis to manipulate the DOM) today.

    I am pragmatic.

    But as you mentioned it, personally I also use NoScript a lot and if a site refuses to load without JS it's a hard sell to me if I don't know it already.

    5. starspangled ◴[] No.41894499[source]
    What do you use that good javascipt for? And what is the excessive stuff that causes slowness and bloat? I'm not a web programmer, just curious.
    replies(2): >>41895569 #>>41895617 #
    6. selimnairb ◴[] No.41894626[source]
    Building a new app at work using Web Components and WebSockets for dynamism. I’m using Bulma for CSS, which is still about 300KiB. However, the site loads instantly. I’m not using a Javascript framework or bundler or any of that (not even npm!), just vanilla Javascript. It’s a dream to program and I love not having the complexity of a framework taking up space in my brain.
    7. graemep ◴[] No.41895569{3}[source]
    Two examples that come up a lot for me:

    1. filtering a drop down list by typing rather than scrolling through lots of options to pick one 2. Rearranging items with drag and drop

    The excessive stuff is requiring a whole lot of scripts and resources to load before you display a simple page of information.

    replies(1): >>41897193 #
    8. _heimdall ◴[] No.41895617{3}[source]
    My rule of thumb is to render HTML where the state actually lives.

    In a huge majority of cases I come across that is on the server. Some things really are client-side only though, think temporary state responding to user interactions.

    Either way I also try really hard to make sure the UI is at least functional without JS. There are times that isn't possible, but those are pretty rare in my experience.

    9. LtWorf ◴[] No.41897193{4}[source]
    Doesn't the combo box input field already do this?
    replies(1): >>41902809 #
    10. graemep ◴[] No.41902809{5}[source]
    You are right, it does.

    A better example would be dynamically loading the list of options where it is very long and loading the entire list would make the page size much larger.

    11. wwalexander ◴[] No.41904214[source]
    Check out mcmaster.com for an example of a highly optimized website using JS strictly to improve performance.