-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(boundaries): package name as tag punning #10151
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a3f8608
to
0be73a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome feature!
impl Spanned<String> { | ||
pub fn as_str(&self) -> &str { | ||
self.value.as_str() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed since Spanned
already implements deref?
impl Spanned<String> { | |
pub fn as_str(&self) -> &str { | |
self.value.as_str() | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Rust chain derefs? When I did as_deref
for Option<Spanned<String>>
, I got Option<&String>
and not Option<&str>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to specify the deref type sometimes to help out. I know I've needed to do that when working with Cow
sometimes
Description
Allows a package name to be used as a tag (tag punning). We're adding this feature to help users define an explicit set of packages that their package can be imported by. Combined with the ability to define package rules in a package
turbo.json
(next PR after this, coming soon), and code owner restrictions, this will permit package owners to control who can import their package.Testing Instructions
Added test in
boundaries_tags
fixture