What's the minimum amount of JavaScript can a web application get away with?
John Alcher
Posted on September 25, 2018
So I was reading about "bloated" applications and how we, especially web developers, pull in dependencies like it's nothing since a modern computer can handle it just fine. The concern is that we're sacrificing too much (?) performance for convenience that it may come back to haunt us and it's time we take performance in front of our priorities again. With some thinking, I can see the appeal of both sides β though the latter one I think is more ideal and is the topic that I'd like to ask all of you about.
Case in point: MyFaceTweetSter
The year is 2005. MyFaceTweetSter (MFTS) has risen as the king of Social Media networks. They're reeling in millions in revenue, every college kid uses it, and the CEO can already see a movie being directed about his company a few years down the line. This is all good until Tom ZukerDorsey made a crucial mistake: as he was refactoring MFTS' inbox.php
script, he accidentally used in_array ($needle , $haystack)
. (Which is in the wrong order. Or is it? IDK even know). This apparently rips open a void in the timespace plane, freezing the whole MFTS building in time. PHP4 is pretty wild.
Fast forward to 2018, and the timespace void has been filled. Tom is back alive, and is looking to reclaim his throne. He booted up his Windows XP computer, quickly researched WTH is going on in the dev community, and decided to port MFTS in a <modern-mvc-framework />
. It took him a month (2 weeks spent negotiating since MyFaceTweetSter.com
is expired and held for ransom) and he's ready for launch!
"Whoa whoa whoa, hold on!", said Justin Timberlake, his main investor. "Every dev and their dogs uses JavaScript today. How about we hire the guys from dev.to and consult them so we can get up to speed with the JS ecosystem?". So here's where we come in. We'll try to modernize the UX of MFTS without pulling in every packge in npmjs.com
. So currently, every action triggers a page reload as expected in a traditional web app. The core functionalities are as follows:
## The Usuals
- Registration
- Authentication
- Feedback forms
- etc.
## Friends
- Search through the users
- Send a "friend request" to a user
- "Unfriend" a user
## Posts
- A user can make a post (with photos / embedded media)
- A chronological list of posts are presented in the home page
- Paginated with 10 posts each
- A user can like/unlike a post
- A user can comment on a post
## Messaging
- A user can send a message to one of their friends
- A user can reply to a message sent to them
- The messages are displayed as "threads"
## Profile
- A user can upload a "profile picture"
- A user can put in their personal information to be display in their profile
- A user can update the said information
- A user can browse through their friends profile
<!-- Feel free to add more "core" features! -->
Which of these do you think are good candidates for using JavaScript? What's the minimum we can go whilst still providing good UX? Would MFTS, granting their huge following a decade ago, be able to compete with today's social media platforms without using JS at all?
Posted on September 25, 2018
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.