Can You Afford It? Real-World Web Performance Budgets
51–60 of 130 posts
Re: Can You Afford It? Real-World Web Performance Budgets
#52Earlier quoted context omitted.
"Do we need all this JS?" I know at least one user who is asking this same question. He does not believe it is needed. Is it possible that "what users want" and what developers want may be two different things? Could developers have wants that are unique to developers? Purely anecdotal but I do not know any fellow users who "want javascript". I know many who do not want a number of common annoyances though. And I kno…
How do you notify a user of errors in input without a complete page refresh if you do not use Javascript (ignoring the most basic HTML stuff)? Without at least some scripting capability, you're talking about making the experience worse for the user to the benefit (ease of the request/response model) of the developer. Don't throw the baby out with the bathwater. It is the responsibility of devs to use technology well.…
You can render server-side, then switch it to an ajax post in javascript. On submit, post the form back in ajax (a simple `.serialize()`) and if there's a validation error in the form, return the HTML form back in the response with the validation errors and replace it in the DOM.
Virtually instant feedback, no page reload, no 30 second initial SPA load.
In ASP.Net MVC, for example, this is as trivial as changing the `Layout` property of the page in the controller, the full layout for GETs, no layout in POSTs.
Technically you don't even have to support progressive enhancement, but it's so trivial in most frameworks you may as well.
I believe Rails has a built in turbo feature which essentially does this and more.
Example ts code, though usually put more in to disable double clicks and add a loading spinner:
onSubmit = (e: JQueryEventObject) => {
e.preventDefault();
let $form = $(e.currentTarget);
$.ajax({
type: $form.attr("method"),
url: $form.attr("action"),
data: $form.serialize()
})
.done(() => {
//do something
})
.fail((e) => {
if (e.status == 400) {
$(".js-form-wrapper").html(e.responseText);
this.wireUpControls();
} else {
//handle error
}
})
}
And wire it up on initialize with: $("#your-form").submit(this.onSubmit);Re: Can You Afford It? Real-World Web Performance Budgets
#53It's remarkable how much js gets loaded onto a page (mainly due to libraries) vs. how much of its functions are needed for what the web developer is trying to do. There just is not a whole lot of use cases for the big libraries unless you're doing something really intensive like a drawing app.
Re: Can You Afford It? Real-World Web Performance Budgets
#54Re: Can You Afford It? Real-World Web Performance Budgets
#55Do we need all this JS? I’m starting to look back at classic web development where you had a server rendered mvc style app. There was a controller and templates populated on the server. Every page was a full rerender, but it was small html. Proper caching kept the minimal CSS and images on the client for a regular session under 30 minutes. This seems better. I know we switched because front end experts told us that u…
Re: Can You Afford It? Real-World Web Performance Budgets
#56Do we need all this JS? I’m starting to look back at classic web development where you had a server rendered mvc style app. There was a controller and templates populated on the server. Every page was a full rerender, but it was small html. Proper caching kept the minimal CSS and images on the client for a regular session under 30 minutes. This seems better. I know we switched because front end experts told us that u…
I agree with you for content sites or primarily consumption driven apps but I haven't written one of those in 8 years. I'm currently working on an application that we are having to purposefully keep features out of, not because they are slowing the page down, or increasing TTI, but because we risk offending our business partners by building a one for one replacement of their multi-thousand dollar per seat desktop sof…
As a user it infuriates me when I fill out a long form, hit submit and find out I forgot to select the proper “Mr. Mrs. Ms” title and my password, credit card number and PIN have all be blown away.
As a user I’m willing to pay a few more seconds upfront for snappy and seamless interactions as I use the app.
I think the mistake that is more often committed (and where I myself as a user have less patience) is treating everything that can be accessed via URL as an “app”. If the user is coming to just download bytes, don’t build an app. An app is only justified when a user is coming to manipulate data.
Re: Can You Afford It? Real-World Web Performance Budgets
#57Do we need all this JS? I’m starting to look back at classic web development where you had a server rendered mvc style app. There was a controller and templates populated on the server. Every page was a full rerender, but it was small html. Proper caching kept the minimal CSS and images on the client for a regular session under 30 minutes. This seems better. I know we switched because front end experts told us that u…
Re: Can You Afford It? Real-World Web Performance Budgets
#58> 45% of mobile connections occur over 2G worldwide > 75% of of connections occur on either 2G or 3G this is so important. if you want growth you need to be making a product for growing markets.
The US will add ~$570 billion to its GDP this year. That's equal to 25% of India's entire economy. An increasingly large part of Europe is back to generating solid growth again. Even Japan is showing signs of life. You don't need to focus on 2G markets if there are few customers there for your products.
Re: Can You Afford It? Real-World Web Performance Budgets
#59His argument is based on an example where he puts JS in , when it's been a recommendation for ages to put JS at the very end of .
Re: Can You Afford It? Real-World Web Performance Budgets
#60I run https://discoverdev.io for which I wrote my own SSG framework in python+jinja, I spit out html and push it to netlify's CDN network. It's smooth, I don't have to worry about scaling and it works like a charm! (I could still do a lot of optimisation wrt image compression and minification though)