JavaScript on Tumblr (Posts tagged react)

1.5M ratings
277k ratings

See, that’s what the app is perfect for.

Sounds perfect Wahhhh, I don’t wanna
Hi! You may have noticed recently that blog archives look a little different. Spruced up a bit: smoother, faster, fancier. Squarer! You can mix and match filters in a way you never could before. Go ahead! Pick a month and a post type. You deserve...

Hi! You may have noticed recently that blog archives look a little different. Spruced up a bit: smoother, faster, fancier. Squarer! You can mix and match filters in a way you never could before. Go ahead! Pick a month and a post type. You deserve it!

You can even filter the archive by tag now.

image

It’s pretty good! And it’s all possible because the archive has joined the honored ranks of pages running on our new web stack, just like the mobile web dashboard.

And we’re not stopping here! As Tina Turner once said, big wheel keep on turnin’. Come be a part of that wheel.

- Robbie Dawson (@idiot)

computer react squares tag

We’re making Tumblr more accessible!

If you’re an avid user of Tumblr on mobile web, then you might’ve noticed some improvements we made. Bigger font sizes and higher contrast text? Your screen reader actually reads what you hope it would? You’ve guessed it, we’re making Tumblr ✨accessible✨.

Why?

Since we’re rewriting the web, we wanted to make sure we did so with accessibility in mind. I could give you a long description why, but plenty of articles explain better than I can. Put simply: the web should be made useable for everyone.

We began with using the accessibility auditing tool in Google Lighthouse to check the improvements that could be made. Initially, our score wasn’t that great: 62. If you factored in areas that need to be manually checked then our score would have been abysmal. However, we’ve made great strides since then and are on our way to achieving that coveted 💯

We had inaccessible menus and poorly described elements, among other things. Using a tool like VoiceOver or TalkBalk you can see what experiencing Tumblr on mobile web with a screen reader was like. Here’s a gif showing what the mobile web experience on Tumblr was like prior to the changes.

image
image

What we did

Some of the more noticeable improvements we made were introducing design changes to increase readability and making improvements following WAI-ARIA guidelines. We’ll walk through a few other changes we made using React.

Visual order on the page follows DOM order

One of the larger changes we made was to revamp modals and popovers (e.g., the post activity screen). Originally we used React Portals but it isn’t always the most friendly for accessibility. Ideally you want to have elements appear in logical DOM order and Portals provides a way to circumvent that. So, no more Portals!

The user’s focus is directed to new content added to the page

Next step was to provide a way to manage focus. We want to a) direct focus to the modal when it’s opened and b) return focus to the element that opened the fullscreen modal. Using React’s lifecycle methods and refs, this is simple enough to implement. In your modal component:

public targetEl: HTMLElement; // The element used to open the modal
public buttonEl: HTMLElement;

public componentDidMount() {
  // We add an event listener to get the element that opened the modal
  document.addEventListener(‘focus’, this.setOriginalTargetEl, true);
  // We set focus to some element inside your modal
  this.buttonEl.focus();
}

public componentWillUnmount() {
  // Return focus to the element that opened the modal
  if (this.targetEl) {
    this.targetEl.focus();
  }
}

public setOriginalTargetEl = event => {
  // Only set it once to get the initial target
  if (!this.targetEl) {
    this.targetEl = event.relatedTarget;
    document.removeEventListener('focus’, this.setOriginalTargetEl, true);
  }
};

public render() {
  return (
    <div>
      <button ref={(el) => this.buttonEl = el}>
        Back
      </button>
      <div>Your content</div>
    </div>
  );
}

This can make navigation a lot easier.

Tada!

image
image

Of course, we’re still fine-tuning different elements of the site since accessibility is more than just a number. A lot of these changes will be even more noticeable when the new Tumblr dashboard comes to your desktop. There’s still more to come, so keep your eyes open!

Think there’s a way to make Tumblr more accessible? Hit us up at tumblr.com/jobs and come work with us!

    - Nora Mohamed / @nomo

accessibility a11y react javascript tumblr

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

We rebuilt another piece of the site with React

image

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.)

image

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)

javascript react gotta go fast typescript computer nodejs flavortown

Come join us!

