@solidjs/vite-plugin 3.0.0-next.32 → 3.0.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/cjs/index.cjs +10 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +10 -0
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -654,6 +654,19 @@ production handler alike), and edits to the module hot-invalidate the
|
|
|
654
654
|
handler in dev. Config calls merge per key, so it composes with the
|
|
655
655
|
plugin's own runtime configuration.
|
|
656
656
|
|
|
657
|
+
Server-function requests are same-origin protected by `@solidjs/web`. To
|
|
658
|
+
allow another trusted origin, configure it in the same server-only module:
|
|
659
|
+
|
|
660
|
+
```ts
|
|
661
|
+
import { configureServerFunctionsServer } from '@solidjs/web/server-functions/server';
|
|
662
|
+
|
|
663
|
+
configureServerFunctionsServer({
|
|
664
|
+
csrf: { origin: ['https://app.example.com'] },
|
|
665
|
+
});
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
Set `csrf: false` only when another trusted layer protects the endpoint.
|
|
669
|
+
|
|
657
670
|
Meta-frameworks that need to control plugin ordering and dispatch requests
|
|
658
671
|
through their own server should use the standalone `serverFunctions()`
|
|
659
672
|
export instead, which never installs the dev middleware. See
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2933,12 +2933,22 @@ function getSolidOptions(options, isSsr, dev, isTestMode = false) {
|
|
|
2933
2933
|
hydratable: false
|
|
2934
2934
|
};
|
|
2935
2935
|
}
|
|
2936
|
+
|
|
2937
|
+
// Server components (serverFunctions.components) turn on the SSR-side
|
|
2938
|
+
// behavior-claims transform: ref/on* positions on intrinsic elements
|
|
2939
|
+
// compile to guarded `_bnd` claim holes instead of dropping. SSR-only
|
|
2940
|
+
// by construction (the dom generate ignores the flag), and apps without
|
|
2941
|
+
// the flag compile byte-for-byte as before.
|
|
2942
|
+
const serverComponents = typeof options.serverFunctions === 'object' && !!options.serverFunctions.components;
|
|
2936
2943
|
return {
|
|
2937
2944
|
moduleName: '@solidjs/web',
|
|
2938
2945
|
builtIns: SOLID_BUILT_INS,
|
|
2939
2946
|
contextToCustomElements: true,
|
|
2940
2947
|
wrapConditionals: true,
|
|
2941
2948
|
...solidOptions,
|
|
2949
|
+
...(serverComponents && solidOptions.generate === 'ssr' ? {
|
|
2950
|
+
serverComponents: true
|
|
2951
|
+
} : {}),
|
|
2942
2952
|
dev,
|
|
2943
2953
|
...(options.solid || {})
|
|
2944
2954
|
};
|