#nodejs

LIVE

By Suhas Sadanandan, Director of Engineering 

When it comes to performance and reliability, there is perhaps no application where this matters more than with email. Today, we announced a new Yahoo Mail experience for desktop based on a completely rewritten tech stack that embodies these fundamental considerations and more.

We built the new Yahoo Mail experience using a best-in-class front-end tech stack with open source technologies including React, Redux, Node.js, react-intl (open-sourced by Yahoo), and others. A high-level architectural diagram of our stack is below.

image
New Yahoo Mail Tech Stack

In building our new tech stack, we made use of the most modern tools available in the industry to come up with the best experience for our users by optimizing the following fundamentals:

Performance

A key feature of the new Yahoo Mail architecture is blazing-fast initial loading (aka, launch).

We introduced new network routing which sends users to their nearest geo-located email servers (proximity-based routing). This has resulted in a significant reduction in time to first byte and should be immediately noticeable to our international users in particular.

We now do server-side rendering to allow our users to see their mail sooner. This change will be immediately noticeable to our low-bandwidth users. Our application is isomorphic, meaning that the same code runs on the server (using Node.js) and the client. Prior versions of Yahoo Mail had programming logic duplicated on the server and the client because we used PHP on the server and JavaScript on the client.   

Usingefficient bundling strategies (JavaScript code is separated into application, vendor, and lazy loaded bundles) and pushing only the changed bundles during production pushes, we keep the cache hit ratio high. By using react-atomic-css, our homegrown solution for writing modular and scoped CSS in React, we get much better CSS reuse.  

In prior versions of Yahoo Mail, the need to run various experiments in parallel resulted in additional branching and bloating of our JavaScript and CSS code. While rewriting all of our code, we solved this issue using Mendel, our homegrown solution for bucket testing isomorphic web apps, which we have open sourced.  

Rather than using custom libraries, we use native HTML5 APIs and ES6 heavily and use PolyesterJS, our homegrown polyfill solution, to fill the gaps. These factors have further helped us to keep payload size minimal.

With all the above optimizations, we have been able to reduce our JavaScript and CSS footprint by approximately 50% compared to the previous desktop version of Yahoo Mail, helping us achieve a blazing-fast launch.

In addition to initial launch improvements, key features like search and message read (when a user opens an email to read it) have also benefited from the above optimizations and are considerably faster in the latest version of Yahoo Mail.

We also significantly reduced the memory consumed by Yahoo Mail on the browser. This is especially noticeable during a long running session.

Reliability

With this new version of Yahoo Mail, we have a 99.99% success rate on core flows: launch, message read, compose, search, and actions that affect messages. Accomplishing this over several billion user actions a day is a significant feat. Client-side errors (JavaScript exceptions) are reduced significantly when compared to prior Yahoo Mail versions.

Product agility and launch velocity

We focused on independently deployable components. As part of the re-architecture of Yahoo Mail, we invested in a robust continuous integration and delivery flow. Our new pipeline allows for daily (or more) pushes to all Mail users, and we push only the bundles that are modified, which keeps the cache hit ratio high.

Developer effectiveness and satisfaction

In developing our tech stack for the new Yahoo Mail experience, we heavily leveraged open source technologies, which allowed us to ensure a shorter learning curve for new engineers. We were able to implement a consistent and intuitive onboarding program for 30+ developers and are now using our program for all new hires. During the development process, we emphasise predictable flows and easy debugging.

Accessibility

The accessibility of this new version of Yahoo Mail is state of the art and delivers outstanding usability (efficiency) in addition to accessibility. It features six enhanced visual themes that can provide accommodation for people with low vision and has been optimized for use with Assistive Technology including alternate input devices, magnifiers, and popular screen readers such as NVDA and VoiceOver. These features have been rigorously evaluated and incorporate feedback from users with disabilities. It sets a new standard for the accessibility of web-based mail and is our most-accessible Mail experienceyet.

Open source 

We have open sourced some key components of our new Mail stack, like Mendel, our solution for bucket testing isomorphic web applications. We invite the community to use and build upon our code. Going forward, we plan on also open sourcing additional components like react-atomic-css, our solution for writing modular and scoped CSS in React, and lazy-component, our solution for on-demand loading of resources.

Many of our company’s best technical minds came together to write a brand new tech stack and enable a delightful new Yahoo Mail experience for our users.

We encourage our users and engineering peers in the industry to test the limits of our application, and to provide feedback by clicking on the Give Feedback call out in the lower left corner of the new version of Yahoo Mail.

A Breath of Life: Welcome the Brand New Mobile Web Dashboard

We rebuilt another piece of the site with React

Background

A few months ago my colleague Robbie wrote a post about how the Core Web team is introducing a new web stack built on Docker, Node, and React. It is a beautiful vision, but we had only launched one tiny page on that infrastructure. This spring, we used that new stack to rebuild the mobile web dashboard from the ground up. And then we launched it.

Why we did it

We decided on building the mobile dashboard next for a few reasons. First, the dashboard is one of the most important parts of Tumblr—for many people it is their primary window into the content here. Because of that, most things that we develop inevitably touch the dashboard. It was time to raise the stakes.