If you’ve been following this Tumblr, you’ll likely know that we, the Core Web team, have recently started rewriting and modernizing the Tumblr web platform. This undertaking presents some incredibly exciting opportunities to innovate with lots of fun technologies. We’re working on improving every aspect of the web; the dashboard, the archive, the blog network, you name it.  

Are you a senior JavaScript engineer and wanna be a part of this adventure? Come join Core Web! You’ll help create the building blocks with which a brand new modern Tumblr will be built. Your work will directly impact and define the user experience for millions of users and the development tools for a large number of product engineers across several teams at Tumblr!

image

Originally posted by successfulantfarmer

What you’ll do

We’re looking for an extraordinary senior JavaScript engineer who wants to take on the following challenges:

  • Keep making our build and deployment more delightful and futuristic
  • Help establish norms and standards for how this new web client should be architected, including setting JavaScript, CSS, performance and other best-practices, and introducing/creating the tools to achieve them
  • Internally and externally raising awareness around the work the team is doing by being active in the Open-source and engineering community 
  • Whatever else you think will help us create the highest quality web platform and development experience!

Who we’re looking for

An ideal team member is someone with:

  • Strong JavaScript and CSS fundamentals
  • Experience setting up Continuous Integration / Continuous Deploys
  • Expertise in build tools like Webpack, Parcel (or similar)
  • Pragmatism and the ability to decide what’s “good enough” (while planning ahead and knowing when to iterate)
  • An ability to independently drive projects
  • A desire to innovate and bring new things into the world
  • An understanding of code quality, unit test coverage, and performance
  • Empathy and the desire to elevate those around them
  • The belief that work is just as much about the journey as the destination

Our current toolkit

  • Webpack
  • ES6
  • React and React Router
  • CSS Modules
  • TypeScript
  • Jenkins and Jenkins pipelines
  • Docker
  • Node and Express
  • Kubernetes

If you’re interested, but your background does not include all of the above, please don’t let that hold you back. Let’s talk! To apply, follow the instructions at the bottom of our official job listings page

image

Originally posted by strangememories

We can’t wait to hear from you!

javascript react typescript tumblr.com/jobs flavortown

A Big New Beautiful Future for the Web at Tumblr

In the ten years that Tumblr’s been around, a lot has changed in web technology. We’ve kept up, of course, but it’s always been a process of addition, layering one new technology on top of another. And what we were working with—a custom framework built on top of Backbone, messily entangled with a PHP backend and its associated templates—was becoming unmanageable. Our piecemeal conversions to new technologies meant we had thousands of ways posts were rendered (only a moderate exaggeration). And each of those had to be updated individually to support new features or design changes.

It was time to step back, survey the world of web technology, and clean house in a big way. That we could finally test some of the new tech we’ve been itching to use was just a little bonus.

We started by laying out our goals:

  • A web client codebase fully separated from the PHP codebase that gets its data from the API in the same way our mobile apps do
  • A development environment that’s as painless as possible
  • Dramatically improved performance
  • Isomorphic rendering
  • Robust testing tools
  • Built on a framework with a healthy and active community, with some critical mass of adoption

With those goals in mind, we spent the beginning of the year on research - figuring out what kinds of things people were building web apps with these days, tooling around with them ourselves, and trying to assess if they would be right for Tumblr. We landed, eventually, on React, with a Node server (running Express) to make isomorphism as easy as possible. On top of that, we’re using Cosmos for developing components, React Router for routing, and TypeScript to make our lives better in general. (My colleague Paul already wrote about what went into our decision to use TypeScript here.)

As if writing an entirely new stack wasn’t enough, we realized along the way that this was our perfect chance to start deploying containerized applications with Kubernetes, a first for Tumblr. We had never previously deployed a node application to production here, and didn’t have the infrastructure for it, so it was a perfect green field on which to build another new and exciting thing. There’ll be more to come later on Kubernetes.

So where are we now? Well, we’ve launched one page powered by this new app - image pages, like this - with more to come very soon. 

image

Though it may seem simple, there’s a whole new technological world between you clicking that link and seeing that page. There’s a ton more exciting stuff happening now and still to happen in the future, and we’re looking forward to sharing it here. Wanna get in on the action yourself? Come work with us: https://www.tumblr.com/jobs.

- Robbie Dawson / @idiot

javascript react dr phil m&m computer