Skip to content

Commit 17748ce

Browse files
robhoganfacebook-github-bot
authored andcommitted
Enable symlinks (resolver.unstable_enableSymlinks) by default
Summary: Flip the default for `unstable_enableSymlinks` to true. The option was made available in React Native 0.72 and it's been trialled by the community to the extent that we can have good confidence in it (though there are still devx gaps to guide users towards a suitable configuration). This is also an effective prerequisite for disabling Haste/global package resolution by default in OSS, which currently allows workspaces to mostly-work in the absence of symlink support. Closes facebook#1 Changelog: ``` - **[Feature]**: Enable resolution through symlinks (previously experimental `unstable_enableSymlinks`) ``` Differential Revision: D48777855 fbshipit-source-id: 8da1ab84d2971736ec2560aae4a82294aec6da9f
1 parent 775cc58 commit 17748ce

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/Configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,11 @@ When enabled, Metro traverses symlinks during module and asset [resolution](./Re
405405
406406
For example, if you have a Metro project within a [Yarn workspace](https://classic.yarnpkg.com/lang/en/docs/workspaces/) (a subdirectory of a Yarn workspace root), it's likely you'll want to include your workspace *root* path in your configured [`watchFolders`](#watchfolders) so that Metro can resolve other workspaces or hoisted `node_modules`. Similarly, to use linked packages, you'll need to list those package source locations (or a containing directory) in [`watchFolders`](#watchfolders).
407407
408-
Defaults to `false`.
408+
Defaults to `true` for Metro versions *after* v0.78.1.
409409
410410
:::note
411411
412-
In a future release of Metro, this option will become `true` by default.
412+
In a future release of Metro, this option will be removed (symlink support will be always-on).
413413
414414
:::
415415

packages/metro-config/src/__tests__/__snapshots__/loadConfig-test.js.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Object {
8484
],
8585
},
8686
"unstable_enablePackageExports": false,
87-
"unstable_enableSymlinks": false,
87+
"unstable_enableSymlinks": true,
8888
"useWatchman": true,
8989
},
9090
"serializer": Object {
@@ -262,7 +262,7 @@ Object {
262262
],
263263
},
264264
"unstable_enablePackageExports": false,
265-
"unstable_enableSymlinks": false,
265+
"unstable_enableSymlinks": true,
266266
"useWatchman": true,
267267
},
268268
"serializer": Object {
@@ -440,7 +440,7 @@ Object {
440440
],
441441
},
442442
"unstable_enablePackageExports": false,
443-
"unstable_enableSymlinks": false,
443+
"unstable_enableSymlinks": true,
444444
"useWatchman": true,
445445
},
446446
"serializer": Object {
@@ -618,7 +618,7 @@ Object {
618618
],
619619
},
620620
"unstable_enablePackageExports": false,
621-
"unstable_enableSymlinks": false,
621+
"unstable_enableSymlinks": true,
622622
"useWatchman": true,
623623
},
624624
"serializer": Object {

packages/metro-config/src/defaults/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const getDefaultValues = (projectRoot: ?string): ConfigT => ({
4040
blockList: exclusionList(),
4141
dependencyExtractor: undefined,
4242
disableHierarchicalLookup: false,
43-
unstable_enableSymlinks: false,
43+
unstable_enableSymlinks: true,
4444
emptyModulePath: require.resolve(
4545
'metro-runtime/src/modules/empty-module.js',
4646
),

0 commit comments

Comments
 (0)