Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore switching back to absolute imports in core #236644

Open
mjbvz opened this issue Dec 19, 2024 · 0 comments
Open

Explore switching back to absolute imports in core #236644

mjbvz opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
debt Code quality issues

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2024

As part of the esm migration, we switch all of the imports to relative paths. This makes it more difficult to know where a file is coming from and also makes it harder to move around code. I'd like to see if we can switch back to absolute paths instead

In #236640 I'm switching us to use nodenext for module resolution to fix a few other issues (such as no errors on extension less imports). This also will also let us use import path mapping

For this, we just need to add this to the package.json:

  "imports": {
    "#vs/*.js": "./src/vs/*.js"
  },

Then we can write import { ILogService } from '#vs/platform/log/common/log.js' and TS will be able to resolve the right file

We still need to figure out how to get our loader understanding these paths

@mjbvz mjbvz added the debt Code quality issues label Dec 19, 2024
@mjbvz mjbvz self-assigned this Dec 19, 2024
mjbvz added a commit to mjbvz/vscode that referenced this issue Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

1 participant