Skip to content

Commit b506d82

Browse files
Wilfredgithub-actions[bot]
authored andcommitted
Update guides/hack from HHVM repository
1 parent c69629e commit b506d82

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

guides/hack/18-packages/01-introduction.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ When determining which package a file belongs to:
7171
3. Otherwise, the file belongs to the package whose `include_paths` contains the file's nearest ancestor directory (i.e. the longest prefix match)
7272
4. If none of the above apply, the file belongs to the **default package**
7373

74+
### Manual Global Exclusions
75+
76+
It is possible globally exclude files from deployements and/or typechecking. This is controlled for the build by `exclude-pattern` build_config.hdf and for the typechecker by `package_exclude_patterns` in .hhconfig.
77+
- They are excluded from the typechecker (no errors are reported for references to or from these files)
78+
- They are automatically excluded from all deployments, regardless of package membership
79+
80+
By default, that includes files whose path contains the substring `__tests__`.
81+
7482
## Default package
7583

7684
Any file not specified in any package (neither via `include_paths` nor `__PackageOverride`) belongs to the implicit "default" package. Symbols within the default package are not accessible from other packages. The default package:

guides/hack/18-packages/02-deployments.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Eval.Runtime.ActiveDeployment = production
6767

6868
When running in [repo authoritative](/docs/hhvm/advanced-usage/repo-authoritative) mode, HHVM only compiles and runs files from packages in the specified deployment. References to undeployed packages cause runtime errors (e.g., "Class not found" or "Call to undefined function"). When running in other modes, the active deployment serves only to modify semantics of `package` checks and the `__RequirePackage` attribute.
6969

70+
**Note:** Files in `__tests__` directories are automatically excluded from all deployments. See [File package membership](/docs/hack/packages/introduction#test-directories) for details.
7071

7172
### Force Symbol References (Legacy)
7273

0 commit comments

Comments
 (0)