Skip to content

Commit e52b5ff

Browse files
robhoganfacebook-github-bot
authored andcommitted
Remove unstable_enableSymlinks (now always-on)
Summary: Symlink support has been enabled by default since Metro 0.79, but it was still possible to turn it off via `unstable_enableSymlinks`. As noted in the docs: > In a future release of Metro, this option will be removed (symlink support will be always-on). This removes the config option - symlink support is always-on. Docs: Move note about symlink targets and workspaces under `watchFolders`. Changelog: ``` - **[Experimental]**: Remove redundant `unstable_enableSymlinks` - symlink support is stable and always-on. ``` Reviewed By: huntie Differential Revision: D62707315 fbshipit-source-id: b86d5b75cd75753c627478a7411ef603bc3393e2
1 parent 9d80599 commit e52b5ff

File tree

6 files changed

+9
-32
lines changed

6 files changed

+9
-32
lines changed

docs/Configuration.md

+8-24
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ A list of directories outside of [`projectRoot`](#projectroot) that can contain
103103
Despite the naming of this option, it isn't related solely to file watching. Even in an offline build (for example, in CI), all files must be visible to Metro through the combination of `watchFolders` and `projectRoot`.
104104
:::
105105

106+
:::info
107+
108+
Note that, as with any other file Metro needs to resolve, targets of any symlinks within your `watchFolders` *must also be within `watchFolders`* and not otherwise excluded.
109+
110+
If you have a Metro project within a workspace, such as 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` so that Metro can resolve other workspaces or hoisted `node_modules`. Similarly, to use [linked packages](https://classic.yarnpkg.com/lang/en/docs/cli/link/), you'll need to list those package source locations (or a containing directory) in `watchFolders`.
111+
112+
:::
113+
106114
#### `transformerPath`
107115

108116
Type: `string`
@@ -391,30 +399,6 @@ In a future release of Metro, this option will become `true` by default.
391399
392400
---
393401
394-
#### `unstable_enableSymlinks` <div class="label experimental">Experimental</div>
395-
396-
Type: `boolean`
397-
398-
Enable experimental support for projects containing symbolic links (symlinks).
399-
400-
When enabled, Metro traverses symlinks during module and asset [resolution](./Resolution.md), instead of ignoring symlinks. Note that, as with any other file Metro needs to resolve, the symlink target *must be within configured [watched folders](#watchfolders)* and not otherwise excluded.
401-
402-
Defaults to `true` since Metro v0.79.0.
403-
404-
:::info
405-
406-
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](https://classic.yarnpkg.com/lang/en/docs/cli/link/), you'll need to list those package source locations (or a containing directory) in [`watchFolders`](#watchfolders).
407-
408-
:::
409-
410-
:::note
411-
412-
In a future release of Metro, this option will be removed (symlink support will be always-on).
413-
414-
:::
415-
416-
---
417-
418402
### Transformer Options
419403
420404
<!-- Keep old links to `asyncRequireModulePath` working -->

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

-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ Object {
8585
],
8686
},
8787
"unstable_enablePackageExports": false,
88-
"unstable_enableSymlinks": true,
8988
"useWatchman": true,
9089
},
9190
"serializer": Object {
@@ -269,7 +268,6 @@ Object {
269268
],
270269
},
271270
"unstable_enablePackageExports": false,
272-
"unstable_enableSymlinks": true,
273271
"useWatchman": true,
274272
},
275273
"serializer": Object {
@@ -453,7 +451,6 @@ Object {
453451
],
454452
},
455453
"unstable_enablePackageExports": false,
456-
"unstable_enableSymlinks": true,
457454
"useWatchman": true,
458455
},
459456
"serializer": Object {
@@ -637,7 +634,6 @@ Object {
637634
],
638635
},
639636
"unstable_enablePackageExports": false,
640-
"unstable_enableSymlinks": true,
641637
"useWatchman": true,
642638
},
643639
"serializer": Object {

packages/metro-config/src/configTypes.flow.js

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ type ResolverConfigT = {
105105
dependencyExtractor: ?string,
106106
emptyModulePath: string,
107107
enableGlobalPackages: boolean,
108-
unstable_enableSymlinks: boolean,
109108
extraNodeModules: {[name: string]: string, ...},
110109
hasteImplModulePath: ?string,
111110
nodeModulesPaths: $ReadOnlyArray<string>,

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

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

packages/metro-config/types/configTypes.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export interface ResolverConfigT {
107107
resolveRequest?: CustomResolver;
108108
resolverMainFields: ReadonlyArray<string>;
109109
sourceExts: ReadonlyArray<string>;
110-
unstable_enableSymlinks: boolean;
111110
unstable_conditionNames: ReadonlyArray<string>;
112111
unstable_conditionsByPlatform: Readonly<{
113112
[platform: string]: ReadonlyArray<string>;

packages/metro/src/node-haste/DependencyGraph/createFileMap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function createFileMap(
8383
computeSha1: true,
8484
dependencyExtractor: config.resolver.dependencyExtractor,
8585
enableHastePackages: config?.resolver.enableGlobalPackages,
86-
enableSymlinks: config.resolver.unstable_enableSymlinks,
86+
enableSymlinks: true,
8787
enableWorkerThreads: config.watcher.unstable_workerThreads,
8888
extensions: Array.from(
8989
new Set([

0 commit comments

Comments
 (0)