-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
refactor(next): send IntegrationRouteData
to integrations
#11864
Conversation
🦋 Changeset detectedLatest commit: eea2150 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This PR is blocked because it contains a major
changeset. A reviewer will merge this at the next release if approved.
9f5cafc
to
204827b
Compare
IntegrationRouteData
to integrations
a382c70
to
182ad6b
Compare
f2a5e3d
to
e1f8f7a
Compare
225e883
to
77236c5
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.
We have moved the adapter to https://github.com/withastro/adapters, so this PR can't be merged here anymore.
I would offer to port over the changes to the new repo for you, just let me know if you want me to do that.
77236c5
to
1f3885d
Compare
route: string; | ||
/** | ||
* Source component URL |
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.
It might be worth documenting what value will be here in case of redirect
and fallback
routes since this is not optional and yet those types don't necessarily have a component.
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.
@Fryuni what would you propose then?
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.
Since this is for next major I think it would be better to change the name of this field to something like subject
and then document what it means for different route types.
- For
page
routes, it is the Astro component to be rendered. - For
endpoint
routes, it is the file declaring the method handlers. - For
redirect
routes, it is the target mask of the redirect. - For
fallback
routes, it is the subject of the route used as fallback.
I ported over the adapter related changes here withastro/adapters#377 |
This reverts commit 235bf78.
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
Changes ported to the adapters repo
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.
We discussed with the rest of team platform and sounds like we want a bigger refactor of this interface, not just a proxy of the internal type
@florian-lefebvre I don't think we said we shouldn't merge this though. Unless we have a solid idea for such a refactor this is a small improvement. |
ah that's not what i understood! Feel free to merge as is then |
To clarify a bit, in the last standup I brought up that I hoped the API would shrink down by a lot more (like 3-5 properties only). Designing it as if from scratch, exposing the crucial ones, rather than exposing as much as possible to keep backwards compat for integrations who use them. Because I think But anyways I don't mind this merging and we can re-iterate again in the beta if we want. |
IIRC Ema did this on a TBD and most of the fields were being used by official UI framework integrations and adapters. So this just separates the types so they can evolve independently and we can then see whether the features relying on those fields should be implemented differently. |
Yeah, I can confirm that all fields exposed by the new interface are used by integrations and adapters maintained by us. I believe that's one of those cases where we would like to refactor it, but it's too late now |
Changes
Closes PLT-2338
This PR changes the type passed to integrations regarding the routes.
RouteData
was never meant for external usage, in fact it lacks JSDocs.This wasn't intentional, and with v5 we plan to fix this. In fact, with the new type
IntegrationRouteData
, we removedisIndex
andfallbackRoutes
from being passed to the integrations, because they were never meant to be used by downstream integrations.With this PR, I took the chance to add some proper documentation, so downstream developers (and us), know what each field is about.
Also, this PR fixes a critical bug.
RouteData.distURL
needs to be an array, because a route can generate multiple files, and until now we were saving only the last file generated.This PR changes to be an array, which is marked as a breaking change.
Testing
The existing CI should pass
Docs
Added changesets
withastro/docs#9273