Code Monkey home page Code Monkey logo

prashantlalshrestha / universal-monorepo-with-yarn-workspaces Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 464 KB

A universal monorepo using yarn workspaces could be an architectural decision for larger codebase.

License: MIT License

JavaScript 26.35% HTML 14.31% CSS 3.30% TypeScript 10.99% Ruby 4.90% Objective-C 21.57% Starlark 1.63% Java 16.95%
react-native react architecture architectural-decisions yarn-workspaces monorepo npm-package package-manager react-native-web react-electron-app

universal-monorepo-with-yarn-workspaces's Introduction

A universal monorepo using yarn workspaces

This monorepo uses Yarn workspaces and TypeScript to support a modular React Native project.

The core idea is to isolate the JavaScript app code from the platform configurations (native code + the app bundlers like Metro and Webpack).
This isolation happens by using different workspaces: We have an app workspace for the JavaScript app code, a mobile workspace for the React Native mobile configuration, a macos workspace for the React Native macOS configuration, and so on.

We fully embrace Yarn nohoist to allow using different versions of React Native on each platform (which is recommended but not required), simplifying the adoption of new React Native updates.
Thanks nohoist, each platform workspace (mobile, macos, etc.) can depend on any React Native version, regardless of what version the other platform workspaces are using. For example, we can use [email protected] on the mobile app and [email protected] on the macOS app — as long as the JavaScript app code supports both versions.
This approach promotes gradual React Native updates over updates in lockstep.

⚠️ Please notice that I'm not saying this is the right way to do React Native monorepos. This is just an approach that I enjoy using on larger codebases :)

Supported platforms

  • Android (React Native 0.67.1)
  • iOS (React Native 0.67.1)
  • MacOS (React Native 0.64.3)
  • Web (React Native 0.67.1)
  • Web - Browser Extension (React Native 0.67.1)
  • Web - Electron (React Native 0.67.1)

universal-monorepo-with-yarn-workspaces's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.