Paul Krill
Editor at Large

Facebook takes Relay JavaScript framework open source

news
Sep 15, 20152 mins

Company engineers see the community potentially extending it beyond its links to React JavaScript technology

open source nametag
Credit: opensource.com

Facebook this week is open-sourcing Relay, which provides data-fetching for React JavaScript applications. The move could open up new possibilities for the technology, Facebook engineers said.

Accessible on GitHub, Relay is a JavaScript framework for developing data-driven applications with React, Facebook’s JavaScript library for building user interfaces. “Relay is actually intended to build and do for data-fetching what React does for the user interface rendering,” said Tom Occhino, Facebook engineering manager, in an interview at this week’s @scale conference in San Jose, Calif.

The technology, which also works with Facebook’s React Native framework, makes it easier to build “performant,” applications, Joseph Savona, Facebook engineer, said at the conference. “Relay batches queries together,” he said.

By open-sourcing Relay and making it available to the community at large, Facebook engineers envision new possibilities, such as Relay being extended beyond working with only React technologies. “There’s obviously going to be use cases that we don’t anticipate but the community does anticipate,” Savona said.

Relay is declarative, in which there is no need for communication with a data store using an imperative API. With Relay, data requirements are declared using GraphQL, and Relay then figures out how and when to fetch data. GraphQL, for its part, is a Facebook-developed query language for describing data requirements for complex application data models. GraphQL was made open source in July.

Relay also provides colocation, in which queries live next to the views that rely on them, with queries aggregated into efficient network requests. And it features mutations, in which data can be mutated on the client and server using GraphQL, providing data consistency, updates, and error-handling.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author