metro
react-native-universal-monorepo
Our great sponsors
metro | react-native-universal-monorepo | |
---|---|---|
16 | 12 | |
5,057 | 1,663 | |
0.9% | - | |
9.3 | 0.0 | |
1 day ago | almost 2 years ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
metro
-
Dynamic imports supported in react native
For details on the implementation you can see Evan's PR to metro here.
- React Native bundler improvement! 🔥
-
React vs React Native: How Different Are They, Really?
Some development tools for the web are similar (Chrome debugger, mostly) to those for React Native, but other aspects are very different (working with the metro bundler, using Flipper, AsyncStorage debugging, more). Some techniques developers will use are the same (breakpoints and console logging), but others are different (knowing when to restart the packager vs reinstall the app on device).
-
Setting up React Native Monorepo with Yarn Workspaces
We’re almost done with setting up the project. The last thing in the React Native app is to add watchFolders so metro knows where the linked node_modules are. The shared modules are symlinked by yarn, and since metro doesn’t follow symlinks we need to explicitly say it where the linked node_modules are.
-
Debugging RN + Expo bare using WebStorm? Would I be better off just killing myself now?
Unfortunately it is what it is... I use intellij instead of webstorm since they're the same thing basically. I spent a shitton of time figuring out how to link a local package i was creating for my app only to discover about this issue that is almost as old as react native itself. (luckily there's rnx-kit that solves the problem). Not to talk about the impossibility to have one goddamn IDE to write both typescript, java and c++. Currently i have to write ts/js in intellij, then i have to switch to android studio to write java/c++.
-
Do you know where the __DEV__ flag is set?
React Native packager. Override instructions here.
-
React Native Monorepo
React Native doesn't play nicely with most monorepo tools out of the box as Metro doesn't support symlinking.
-
Running React Native everywhere: The Web
Because React Native for Web is a React website, you can use front-end tools to build and run it. For example, you can build it with Webpack or Rollup instead of Metro bundler.
-
Running React Native everywhere: Android & iOS
Before we can run the app, we still need do one more thing: make metro bundler compatible with Yarn workspaces' hoisting.
-
Running React Native everywhere: Yarn Workspaces monorepo
Second, sharing code with other projects (e.g., backend code, web apps) may get complicated. Out-of-the-box, React Native's metro bundler cannot reference code outside of the project's root directory. You can configure it to do so (and we'll do it as well later on). Still, once you do it, you'll also need to ensure dependencies resolution works correctly (to avoid loading two different versions of the same library, for example); which might not be as easy as it may sound.
react-native-universal-monorepo
- React Native universal monorepo template for mobile, desktop, web and more
- Building Windows apps?
- Minimizing code duplication between React Native and React app
- Monorepo setup with react-native and react-native-web
-
Ask HN: What Stack for mobile/desktop cross-platform native development in 2021?
React Native is your best bet.
Examples:
- https://github.com/devhubapp/devhub
- https://github.com/mmazzarolo/react-native-universal-monorep...
RN desktop support is weak. But your mobile apps will work quite differently to your desktop apps anyway. And you probably want something that can run on the web too. So for desktop you just put your web app in Electron.
The difference between mobile and web will mean having to implement different routing and components, but you can share a lot of code.
Flutter is the new kid on the block.
-
Running React Native everywhere
You can see the final result in the react-native-universal-monorepo GitHub repository.
For the sake of simplicity, code is written in plain JavaScript. Still, you can add support for TypeScript if needed (you can use the React Native Universal Monorepo as an example; it's written in TypeScript).
-
Running React Native Everywhere
Author here!
"Running React Native everywhere" is an opinionated tutorial on how to run React Native on multiple platforms using Yarn workspaces.
You can see the final result in this GitHub repo: https://github.com/mmazzarolo/react-native-universal-monorep...
Which currently supports:
-
Running React Native everywhere: Browser Extensions & Electron
For feedback and questions, feel free to start a discussion on the React Native Universal Monorepo's discussions page or send me a direct message.
-
“Running React Native everywhere”: an opinionated in-depth guide on how to run React Native on multiple platforms (overview + monorepo setup)
The goal is to create from scratch the [React Native Universal Monorepo](https://github.com/mmazzarolo/react-native-universal-monorepo), supporting Android, iOS, macOS, Windows, the web, a browser extension, and Electron.
What are some alternatives?
expo-cli - Tools for creating, running, and deploying universal Expo and React Native apps
craco - Create React App Configuration Override, an easy and comprehensible configuration layer for Create React App.
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
openmtp - OpenMTP - Advanced Android File Transfer Application for macOS
react-native-web - Cross-platform React UI packages
chrome-extensions-samples - Chrome Extensions Samples
react-native-monorepo-tools - Tools and utils to support a React Native monorepo built with Yarn Workspaces
re-start - react-native template to target multiple platforms :globe_with_meridians: :iphone: :computer: with single codebase.
create-react-app - Set up a modern web app by running one command.
nx - Smart Monorepos · Fast CI
react-bones - đź’€ Dead simple content loading components for React and React-Native đź’€