Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@react-native/metro-config
Advanced tools
@react-native/metro-config is a configuration package for Metro, the JavaScript bundler used by React Native. It allows developers to customize the Metro bundler's behavior, such as transforming files, resolving modules, and optimizing the build process.
Custom Transformer
This feature allows you to specify a custom transformer for Metro. In this example, the configuration is set to use the 'react-native-typescript-transformer' to handle TypeScript files.
const { getDefaultConfig } = require('@react-native/metro-config');
const config = getDefaultConfig(__dirname);
config.transformer = {
babelTransformerPath: require.resolve('react-native-typescript-transformer')
};
module.exports = config;
Custom Resolver
This feature allows you to customize the resolver settings. In this example, the configuration is modified to include additional file extensions like 'ts' and 'tsx' for TypeScript support.
const { getDefaultConfig } = require('@react-native/metro-config');
const config = getDefaultConfig(__dirname);
config.resolver = {
sourceExts: ['jsx', 'js', 'ts', 'tsx']
};
module.exports = config;
Asset Plugins
This feature allows you to specify asset plugins for Metro. In this example, the configuration is set to use 'expo-asset/tools/hashAssetFiles' to handle asset files.
const { getDefaultConfig } = require('@react-native/metro-config');
const config = getDefaultConfig(__dirname);
config.transformer = {
assetPlugins: ['expo-asset/tools/hashAssetFiles']
};
module.exports = config;
Metro is the JavaScript bundler for React Native. It provides the core functionalities for bundling JavaScript code and assets. While @react-native/metro-config is specifically for configuring Metro, the 'metro' package itself includes the bundler and its core functionalities.
Haul is an alternative JavaScript bundler for React Native. It is highly customizable and integrates with Webpack, allowing developers to leverage the extensive Webpack ecosystem. Compared to @react-native/metro-config, Haul offers more flexibility through Webpack's configuration options.
Webpack is a popular JavaScript module bundler. While it is not specifically designed for React Native, it can be configured to work with React Native projects. Webpack offers a wide range of plugins and configuration options, making it a powerful alternative to Metro when used with the appropriate loaders and plugins.
v0.73.0
flow-typed/
directory from the react-native
package (4540668c15 by @huntie)pointScaleFactor
(dce7242ab6 by @NickGerleman)YGConfigGetInstanceCount
(858173280f by @NickGerleman)interpolateProps
functionality from ComponentDescriptor
to fix circular dependency between react/renderer/core
and react/renderer/components/view
(bae63d492f)CallInvoker
to NativeMethodCallInvoker
(b70f186b53 by @RSNara)YGErrata
integration within C ABI (0fd0f56f20 by @NickGerleman)runtimeConfig
provider for the Template
(2de964cfd2 by @dmytrorykun)role="searchbox"
should assign "SearchField"
trait on iOS (2749fbca9a by @mdjastrzebski)warnOnLegacyNativeModuleSystemUse
(9859fbc2ec by @philIip)excludeYogaFromRawProps
feature flag, if you need to pass layout props to Java view managers when using new architecture (88e19c0ce6 by @zeyap)ReactTextView
setPadding
applying logic error (d8ced6f895 by @jcdhlzq)view
getter on RCTRootView
/ `RCTFabricSurfaceHostingProxyRootView (33e0521788 by @zoontek)RCTTurboModuleRegistry
is unavailable in RCTRootView
and RCTSurfaceHostingProxyRootView
(268d9edad6 by @philIip)HasBridge
is removed from RCTRootView
and RCTSurfaceHostingProxyRootView
(57b86f7a87 by @philIip)sizeMeasureMode
argument from RCTSurfaceHostingProxyRootView
constructor (0d83c1a668 by @philIip)RCTFabricSurfaceHostingProxyRootView
(676676c954 by @philIip)RCTLocalAssetImageLoader
with RCTBundleAssetImageLoader
(b675667a47 by @hellohublot)React-FabricImage
pod. (44af6ca03c by @cipolleschi)getModuleInstanceFromClass
required (5a7799eead by @philIip)getModuleClassFromName
required (fbf196dd05 by @philIip)openURL
method from RCTInspectorDevServerHelper
(3ef7de848d by @huntie)slice
of class Blob
. (e35ca71bca by @trashcoder)@react-native/babel-preset
. (db4a253c1e by @yungsters)react-native/typescript-config
(cae52f6cf8 by @NickGerleman)package.json
exports field (1b0e8b1de4 by @NickGerleman)contentType
parameter to Blob declaration (ff40138c76 by @trashcoder)testID
from TextStyle
types (3273d38d3b by @tobua)npx react-native
uses old cached version (bfca23a25d by @blakef)YGNode
(72fb75d4d4 by @NickGerleman)YGPrintOptions
(fe6f70b913 by @NickGerleman)/symbolicate
endpoint to allow custom frame skipping logic on a stack level. (03e78010ae by @GijsWeterings)performance.reactNativeStartupTiming.initializeRuntimeStart
and performance.reactNativeStartupTiming.initializeRuntimeEnd
API (50638714f5, 10e8b3538f)transform-origin
on old arch (5f40f0800e by @jacobp100)smartInsertDelete
prop to TextInput
component (6b62f12ce9 by @fabioh8010)AppState
(1bda78f2fa by @w3cay)source
in Image
type (83885f1d69 by @BrodaNoel)_onLayout
to update bottom height when frame height is changed (5059ddc5ce by @lyqandy)^29.2.1
to ^29.6.3
(3c323382fe by @robhogan)BaseViewManagerTest.java
=> BaseViewManagerTest.kt
(3660b7cf73 by @retyui)JSX.Element
with React.JSX.Element
in App.tsx
template (1383a59ed2 by @retyui)Object.defineProperties
instead of object property assignment (cf631ad59f by @yungsters)scrollEventThrottle
prop support for android (777934ec3a)getCanonicalName
and getMessage
methods exposed by fbjni
(6c729acd12 by @krystofwoldrich)setJSEngineResolutionAlgorithm
to public from private. Brownfield apps should be able to setup the JSResolutionAlgorithm before hand. (cb376dd0d8 by @SparshaSaha)NativeDevSettings.setIsDebuggingRemotely()
. (361a944348 by @huntie)cancelable
option in Pressability
configuration to not block native responder, and instead introduced a new optional blockNativeResponder
boolean option to accomplish the same thing. (30e2345b26 by @yungsters)ScrollView
text fields into view with automaticallyAdjustsScrollIndicatorInsets
(9ca16605e0 by @adamaveray)_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
workaround for boost (b9f0bdd12d by @Kudo)get_default_flags
in Ruby scripts (f60b9f695e by @cipolleschi)canLoadFile
function from HermesExecutor.java (1b7e26cccb by @cortinico)EventEmitter
when used with certain Babel configurations that incorrectly polyfill the spread operator for iterables. (8b768f144a by @yungsters)maintainVisibleContentPosition
adjustment moves window before list start (c168a4f88b by @NickGerleman)visible=false
(468a13635a by @mdjastrzebski)scrollMetrics.offset
in RTL (0e69050612 by @NickGerleman)scrollToIndex
(33d6da01ea by @NickGerleman)event-target-shim
import to support Metro resolving mjs
modules before js
. (e37e53086a by @EvanBacon)isHighlighted
prop to iOS (3d2fd4bf22)signal
for the Request
interface (823b1f467b by @ljbc1994)console.group
(48791bcd98)ref.measureRelative
and ref.measureInWindow
for nodes with scale/rotate transforms in their parents. (64416d9503 by @rubennorte)viewabilityConfig
prop type any
to ViewabilityConfig
(5dfa38a20e by @jeongshin)substr()
is deprecated, using slice()
instead across RN codebase (8a49754cda by @Pranav-yadav)maintainVisibleContentPosition
(69b22c9799 by @janicduplessis)deprecated-react-native-prop-types
to remove fragile transitive *
dependencies. (f00594b262 by @robhogan)createAnimatedStyle
when providing an undefined transform style (7e26e0270b by @gabrieldonadel)react-native/codegen
shouldn't be built unless it's in the repo — fixes pod install
failures in pnpm setups (3dd6a83c0e by @tido64)NONE
when a null
string is passed to fromValue
(0f48e86fed by @cipolleschi)Accessibility.setAccessibilityFocus
on an unmounted component would crash (5323221d14 by @Abbondanzo)connectTimeout
to callTimeout
in OKHttp client (e00f2445d2 by @troZee)FlatList
on android API 33+ (90186cd9b7 by @hannojg)PermissionAwareActivity
(cff4bc8eea by @yungsters)a..
(5ec2c01697 by @cortinico)accessibilityValue
prop values in accessibilityValue
(0c25f19d39 by @carmenvkrol)RCTUserInterfaceStyleDidChangeNotification
when the app is in the background. (6118aff69d by @alanjhughes)#
and partially escaped urls (2b4e1f5ece by @cipolleschi)packages/rn-tester
(cd30bc3888 by @dmytrorykun)contentOffset
in scroll events in RTL (4f8a8ce316 by @NickGerleman)addEntriesFromDictionary
properly in RCTBaseTextInputView. (e6dd22c628 by @cipolleschi)use_react_native
to support custom react native absolute paths (835f62c189 by @gabrieldonadel)RCTUIManager
invalidation. (bc63e44b23 by @kkafar)FAQs
Metro configuration for React Native.
The npm package @react-native/metro-config receives a total of 533,306 weekly downloads. As such, @react-native/metro-config popularity was classified as popular.
We found that @react-native/metro-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.