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

fix: revert VersionReq being equal on inner RangeSet #16

Closed

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jan 20, 2024

Reverts part of #13

Although it seemed like the right idea, the raw text is significant to know about in places like the LSP where we map the raw text back to the package requirement. If we make hashing and equals not based on the raw text, then these "duplicate" package requirements get lost in the npm resolution and it breaks some scenarios like auto-import mapping the version requirement text to a bare specifier in the import map when there are multiple possible version requirements for the same underlying RangeSetOrTag. In other words, the previous commit made us lose some resolution that we need for the LSP.

What we can do in the registry code that relied on this is to convert the VersionReqs into the inner RangeSetOrTags.

@dsherret dsherret requested a review from lucacasonato January 20, 2024 20:07
@dsherret
Copy link
Member Author

I looked into this more on Luca's suggestion and it's actually a lot better to not keep around duplicate texts. Instead, we can go from the import map to a PackageReq, then do the comparison on the package reqs directly.

@dsherret dsherret closed this Jan 21, 2024
@dsherret dsherret deleted the fix_revert_eq_inner_range_set branch January 21, 2024 01:39
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.

1 participant