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.
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
feat(next): astro:routes:resolved #12329
feat(next): astro:routes:resolved #12329
Changes from 6 commits
621d2d2
fbb04e9
98e77c9
96f560b
65f5b60
75a84dc
3a3b083
ec16abf
ce0fc54
7e26fa4
319b405
db92a98
fc4e42c
ebb12f9
b377e0f
33b1165
5576af9
46be686
c9dcd7c
24600f0
ea9abf4
93a69e2
e837aff
7db88f9
12088d0
e1f53d5
539d40f
846c3a7
cd62268
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why do we change the internal naming? Wouldn't it create fragmentation? Also, we shifted into a pattern where "entrypoint" is
URL
orstring
, where thestring
is an absolute file path. In this case, these arestring
, and they are relative paths. I think we should keepcomponent
, so they are not misunderstood like the other "entrypoints" we have in other APIs.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 proposed changing the "component" name for the new public API because the value here is not necessarily a component. This is already true of
RouteData['component']
, the name is misleading.I'm not sure whether
entrypoint
is the best name either. It can be:It is quite an overloaded field, so I think it needs a more generic name than "component".
Some options and my thoughts about them:
source
: would be misleading for redirect since it is where it redirects to and not fromdefinition
: I don't think it really fits with redirectimplementation
: also doesn't fit with redirecttarget
: seems weird to say an Astro component is the target of a page but could workreference
: in the sense of a "reference implementation" for the page or API and the reference link for the redirectThere 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.
What about
origin
orcreator
?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.
cc @Fryuni
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.
Similarly, they feel weird for redirects because it is where you'd redirect to not from. Both would imply from to me.
I don't have any particularly strong feelings against any of the names Ema and I proposed, nor with
component
. I don't think this is worth blocking progress if it comes to it. It is just that none of them matches all 3 cases that can exist for this field.component
is just worse than the alternatives for me since it directly implies one of the options when there are another 2.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 we can agree there isn't a perfect name, so we need to be good at documenting :)
I also don't have particularly strong feelings about a particular name