The desktop dashboard and the mobile apps have been moving forward at a blistering pace, but have you seen the mobile web dashboard? It was stuck in 2015. Nobody ever made features for it because it was a completely separate codebase. We avoided that issue with the rewrite. Since the new version we’re building is responsive, our new mobile web dashboard will eventually also power the desktop web dashboard experience. This’ll make it much easier to maintain feature parity between the desktop and mobile web experiences.

Finally, we wanted to make something a little bit more complex than the image page, and the mobile web dashboard seemed like a good next step. It allowed us to start making authenticated API calls and figuring out how to pass cookies through our new server to and from our API; to think about laying the groundwork for a totally responsive dashboard, so we can eventually launch this for the desktop; to make a testing ground for progressive web app features like web app manifests; to start rendering posts that are backed by the new post format; and to figure out how to slowly roll out the new stack to a consistent, small set of users. We also had a pretty bad performance bug and learned a whole lot about profiling Node. (We plan on writing more in-depth posts about some of these topics soon.)

It is good

And the rewrite turned out really well. Even with more features like pull-to-refresh, a new activity popover, and modern audio and video players, we sped up our DOM content loaded time by 35%! The new page has a lot of modern web standards in it too like srcsets, flexbox, asynchronous bundle loading, and a web app manifest. You can install the mobile web dashboard as a standalone app now. It was also way faster and simpler to write using React than it was on our old PHP/Backbone stack.

We’re really proud of the new mobile web dashboard. We look forward to bringing even more new features to it in the near future, and launching even more pages on our new web infrastructure.

If you think this is cool too, come work with us!

– Paul Rehkugler (@blistering-pree)

Control Chrome from Node.js with Puppeteer ☞ http://bit.ly/2GKUe1y #nodejs #javascript

Control Chrome from Node.js with Puppeteer
http://bit.ly/2GKUe1y

#nodejs #javascript


Post link
Use FeathersJS to build a RESTful API server in Node.js ☞ http://bit.ly/2M0fpAL #nodejs #javascript

Use FeathersJS to build a RESTful API server in Node.js
http://bit.ly/2M0fpAL

#nodejs #javascript


Post link
Building and Securing a Node.js and Express App using Passport.js and Auth0 ☞ http://bit.ly/2YMheDC

Building and Securing a Node.js and Express App using Passport.js and Auth0
http://bit.ly/2YMheDC

#nodejs #javascript


Post link
Build an SMS Event Notifier with Airtable, Standard Library and Node.js ☞ http://bit.ly/33ahn78 #nod

Build an SMS Event Notifier with Airtable, Standard Library and Node.js
http://bit.ly/33ahn78

#nodejs #javascript


Post link
Design Patterns in Node.js: Async/Await ☞ http://bit.ly/2mbzeK3 #nodejs #javascript

Design Patterns in Node.js: Async/Await
http://bit.ly/2mbzeK3

#nodejs #javascript


Post link
Understanding JavaScript Callbacks and best practices ☞ http://bit.ly/2YKcluy #nodejs #javascript

Understanding JavaScript Callbacks and best practices
http://bit.ly/2YKcluy

#nodejs #javascript


Post link
A complete guide to the Node.js event loop ☞ http://bit.ly/33bNB1J #nodejs #javascript

A complete guide to the Node.js event loop
http://bit.ly/33bNB1J

#nodejs #javascript


Post link
How to Send Emails with Node.js ☞ http://bit.ly/2MBU7sJ #nodejs #javascript

How to Send Emails with Node.js
http://bit.ly/2MBU7sJ

#nodejs #javascript


Post link
Javascript Tutorial: Get rid of your messy ☞ http://bit.ly/2luWDG6 #nodejs #javascript

Javascript Tutorial: Get rid of your messy
http://bit.ly/2luWDG6

#nodejs #javascript


Post link
New Node.js 12 features will see it disrupt AI, IoT and more surprising areas ☞ http://bit.ly/2KqxSU

New Node.js 12 features will see it disrupt AI, IoT and more surprising areas
http://bit.ly/2KqxSU6

#nodejs #javascript


Post link
How to enable ES6 (and beyond) syntax with Node and Express ☞ http://bit.ly/2T8EL03 #nodejs #javascr

How to enable ES6 (and beyond) syntax with Node and Express
http://bit.ly/2T8EL03

#nodejs #javascript


Post link
Joi — awesome code validation for Node.js and Express ☞ http://bit.ly/2YErnlr #nodejs #javascript

Joi — awesome code validation for Node.js and Express
http://bit.ly/2YErnlr

#nodejs #javascript


Post link
Tutorial - Add a comment in NodeJS ☞ http://bit.ly/2n7eW4Q #nodejs #javascript

Tutorial - Add a comment in NodeJS
http://bit.ly/2n7eW4Q

#nodejs #javascript


Post link
Tutorials - Move a System File To a New Directory with NodeJS ☞ http://bit.ly/2m9B1zq #nodejs #javas

Tutorials - Move a System File To a New Directory with NodeJS
http://bit.ly/2m9B1zq

#nodejs #javascript


Post link
Better Software Design with Application Layer Use Cases | Enterprise Node.js + TypeScript ☞ http://b

Better Software Design with Application Layer Use Cases | Enterprise Node.js + TypeScript
http://bit.ly/2KwMCRs

#nodejs #javascript


Post link
loading