DEV Community

llllvvuu
llllvvuu

Posted on

Many popular frontends are low-key open-source

Ever wondered how your favorite frontend is built (for example, maybe it has an awesome component that you can't find replicated anywhere)? It might have:

  • No GitHub
  • No GitLab
  • No source maps in Chrome DevTools.

But you may still be able to find the original sources.

I made a tool to extract them: https://github.com/llllvvuu/dl-webapp-sources

To summarize from the README:

  • You can get a list of all JS files loaded by a page using:
performance
  .getEntriesByType("resource")
  .map(resource => resource.name)
  .filter(name => name.endsWith(".js"))
  .map(name => `"${name}"`)
  .join(" ")
Enter fullscreen mode Exit fullscreen mode
  • You can pass this into the CLI:
dl-webapp-sources ${JS_URLS} -o ${OUTPUT_DIRECTORY}
Enter fullscreen mode Exit fullscreen mode

Often this will give you a full React app. It will be missing the build files like package.json, webpack.config.js, and tsconfig.json, but you may be able to reverse engineer these - look for strings like react-router, next, etc and then plug in the appropriate build system and tweak the config.

Try it on your favorite apps... you might be surprised! There are some interesting codebases to study and learn from.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay