Cookie Policy

We use cookies to personalize content and to analyze our traffic in order to protect our network. We also use cookies to improve our content. By clicking "Accept", or continuing to use our website, you are agreeing to the storing of cookies on your device, our Terms of Service and Privacy Policy.

Accept

Blogs

Native JavaScript

Written by RentaServer Staff

July 21, 2020~4 min read

Native Javascript

In the past, browser capabilities were lacking and often times not uniform or standard. JQuery a bulky library, was essential for web development and creating fluid website experiences. However, as web technologies continued to progress and conventions continued to be adopted, browsers have created a more robust standard for capabilities. Today, native browser functionality can easily offer the same experience as JQuery but with better performance.

There has been a lot of talk among web development circles on the benefits of running a pure native JavaScript stack in a modern web development era. Web developers have claimed that developing in native JavaScript is fun and just as easy as developing with JQuery. After converting our stack… we can't help but feel that these sentiments are true.

One of the first things considered when we decided to convert our stack was choosing between between the React or Angular frameworks. In other words, choosing between Facebook or Google. This would have restricted us to more or less being followers of the current iteration of technological trend. While we are sure both frameworks are good platforms to develop on, we did not like either. It seemed more or less like picking and betting on the next web development fad. A fad which may only last for a few more years and is dependent on two, admittedly, behemoth sized corporations for upkeep and maintenance. As a company that works with infrastructure as a platform, these options did not make much sense. From an architectural design perspective, there was also no reason to not design our platform at a lower architectural barebones level, instead of the next paradigm or framework in the pyramid of web development dependencies.

Not choosing React or Angular usually still means developing with JQuery and requiring a few JQuery friendly libraries dependent on various JQuery versions. We thought better. Why not remove JQuery and JQuery UI (a pretty big library) as dependencies and just go native?

Web development is no longer in its infancy. As of today, many key native JavaScript features have already been included into the most popular and used web browsers. bPretty much everything can be styled with CSS3 and augmented with native JavaScript. Save for a few things like scrollbars and calendars (IETF standard coming soon!).

Switching to native JavaScript not only meant better and more refined code, a modular code footprint, faster loading times for first time users, but also a faster performing web pages. If there were any errors with JQuery or JQuery UI, we did not have to dig through old code or wait for upstream for a solution. If there were any features we needed, we could build it ourselves or reuse a native JavaScript module. With faster loading times, a good webpacker, and cache busting, our users were effectively guaranteed to have a more homogeneous UX experience. From a business perspective, it also meant a lower overall bounce rate due to page performance.

We were only using a very small subset of JQuery UI but the general performance difference seen below was enormous.

  • A 3 MiB bundled and minimized JavaScript file reduced to less than 200 KiB
  • A total of 30 KiB of bundled and minimized JavaScript transferred during web query
  • A decrease in round-time trips by an average of 30 ms

Adding and compounding all of these performance boosts made the effort for the switch more than worth it.

Some developers may think about the DOM and native JavaScript and instantly balk at the idea of having to do things manually without the comfort of a familiar library. It was ridiculously simple to replace JQuery and JQuery UI and the features they offer with just a few lines of JavaScript and CSS. If your web application depends on JQuery or JQuery UI, we suggest going native a try. You may just find that it is your cup of java. In addition, you would also remove one more layer of a frivolous and out-dated dependency from your end-product!

If you're looking for some native JavaScript tips and templates, take a look here. Some of our JavaScript libraries have also been made open source for the developing community.

Make us your game server provider!

Get Started!