solid-start
solid-start copied to clipboard
add a new server functions rename transform
Supersedes https://github.com/solidjs/solid-start/pull/147
Adds a new babel plugin to rename the server functions to make sure they can be uniquely identified after the code gets split up by the routeData
transform.
This allows us to alter the plugin order without causing potential conflicts like discussed in #147.
The CI is failing.. could you see why? You can run the tests locally by running pnpm run test
in the monorepo
Was missing a check to only add the import if it's actually needed, looks like that caused some issues.
I think the serverResource
transform should probably be moved above the renameServer
transform so that the server calls can all be renamed but doing so causes an error with the sessions-test.
The error is
ReferenceError: server is not defined
The logic added to the server transform to add back the import should cover this so I'm not sure why it's happening.
Should be ok to merge now.
Ended up finding an off by one error using something like this:
export function routeData() {
server((a: number, b: number, c: number) => {
console.log("handler0", a, b, c)
})(1, 2, 3)
return createServerData(async (_, { request }) => {
console.log("handler1")
})
}
The first server
call was getting called with the request parameter from the createServerData
call.
Rebased this, also not quite sure why github displays the diff for babel.js
like that, there isn't actually that much change, the vscode built-in diff view displays it correctly.
In setting up for SolidStarts next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed in mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.