-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avoid reusing the same namespace twice Until now, the module migrator always used the default namespace for `@use` rules. This would result in an invalid migration if two `@use` rules within the same stylesheet have the same default namespace. This adds a number to the default namespace if a previous `@use` rule already used it. * Handle namespace conflicts with built-in modules * Better logic for resolving namespace conflicts References now tracks the "source" of a member being referenced, which can be an existing `@use` rule, an `@import` rule, a built-in module, or the current stylesheet. The main migration visitor now uses that source information to determine most namespaces for a stylesheet before visiting it. When resolving namespace conflicts, the migrator attempts to use additional path segments within the `@import` rule before it falls back to numerical suffixes. Built-in modules also get priority for their default namespaces. * Address code review comments Highlights: - Each type of ReferenceSource is now its own subtype - Fixed some bugs in namespace conflict resolution to ensure that existing `@use` rules always keep their namespaces * Add more test cases + code review changes
- Loading branch information
Showing
11 changed files
with
600 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.