Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

semver resolution of transitive dependencies. #1

Open
chriseppstein opened this issue Jul 16, 2018 · 0 comments
Open

semver resolution of transitive dependencies. #1

chriseppstein opened this issue Jul 16, 2018 · 0 comments

Comments

@chriseppstein
Copy link

Sass has a global namespace so the last definition of a @mixin or @function imported will win.

Consider an app that depends on packageA and packageB, both of which have a dependency on packageX. Depending on how the dependencies on packageX are defined for packageA and packageB It's probable the app will end up with two versions of packageX. Depending on how the importer is built, it may be indeterminate which of the two gets used, or maybe they both get used but one clobbers the definitions of the other.

The way eyeglass handles this is by discovering all the sass modules and doing a semver resolution on their declared versions. If semver compatible, the highest version is used, if incompatible, the newest one is picked with a warning or error depending on configuration.

This implementation does a just-in-time resolution when an import is requested, but that means it can't ensure a consistent resolution across sass files or repeated imports, for sass files that depend on a version specific enhancement in the transitive dependency. Even if this project does a better job at resolving against the right version of the library for a specific import, it's going to cause issues because mixins and functions have a late binding resolution when other mixins or functions are invoked so the last definition will win and may have different behavior or arguments.

If there's some use cases that this addresses that Eyeglass does not we could consider augmenting eyeglass accordingly.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant