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

Add the ability for importers to detect @import #1309

Merged
merged 3 commits into from May 17, 2021
Merged

Add the ability for importers to detect @import #1309

merged 3 commits into from May 17, 2021

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented May 14, 2021

@nex3 nex3 requested a review from jathak May 14, 2021 01:07
/// Runs [callback] in a context where [inImportRule] returns `true` and
/// [resolveImportPath] uses `@import` semantics rather than `@use` semantics.
T inImportRule<T>(T callback()) =>
runZoned(callback, zoneValues: {#_inImportRule: true});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why this is now run in a zone, or is it just a cleaner way to update fromImport?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the variable Zone-scoped means that, if multiple Sass compilations are running in parallel, they won't stomp on one another's values for this variable. It wasn't necessary before because this was only used by FileSystemImporter which was synchronous, but user-defined importers aren't necessarily.

@nex3 nex3 merged commit 9caa0f3 into master May 17, 2021
@nex3 nex3 deleted the fromImport branch May 17, 2021 21:09
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.

None yet

2 participants