From 4f8597dc0e04f1cdb5c5502f6f82499ccb9c7b97 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 23 Sep 2024 15:22:20 -0700 Subject: [PATCH] better handling of exports client/server --- .changeset/odd-onions-agree.md | 5 +++++ .changeset/tasty-knives-rhyme.md | 8 ++++---- packages/solid/store/src/server.ts | 6 +----- packages/solid/web/server/index.ts | 9 --------- 4 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 .changeset/odd-onions-agree.md diff --git a/.changeset/odd-onions-agree.md b/.changeset/odd-onions-agree.md new file mode 100644 index 000000000..7b3b756cf --- /dev/null +++ b/.changeset/odd-onions-agree.md @@ -0,0 +1,5 @@ +--- +"solid-js": minor +--- + +better handling of exports client/server diff --git a/.changeset/tasty-knives-rhyme.md b/.changeset/tasty-knives-rhyme.md index 6b6301ba3..f975fdfbf 100644 --- a/.changeset/tasty-knives-rhyme.md +++ b/.changeset/tasty-knives-rhyme.md @@ -1,8 +1,8 @@ --- -"babel-preset-solid": patch -"solid-js": patch -"solid-element": patch -"test-integration": patch +"babel-preset-solid": minor +"solid-js": minor +"solid-element": minor +"test-integration": minor --- update dom-expressions diff --git a/packages/solid/store/src/server.ts b/packages/solid/store/src/server.ts index 80a08b75a..779578d6a 100644 --- a/packages/solid/store/src/server.ts +++ b/packages/solid/store/src/server.ts @@ -118,7 +118,7 @@ export function createMutable(state: T | Store): T { } export function modifyMutable(state: T, modifier: (state: T) => T) { - notSup(); + modifier(state); } type ReconcileOptions = { @@ -155,7 +155,3 @@ export function produce(fn: (state: T) => void): (state: T) => T { } export const DEV = undefined; - -function notSup(): never { - throw new Error("not supported on server side"); -} diff --git a/packages/solid/web/server/index.ts b/packages/solid/web/server/index.ts index b400d8b77..02c56c6f0 100644 --- a/packages/solid/web/server/index.ts +++ b/packages/solid/web/server/index.ts @@ -19,15 +19,6 @@ export { export const isServer: boolean = true; export const isDev: boolean = false; -// Types for these come from dom-expressions/src/server.d.ts -// These override the functions from dom-expressions that throw on the serverside. -export function render() {} -export function hydrate() {} -export function insert() {} -export function spread() {} -export function addEventListener() {} -export function delegateEvents(): void {} - export function Dynamic( props: T & { children?: any; component?: Component | string | keyof JSX.IntrinsicElements } ) {