-
Notifications
You must be signed in to change notification settings - Fork 375
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: implement getServerFunctionMeta #1203
Conversation
2af6ede
to
e98f8c1
Compare
since this is related to server functions, lets use some terminology that matches that. But I am still not sure we should expose |
@nksaraf Would you construct the id how I did it earlier? ( Do you think this serverFunctionEvent object could include other stuff in the future? If we only return the id, how about we just call the helper Alternatively if you have ideas/plans to include other stuff, how about |
Yup might be better to go with Meta (and just expose the id in there). The id using |
74c0dd5
to
7b339c9
Compare
@nksaraf I renamed it to
Do you have an idea why this error is happening and how it can be prevented? I saw that |
7b339c9
to
718e401
Compare
@nksaraf Any ideas why the getRequestEvent import in solid-start breaks the dev server 😅? This is the only reason why this PR is hanging in "WIP" 🙈 |
Retested this with all latest versions. The dev server crash from importing Anyhow, this PR is ready for further discussion now :). |
My only thought here is event.context is an I guess we need to make a decision here soon. Right now it is my undocumented playground, but we need to do better. |
Okay that is weird, Vscode is showing me h3 types for Edit: Wait, so RequestEvent is an extension of h3 event and mixes solid-start and h3? Afaik The event context of h3 could theoretically be extended with solid-start stuff like so: declare module 'h3' {
interface H3EventContext {
start: {
...all of the start magic...
}
}
} But maybe there is also a discussion with @pi0 worth to have about this? |
Yes, that's precisely the purpose of |
@ryansolid How do we move forward with this PR? 😅 |
|
Unfortunately we had this convention before we adopted H3/Nitro. And there is consideration here that goes beyond SolidStart. |
Gotcha, I am looking forward what you will come up with 🙏. Just regarding "conventions": the new solid start beta changed a lot of things, removed features, removed whole apis, added others, some users have to migrate a lot of code (such as myself), I dont grasp why suddenly with the topic of event locals we should not rethink old conventions. I mean, who if not you, the CEO of signals, is not constantly reworking, rethinking, evolving old conventions 😉. I get that this goes beyond SolidStart 👍. |
7d12228
to
2aac293
Compare
Fixed merge conflicts and updated the feature to the current event structure. |
@ryansolid Any news on this? 😅 |
It was easier to cherry pick the commit than merge the merge after this took so long to get in. I will close this. But it is getting in. |
Yeah that makes absolutely sense 😅👍.
Thats some awesome news, thank you! |
This adds a new public
getServerFunctionMeta
API that can be used in "use server" functions to retrieve function related information. It can be used by the enduser as a stable key for server function related caches and debugging.Tasks
getRequestEvent
in@solidjs/start/server
breaks the vite dev servergetRpcInfo
/RpcInfo
getServerFunctionMeta / ServerFunctionMeta
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Related discussion: nksaraf/vinxi#51