Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
@nrwl/react-native
Advanced tools
🔎 Smart, Extensible Build Framework
Nx is a smart and extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and frameworks while providing a distributed graph-based task execution, computation caching, smart rebuilds of affected projects, powerful code generators, editor support, GitHub apps, and more.
Nx provides distributed graph-based task execution and computation caching.
Nx is smart. It analyzes your workspace and figures out what can be affected by every code change. That's why Nx doesn't rebuild and retest everything on every commit--it only rebuilds what is necessary .
Nx partitions commands into a graph of smaller tasks. Nx then runs those tasks in parallel, and it can even distribute them across multiple machines without any configuration.
Nx also uses a distributed computation cache. If someone has already built or tested similar code, Nx will use their results to speed up the command for everyone else.
Nx helps scale your development from one team building one application to many teams building multiple frontend and backend applications all in the same workspace. When using Nx, developers have a holistic dev experience powered by an advanced CLI (with editor plugins), capabilities for controlled code sharing and consistent code generation.
Nx is an open platform with plugins for many modern tools and frameworks. It has support for TypeScript, React, Angular, Cypress, Jest, Prettier, Nest.js, Next.js, Storybook, Ionic among others. With Nx, you get a consistent dev experience regardless of the tools used.
Using npx
npx create-nx-workspace
Using npm init
npm init nx-workspace
Using yarn create
yarn create nx-workspace
The create-nx-workspace
command will ask you to select a preset, which will configure some plugins and create your applications to help you get started.
? What to create in the new workspace (Use arrow keys)
❯ empty [an empty workspace with a layout that works best for building apps]
npm [an empty workspace set up to publish npm packages (similar to and compatible with yarn workspaces)]
react [a workspace with a single React application]
angular [a workspace with a single Angular application]
next.js [a workspace with a single Next.js application]
gatsby [a workspace with a single Gatsby application]
nest [a workspace with a single Nest application]
express [a workspace with a single Express application]
web components [a workspace with a single app built using web components]
react-express [a workspace with a full stack application (React + Express)]
angular-nest [a workspace with a full stack application (Angular + Nest)]
Select the preset that works best for you.
npx create-nx-workspace --cli=nx --preset=empty
# Using npm
npm install --save-dev @nrwl/react-native
# Using yarn
yarn add -D @nrwl/react-native
npx nx g @nrwl/react-native:app <app-name>
When using Nx, you can create multiple applications and themes in the same workspace. If you don't want to prefix your commands with npx, install @nrwl/cli
globally.
npx nx start <app-name>
This will start the bundler at http://localhost:8081
.
Make sure the bundler server is running.
Android:
npx nx run-android <app-name>
iOS: (Mac only)
npx nx run-ios <app-name> --install
Note: The --install
flag installs Xcode dependencies before building the iOS app. This option keeps dependencies up to date.
Android:
npx nx build-android <app-name>
iOS: (Mac only)
No CLI support yet. Run in the Xcode project. See: https://reactnative.dev/docs/running-on-device
npx nx test <app-name>
npx nx lint <app-name>
You can use a component from React library generated using Nx package for React. Once you run:
npx nx g @nrwl/react-native:lib ui-button
This will generate the UiButton
component, which you can use in your app.
import { UiButton } from '@myorg/ui-button';
Usage:
npx nx [command] [app] [...options]
start
Starts the JS bundler that communicates with connected devices.
--port [number]
The port to listen on.
run-ios
Builds your app and starts it on iOS simulator.
--port [number]
The port of the JS bundler.
--install
Install dependencies for the Xcode project before building iOS app.
--sync
Sync app dependencies to its package.json
. On by default, use --no-sync
to turn it off.
run-android
Builds your app and starts it on iOS simulator.
--port [number]
The port of the JS bundler.
--sync
Sync app dependencies to its package.json
. On by default, use --no-sync
to turn it off.
sync-deps
Sync app dependencies to its package.json
.
--include [string]
A comma-separate list of additional packages to include.
e.g. nx sync-deps [app] --include react-native-gesture,react-native-safe-area-context
Visit the Nx Documentation to learn more.
FAQs
The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: -Integration with libraries such as Jest, Detox, and Storybook. -Scaffolding for creating buildable libraries th
The npm package @nrwl/react-native receives a total of 38,314 weekly downloads. As such, @nrwl/react-native popularity was classified as popular.
We found that @nrwl/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.