Isomorphic JavaScript

Isomorphic JavaScript, also known as Universal JavaScript, describes JavaScript applications which run both on the client and the server.

## Contents

* 1 Mechanism
* 2 Name
* 3 Benefits
* 4 Frameworks
* 5 References

## 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 is sent to the client. While 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 client web page is first requested from the server, 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 immediately. 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][5]

## Benefits

* Better user experience: By rendering important parts of the application with the real data on the server-side, an isomorphic application can show a meaningful initial page. On the other hand, client rendering application can’t show any meaningful information until it fetches all external data it needs. In the meantime, the only thing a user will see is a loading indicator.
* Faster overall loading time: Although an isomorphic application will be slower in responding an initial page compared to a client rendering application (as it fetches data and renders more markups on the server-side before responding), overall completion time to the final user interface is faster because data access on the server-side is much faster than client-side API requests.
* More predictable SEO and Site Indexing: In order to index content that JavaScript apps render on client-side, Googlebot must run those JavaScript apps inside a full browser environment and capture the rendered DOM. This involves complex browser compatibility issues. Also, because JavaScript apps can make AJAX requests for further rendering, Googlebot must have a policy that controls apps’ network access. These are why getting your JavaScript app indexed properly by Googlebot is still challenging.

## Frameworks

There have been several isomorphic JavaScript frameworks and libraries created, most notably Meteor (framework). Others include Next.js, Nuxt, Rendr, Derby, Miso, Ezel and Catberry.[citation needed]

## References

1. ↑ 1.0 1.1 "Is "Isomorphic JavaScript" a good term?". http://2ality.com/2015/08/isomorphic-javascript.html.
2. ↑ Inc., Nodejitsu. "Scaling Isomorphic Javascript Code | Nodejitsu Inc.". https://blog.nodejitsu.com/scaling-isomorphic-javascript-code/.
3. ↑ AirbnbEng (2013-11-11). "Isomorphic JavaScript: The Future of Web Apps". https://medium.com/airbnb-engineering/isomorphic-javascript-the-future-of-web-apps-10882b7a2ebc.
4. ↑ "Universal JavaScript". 2015-06-08. https://medium.com/@mjackson/universal-javascript-4761051b7ae9.
5. ↑ "Javascript Dates". https://learnshareit.com/javascript-dates/.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Isomorphic JavaScript. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Isomorphic_JavaScript&oldid=245587"