From fdcfaa57881f57c8cd631df815d6861f9e2568d5 Mon Sep 17 00:00:00 2001 From: Varun Saini <61795485+vrn-sn@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:12:50 -0700 Subject: [PATCH] Add details about (1c) being compatible with (1a/b) --- docs/amended-alias-resolution.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/amended-alias-resolution.md b/docs/amended-alias-resolution.md index 837a2f0..e8c3d00 100644 --- a/docs/amended-alias-resolution.md +++ b/docs/amended-alias-resolution.md @@ -96,6 +96,10 @@ When `require("` is typed, autocomplete has only three options to display: the ` After a prefix has been typed, autocomplete will either display defined aliases or local modules, depending on the prefix. Approaches (1a) and (1b) would be less clear about this, as `require("` could be followed by a string component or one of the three prefixes. +An additional benefit of this approach is that it is forwards compatible with both (1a) and (1b). +We effectively reserve unprefixed paths with this approach and can support either (1a) or (1b) further down the road. +After a package manager has been implemented, we will likely have a better sense for which option makes the most sense: mapping unprefixed paths to local modules, to aliased modules, or to nothing (keeping unprefixed paths unsupported). + The main drawback of this approach is that it is not backwards compatible with any existing code that uses unprefixed require statements and may result in code that looks cluttered. ## Alternatives