-
Notifications
You must be signed in to change notification settings - Fork 201
feat: give includes basic entry and asset types instead of any #2363
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we should not pass down the
Locales
variable here and useLocaleCode
instead because linked entries might come from other spaces which can have different locales.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.
So when we make cross-space requests we basically don't know anymore what locales we're dealing with?
That makes sense, but won't that then also already be broken in the more common case of actually using the link resolution, since there we cannot distinguish?
I'm a bit split between making it easy for the most common use case of not having cross space links, but a set of explicit locales, and ensuring that the types aren't misleading in the case where you use cross space links to spaces with a different set of locales.
I guess since the includes are also not returned in a structure where customers could provide something like a space / locale mapping that means we basically have no way to ever really have locale types that are anything other than
string
.So I'm wondering, maybe it's better to keep using
Locales
which will probably in much more than 90% of cases be the expected behavior, and which you can at least put all the locales between the different spaces in as a workaround, instead of forcingincludes
to always have untyped locales.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.
Yeah, you’re right. Even in most cross space cases the locales should be created to match and in cases that are more complicated the locale types probably won’t help much and have to be checked at runtime anyway in which case you would just use
string
and be correct.