whatisgithub

What is fbjs?

skevy/fbjs — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2016-02-05

JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

In one sentence

Facebook's internal shared library of JavaScript utility functions used across projects like React and Relay.

Mindmap

mindmap
  root((fbjs))
    What it does
      Shares utility functions
      Used by React and Relay
      Auto-rewrites imports
    Tech stack
      JavaScript
    Use cases
      Internal Facebook tooling
      Studying React's dependencies
    Audience
      Facebook engineers
      Curious developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Share common utility functions across multiple internal JavaScript projects.

USE CASE 2

Study how large projects like React historically managed shared internal code.

USE CASE 3

Avoid duplicating helper functions across related codebases.

What is it built with?

JavaScript

How does it compare?

skevy/fbjsa15n/a15na15n/checkout-validation
LanguageJavaScriptJavaScriptJavaScript
Last pushed2016-02-052019-04-072014-09-04
MaintenanceDormantDormantDormant
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Built for Facebook's internal use, APIs may change without warning for outside users.

So what is it?

FBJS is a shared toolkit of utility functions that Facebook uses across its own JavaScript projects. Think of it as an internal library, like a collection of helper tools that the company's teams reuse rather than rewriting the same code over and over. The main benefit is that Facebook can publish code once and have multiple projects (like React and Relay) pull from the same source, making it easier to ship and maintain those larger libraries. The way it works is straightforward: utility modules are stored in a central place, then converted into a format that other projects can import and use. When another Facebook project needs one of these utilities, a build tool rewrites the import statements automatically so they point to the shared fbjs package instead of local copies. For example, if a project tries to require a function called emptyFunction, the tool intercepts that and converts it to import from fbjs/lib/emptyFunction instead. This keeps everything in sync without duplicating code. The README is honest about scope: this library is built for Facebook's internal use and isn't really designed to be a general-purpose open source tool for everyone else. The team explicitly notes that APIs might change without warning and they probably won't add features just because external users request them, they're optimizing for Facebook's own needs first. Anyone using it from outside the company should expect things to shift around. The project is still evolving. The README lists some open questions about adding type annotations and eventually splitting it into smaller, more specialized packages rather than shipping one big bundle. For now, it's a pragmatic solution to the problem of code sharing across Facebook's JavaScript ecosystem, letting teams move fast without worrying about where shared code lives or how to keep multiple copies in sync.

Copy-paste prompts

Prompt 1
Explain how fbjs rewrites import statements to point to shared utilities.
Prompt 2
Show me an example of using a utility function like emptyFunction from fbjs.
Prompt 3
Help me understand why fbjs isn't meant for general external use.
Prompt 4
Walk me through how fbjs keeps utilities in sync across projects like React and Relay.

Frequently asked questions

What is fbjs?

Facebook's internal shared library of JavaScript utility functions used across projects like React and Relay.

What language is fbjs written in?

Mainly JavaScript. The stack also includes JavaScript.

Is fbjs actively maintained?

Dormant — no commits in 2+ years (last push 2016-02-05).

How hard is fbjs to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is fbjs for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.