Skip to content

Commit

Permalink
Enable symlinks (resolver.unstable_enableSymlinks) by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robhogan authored and facebook-github-bot committed Aug 30, 2023
1 parent 775cc58 commit 17748ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/Configuration.md
Expand Up @@ -405,11 +405,11 @@ When enabled, Metro traverses symlinks during module and asset [resolution](./Re
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).
Defaults to `false`.
Defaults to `true` for Metro versions *after* v0.78.1.
:::note
In a future release of Metro, this option will become `true` by default.
In a future release of Metro, this option will be removed (symlink support will be always-on).
:::
Expand Down
Expand Up @@ -84,7 +84,7 @@ Object {
],
},
"unstable_enablePackageExports": false,
"unstable_enableSymlinks": false,
"unstable_enableSymlinks": true,
"useWatchman": true,
},
"serializer": Object {
Expand Down Expand Up @@ -262,7 +262,7 @@ Object {
],
},
"unstable_enablePackageExports": false,
"unstable_enableSymlinks": false,
"unstable_enableSymlinks": true,
"useWatchman": true,
},
"serializer": Object {
Expand Down Expand Up @@ -440,7 +440,7 @@ Object {
],
},
"unstable_enablePackageExports": false,
"unstable_enableSymlinks": false,
"unstable_enableSymlinks": true,
"useWatchman": true,
},
"serializer": Object {
Expand Down Expand Up @@ -618,7 +618,7 @@ Object {
],
},
"unstable_enablePackageExports": false,
"unstable_enableSymlinks": false,
"unstable_enableSymlinks": true,
"useWatchman": true,
},
"serializer": Object {
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-config/src/defaults/index.js
Expand Up @@ -40,7 +40,7 @@ const getDefaultValues = (projectRoot: ?string): ConfigT => ({
blockList: exclusionList(),
dependencyExtractor: undefined,
disableHierarchicalLookup: false,
unstable_enableSymlinks: false,
unstable_enableSymlinks: true,
emptyModulePath: require.resolve(
'metro-runtime/src/modules/empty-module.js',
),
Expand Down

0 comments on commit 17748ce

Please sign in to comment.