Isomorphic JavaScript
Isomorphic JavaScript, also known as Universal JavaScript, describes JavaScript applications which runs both on the client and the server.
Contents
Mechanism
Isomorphic JavaScript works in the context of a single-page application (SPA). In a typical SPA, most of the application logic, including routing, is encapsulated in a bundled JavaScript file that's sent to the client. Whilst this frees up the server, as it does not have to handle so many requests, it also makes the initial load slow for the client, as the entire application needs to be sent over to the client.
With Isomorphic JavaScript, when a web page is first requested from the client, the view of the page is generated on the server, similar to server-side dynamic web pages, and sent over to the client. The client can then render the view immediate. after the initial view is rendered, the complete SPA is downloaded in the background, and subsequent actions are handled client-side.
Name
The naming of the term 'Isomorphic JavaScript' has been a matter of controversy.[1] The term 'isomorphic' was first coined by Charlie Robbins from Nodejitsu, in one of the company's blog posts.[2] Spike Brehm, a software engineer from Airbnb, wrote another blog post using the same term.[3] However, others have proposed to use the term Universal JavaScript instead.[1][4]
Benefits
There are several benefits to using Isomorphic JavaScript:
- Faster page load
- Search Engine Optimization - since the view is generated on the server, web crawlers no longer need to run JavaScript in order to render the page and index it
Frameworks
There has been several isomorphic JavaScript frameworks created, most notably Meteor and React. Others includes Rendr, Derby, Ezel and Catberry.
References
- ^ a b "Is "Isomorphic JavaScript" a good term?". 2ality. Retrieved 2017-06-15.
- ^ Inc., Nodejitsu. "Scaling Isomorphic Javascript Code | Nodejitsu Inc.". blog.nodejitsu.com. Retrieved 2017-06-15.
- ^ AirbnbEng (2013-11-11). "Isomorphic JavaScript: The Future of Web Apps". Airbnb Engineering & Data Science. Retrieved 2017-06-15.
- ^ Jackson, Michael (2015-06-08). "Universal JavaScript". Michael Jackson. Retrieved 2017-06-15.