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

Remove weakly_canonical and replace with Luau's normalisePath #881

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

JohnnyMorganz
Copy link
Owner

@JohnnyMorganz JohnnyMorganz commented Dec 26, 2024

weakly_canonical performs filesystem calls to check if all components of the path exist, and resolve symlinks. We don't need these features.

We replace with Luau's normalisePath.

Note that weakly_canonical would also make relative file paths absolute by appending them to the current working directory. This cause relative string requires to break. We resolve this by making paths absolute in string requires - we shouldn't be relying on the current directory in the first place

Closes #856

weakly_canonical performs filesystem calls to check if all components of the path exist, and resolve symlinks. We don't need these features.

We replace with Luau's normalisePath.

Note that weakly_canonical would also make relative file paths absolute by appending them to the current working directory. This cause relative string requires to break. We resolve this by making paths absolute in string requires - we shouldn't be relying on the current directory in the first place
We need to apply the rootUri prefix for file aliases too in case they were relative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate performance of string requires (and aliases)
1 participant