diff --git a/packages/houdini-svelte/src/plugin/transforms/componentQuery.test.ts b/packages/houdini-svelte/src/plugin/transforms/componentQuery.test.ts index ae087f754..68ef2f129 100644 --- a/packages/houdini-svelte/src/plugin/transforms/componentQuery.test.ts +++ b/packages/houdini-svelte/src/plugin/transforms/componentQuery.test.ts @@ -290,15 +290,13 @@ describe('Svelte 5 runes', function () { let value = $derived(_houdini_TestQuery); $effect(() => { - if (isBrowser) { - _houdini_TestQuery.fetch({ - variables: marshalInputs({ - config: getCurrentConfig(), - artifact: _houdini_TestQuery.artifact, - input: {} - }) - }); - } + _houdini_TestQuery.fetch({ + variables: marshalInputs({ + config: getCurrentConfig(), + artifact: _houdini_TestQuery.artifact, + input: {} + }) + }); }); `) }) @@ -351,23 +349,21 @@ describe('Svelte 5 runes', function () { const result = $derived(_houdini_TestQuery); $effect(() => { - if (isBrowser) { - _houdini_TestQuery.fetch({ - variables: marshalInputs({ - config: getCurrentConfig(), - artifact: _houdini_TestQuery.artifact, - - input: _TestQueryVariables.call(new RequestContext(), { - props: { - prop1: prop1, - prop2: prop2, - prop3: prop3, - prop4: prop4 - } - }) + _houdini_TestQuery.fetch({ + variables: marshalInputs({ + config: getCurrentConfig(), + artifact: _houdini_TestQuery.artifact, + + input: _TestQueryVariables.call(new RequestContext(), { + props: { + prop1: prop1, + prop2: prop2, + prop3: prop3, + prop4: prop4 + } }) - }); - } + }) + }); }); `) }) diff --git a/packages/houdini-svelte/src/plugin/transforms/componentQuery.ts b/packages/houdini-svelte/src/plugin/transforms/componentQuery.ts index e13514279..85d141c0b 100644 --- a/packages/houdini-svelte/src/plugin/transforms/componentQuery.ts +++ b/packages/houdini-svelte/src/plugin/transforms/componentQuery.ts @@ -224,10 +224,9 @@ export default async function QueryProcessor(config: Config, page: SvelteTransfo /** * In Runes mode, we need to generate: + * (the effect rune only runs in the browser, so we don't need to do an extra check) * $effect(() => { - * if (isBrowser) { - * _houdini_.fetch({...}) - * } + * _houdini_.fetch({...}) * }) * * In legacy mode, we need to generate: @@ -240,14 +239,7 @@ export default async function QueryProcessor(config: Config, page: SvelteTransfo AST.callExpression(AST.identifier('$effect'), [ AST.arrowFunctionExpression( [], - AST.blockStatement([ - AST.ifStatement( - AST.identifier('isBrowser'), - AST.blockStatement([ - AST.expressionStatement(queryLoadExpression), - ]) - ), - ]) + AST.blockStatement([AST.expressionStatement(queryLoadExpression)]) ), ]) ),