Skip to content

Remove context pointer #98

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Remove context pointer #98

wants to merge 2 commits into from

Conversation

jeffcharles
Copy link
Contributor

This is an example of how we could remove the context pointer from all the APIs. It simplifies the API for the consumer since they no longer need to be aware of the context, there's no pointer they need to store and pass. It also reduces fuel usage by ~6% in the tests because we do not need to perform null checks on the context.

My plan is to build on this to remove shopify_function_context_new and shopify_function_output_finalize from the partner facing API and have the host environment perform the equivalent operations. Having the host perform these operations reduces the scope of what partner is responsible for (these operations should always be the same for all Functions) and will give us the option to exclude these operations from the fuel and timeout limits given these aren't really partner code and are required for a Function to be useful.

@jeffcharles jeffcharles mentioned this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants