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

Discrepancy between the default value of importer in Node API and Dart API #1661

Closed
ntkme opened this issue Apr 3, 2022 · 1 comment
Closed

Comments

@ntkme
Copy link
Contributor

ntkme commented Apr 3, 2022

In Node API, importer defaults to NoOpImporter() or null (which becomes FilesystemImporter('.') later in Dart API):

importer: options?.importer.andThen(_parseImporter) ??
(options?.url == null ? NoOpImporter() : null),

In Dart API, importer defaults to FilesystemImporter('.'):

importer ?? FilesystemImporter('.'),

This behavior difference has caused bugs like #1657 and sass/dart-sass-embedded#82.

While it is not too hard to fix the those bugs, it is probably more important to address this discrepancy and be clear on what is the correct behavior.

@ntkme
Copy link
Contributor Author

ntkme commented Apr 3, 2022

https://github.com/sass/sass-spec/blob/126d17ff9f77372b6f68cb0d43dd357165519c93/js-api-spec/compile.test.ts#L124-L133

Assuming the JS API spec referenced above is correct and desired behavior, the current implementation is actually correct for most part.

@ntkme ntkme closed this as completed Apr 3, 2022
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

No branches or pull requests

1 participant