metro
ordinary-puzzles-app
Our great sponsors
metro | ordinary-puzzles-app | |
---|---|---|
16 | 5 | |
5,041 | 469 | |
1.0% | - | |
9.4 | 0.0 | |
2 days ago | about 1 year ago | |
JavaScript | TypeScript | |
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 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++.
-
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.
Metro bundler is the JavaScript bundler currently used by React Native. One of metro's most famous limitations (and issue number #1 in its GitHub repository) is its inability to follow symlinks. Therefore, since all hoisted libraries (basically all libraries not specified in the nohoist list) are installed in mobile/node_modules as symlinks from /node_modules, metro won't be able to detect them. Additionally, because of this issue, metro won't even be able to resolve other workspaces (e.g., @my-app/app) since they're outside of the mobile directory.
-
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.
While it might appear that we can access all modules from the project’s root node_modules, the reality is that build processes sometimes aren't able to traverse symlinks. This problem is especially prominent in React Native apps, where both the metro bundler and the native code can't follow symlinks.
ordinary-puzzles-app
- Is there any good example of real-world open-source application (neither libraries nor frameworks nor samples) written in Typescript?
-
Running React Native everywhere: Yarn Workspaces monorepo
Last, because you're supporting multiple platforms in a single directory, it's easy to end up with confusing indirections and branches in platform-specific files. This may be just a "me" thing, but I find it hard to navigate around configuration files of projects that support multiple platforms. At first glance, it may look like all platforms use the same configuration files. But once you dig a bit deeper, you realize that each platform requires some ad-hoc tweaks to the configuration files (for Metro, Babel, Webpack, etc.). Want an example from a codebase I wrote? Check out Ordinary Puzzles, which is a mobile, web, and Electron app. It's not easy to understand what files are used by which platform (e.g., what platform build phase is using babel.config.js?)
-
React Native monorepo supporting multiple platforms: Android, iOS, macOS, Windows, web, browser extension, electron
Can't say for sure. It's highly likely you'll need to make some changes to the metro bundle config when you update React-Native. But at least these changes should be less painful to deal with than having to mess with the native code (which you would do if you don't use nohoist). Personally, I prefer this approach to the known alternatives — which are not using a monorepo at all (which can get confusing as soon as you start supporting multiple platforms) or using a monorepo without nohoist. But it might be just a matter of preference 👍
-
Building a desktop application using Electron and Create React App
I recently needed to wrap a React app generated with Create React App (CRA) with Electron (well, the app itself uses React Native for Web, but it doesn’t matter). My goal was to stay within the Create React App limits as much as possible (without ejecting). There’s no shortage of guides on how to do it online. Still, I couldn’t find one that fully follows the Electron security guidelines and provides a distribution setup using Electron-builder. So, here’s yet another tutorial on how to wrap an app built with Create React App in Electron — from the initial scaffolding up to the distribution workflow.
-
Opensource RN apps (that are in production) - for inspiration
Ordinary Puzzles - Mobile and web puzzle game built with React-Native
What are some alternatives?
expo-cli - Tools for creating, running, and deploying universal Expo and React Native apps
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.
react-native-web - Cross-platform React UI packages
react-native-monorepo-tools - Tools and utils to support a React Native monorepo built with Yarn Workspaces
craco - Create React App Configuration Override, an easy and comprehensible configuration layer for Create React App.
react-native-picture-puzzle - ⚛️ 🧩 A picture puzzle component.
concurrently - Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
nx - Smart Monorepos · Fast CI
minimatch - a glob matcher in javascript
react-app-rewired - Override create-react-app webpack configs without ejecting
mobx-angular - The MobX connector for Angular.
super-auto-pets-db - This database website is an un-official guide and reference for the pets, food and stats from the game Super Auto Pets.