mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
Remove paths
This commit is contained in:
parent
fdcfaa5788
commit
4dc8611ec6
2 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
# Amended Alias Syntax and Resolution Semantics
|
||||
# Amended Require Syntax and Resolution Semantics
|
||||
|
||||
## Summary
|
||||
|
||||
|
@ -23,7 +23,7 @@ There have been disagreements about which approach is more appropriate, so this
|
|||
|
||||
## Possible Designs and Drawbacks
|
||||
|
||||
Below, we have multiple different options for syntax and resolution semantics.
|
||||
Below, we have multiple different options for alias syntax and resolution semantics.
|
||||
For each design, assume that the following `.luaurc` file is defined:
|
||||
```json
|
||||
{
|
||||
|
@ -36,6 +36,9 @@ Additionally, assume that we have a file named `dependency.luau` located in thes
|
|||
1. `./libs/dependency.luau`
|
||||
2. `/My/Libraries/Directory/dependency.luau`
|
||||
|
||||
As part of the push to make require statements more explicit, we also propose removing `paths`, as aliases serve a similar purpose and are more explicit.
|
||||
The following options operate under the assumption that `paths` is no longer supported in `.luaurc` files, so we do not need to provide a syntax that corresponds to `paths`.
|
||||
|
||||
### (1) Make explicit prefixes necessary
|
||||
|
||||
#### (1a) Make aliases explicit with `@` prefix
|
|
@ -12,6 +12,8 @@ Luau itself currently supports a basic require-by-string syntax that allows for
|
|||
|
||||
## Design
|
||||
|
||||
Parts of this design are now obsoleted by [this RFC](https://github.com/luau-lang/rfcs/pull/56).
|
||||
|
||||
#### Aliases
|
||||
|
||||
Aliases can be used to bind an absolute or relative path to a convenient, case-insensitive name that can be required directly.
|
||||
|
|
Loading…
Add table
Reference in a new issue