Conversation
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
commit: |
9e2cca0 to
bff6eac
Compare
3a7184d to
1d3f5e5
Compare
|
Hey! Looking to support in any way I can to get this ready, and ideally backported to v1 🙏 This issue has been holding us back from upgrading our very large main codebase past 1.0.10, we have way too much "use server" functionality with transitive imports affected by this, would end up leaking server code to the client without this patch. I ran a couple tests with this locally on my system and it looks great, there are a couple extra tests I would recommend adding which got hairy with previous hacky implementations I had attempted, and would be nice to have for regression testing:
Happy to write these up and submit them as my best guess to match current test patterns just don't want to contribute anything that might slow down the timeline if the tests don't match expected structure Anything else I can do please let me know! |
|
@agoldstein03 Not really sure if it can be backported to 1.0 The two you listed can probably be added, not the third one just because it's tricky to do so |
Linking #2094, related |
// apps/tests/src/functions/use-is-server-with-anon-default-export.ts
export default function () {
return null;
}
+
+function test(arg: string) {}It errors with:
It errors with: |
|
@yinonburgansky first one should be fixed, not sure with the second one, please try again and see if it persists |
Use this git patch on the repo to reproduce: diff --git a/apps/tests/package.json b/apps/tests/package.json
index 97483d6b..ea52d4fd 100644
--- a/apps/tests/package.json
+++ b/apps/tests/package.json
@@ -16,7 +16,8 @@
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.3",
- "@solidjs/start": "workspace:*",
+ "@solidjs/start": "https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2070",
+ "@solidjs/vite-plugin-nitro-2": "https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2070",
"@solidjs/testing-library": "^0.8.10",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/user-event": "^14.5.2",
diff --git a/apps/tests/vite.config.ts b/apps/tests/vite.config.ts
index 4149be66..67bb470e 100644
--- a/apps/tests/vite.config.ts
+++ b/apps/tests/vite.config.ts
@@ -1,6 +1,6 @@
import { defineConfig } from "vite";
-import { solidStart } from "../../packages/start/src/config";
-import { nitroV2Plugin } from "../../packages/start-nitro-v2-vite-plugin/src";
+import { solidStart } from "@solidjs/start/config"
+import { nitroV2Plugin } from "@solidjs/vite-plugin-nitro-2"
export default defineConfig({
server: {apply the patch and run: $ pnpm dedupe
$ pnpm --filter tests build
error during build:
[vite]: Rollup failed to resolve import "/solid-start/node_modules/.pnpm/@solidjs+start@https+++pkg.pr.new+solidjs+solid-start+@solidjs+start@2070_@testing-libr_38fcfe0e0a57b61247a9db6a54321215/node_modules/@solidjs/start/dist/server/server-runtime.ts" from "/solid-start/apps/tests/src/routes/is-server-nested.tsx?pick=default&pick=$css". |
|
Another issue is: $ pnpm --filter tests build
[plugin solid-start:server-functions/compiler] Sourcemap is likely to be incorrect: a plugin (solid-start:server-functions/compiler) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help (x27) |
This PR intends to replace the current directives plugin (TanStack) with our own.
Features:
createServerReference. This limited the server functions for only top-level declaration. The new plugin now allows inner declarations via cloning (this introduces a new API calledcloneServerReference), so now the server functions are able to be registered ahead of time while deferring the actual instance in the exact time it is declared by intention.