Fix: exports server functions on its own module #2317
Merged
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.
What's the purpose of this pull request?
introduces a problem:
We are exporting a server function in the experimental module, and then when we try to use other functions from this file in the starter, like some hook/component/function, we get some errors like:
I think this is happening because this is not tree-shakable, and then the execute function comes together with the module.
In that way, we export the server functions to their module:
@faststore/core/experimental/server
.Starters Deploy Preview
I use the codesandbox version from this PR in a starter PR for which we are testing API Extension and section Overrides.
(see this commit).