-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add a new Astro.metadata
global object
#10844
Comments
I'd like to work on this please |
hey, it's the guy from discord |
I might have missed the context on this one. So it looks like this is just the route string, right? What's the use-case for adding this? |
Hi @matfire , I think we are going to hold off on this feature. We are having some internal discussions about the use case, and this is my fault for rushing things without communicating with the rest of the team. I am going to close for the time being, I hope you haven't started any work in the meantime. |
I'd started looking at the codebase and trying to get a feel of how it all comes together :) |
This is an opportunity to land a new feature in Astro, without knowing too much about the internals; however, you must be familiar with Astro itself because you will implement a test that would require familiarity as a user. You will have to take care of everything:
Important
We want to land this feature for Astro v4.8, scheduled for the 9th of May. Please don't volunteer if you can't commit to this deadline.
Feature
We want to add a new
Astro.metadata
. Themetadata
will be used to store read-only information that integrations and users can use to implement some logic.For this feature/issue, you will add
Astro.metadata.route
.Technical changes
Here's a TODO list of the things that you will have to do in order to land the PR:
metadata
in theAstroGlobal
interfaceastro/packages/astro/src/@types/astro.ts
Lines 172 to 176 in a2df344
AstroGlobalMetadata
interface and addroute
. Theroute
type must beRouteData['route']
. Make sure to document the stuff that you add. Follow the in-code patterns.Astro
global object withmetadata.route
. TheRenderContext
has aRouteData
object, that's wheremetadata.route
will come from. I don't think we need any caching:astro/packages/astro/src/core/render-context.ts
Line 150 in a2df344
astro/packages/astro/src/core/render-context.ts
Line 309 in a2df344
astro-global.test.js
, we can update that test with new use cases.Coordination
GitHub and Discord are the best places for coordination. Use the
#contribute
channel for questions.The text was updated successfully, but these errors were encountered: