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

Update specs for @import/global builtins deprecations #2004

Merged
merged 4 commits into from
Oct 17, 2024
Merged

Conversation

jathak
Copy link
Member

@jathak jathak commented Jul 17, 2024

See sass/sass#3898
[skip dart-sass]
[skip sass-embedded]

@nex3
Copy link
Contributor

nex3 commented Jul 17, 2024

Looks like this also needs [skip sass-embedded]

@ntkme
Copy link
Contributor

ntkme commented Jul 18, 2024

The following test in importer.test.ts hasn't been updated:

  it("is converted to a file: URL if it's an absolute Windows path", () => {
    const result = compileString('@import "C:/orange";', {
      importers: [
        {
          canonicalize(url: string) {
            expect(url).toEqual('file:///C:/orange');
            return new URL(`u:${url}`);
          },
          load: () => ({contents: 'a {b: c}', syntax: 'scss'}),
        },
      ],
    });
    expect(result.css).toBe('a {\n  b: c;\n}');
  });

What's weird is that this test works with @import, but breaks with @use on ruby host. Not sure what's the intended behavior here.

From what I see this might be for some backward compatibility? As far as I know, every import used to be a path in older implementations, but now is a URI in current implementation. C:/orange is a valid path, but not a path-only RFC 3986 URI. As a URI it should be expressed as /C:/orange instead.

@nex3
Copy link
Contributor

nex3 commented Jul 18, 2024

That's intended to be import-only behavior. As you surmise, it's a legacy behavior from when we were much more wishy-washy about the distinction between paths and URLs.

@jathak jathak merged commit d26f4ad into main Oct 17, 2024
7 checks passed
@jathak jathak deleted the import-deprecation branch October 17, 2024 00:04
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.

3 participants