Skip to content

Commit

Permalink
Fix tests, update Runes, bump Svelte version
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppahBaws committed Sep 30, 2024
1 parent 0735cc1 commit 655acc3
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 98 deletions.
4 changes: 2 additions & 2 deletions e2e/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"houdini-svelte": "workspace:^",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "5.0.0-next.243",
"svelte": "5.0.0-next.260",
"svelte-check": "^3.8.0",
"svelte-eslint-parser": "^0.36.0",
"svelte-eslint-parser": "^0.41.1",
"svelte-preprocess": "^5.1.4",
"tslib": "^2.3.1",
"typescript": "^5.0.0",
Expand Down
7 changes: 2 additions & 5 deletions e2e/kit/src/routes/lists/all/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<script lang="ts">
import { browser } from '$app/environment';
import { goto, invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { GQL_ListAll_AddUser } from '$houdini';
import { onMount } from 'svelte';
import type { PageData } from './$houdini';
export let data: PageData;
$: ({ ListAll } = data);
let limit = parseInt($page.url.searchParams.get('limit') ?? '1', 10);
onMount(() => {
updateQS();
});
$: browser && limit && updateQS();
async function updateQS() {
const newUrl = new URL($page.url);
Expand Down
6 changes: 3 additions & 3 deletions e2e/kit/src/routes/subscriptions/two/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ test('happy path updates', async ({ page }) => {

// click on one of the button to ensure we're not listening
await page.click('#mutate-foo');
await expect_to_be(page, 'undefined,undefined');
await expect_to_be(page, ',');

// test only one active
await page.click('#listen-1');
await page.click('#mutate-foo');
await sleep(100);
await expect_to_be(page, '"foo",undefined');
await expect_to_be(page, '"foo",');
await page.click('#mutate-bar');
await sleep(100);
await expect_to_be(page, '"bar",undefined');
await expect_to_be(page, '"bar",');

// test both active
await page.click('#listen-2');
Expand Down
2 changes: 1 addition & 1 deletion packages/houdini-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"houdini": "workspace:^",
"recast": "^0.23.1",
"rollup": "^3.7.4",
"svelte": "5.0.0-next.243",
"svelte": "5.0.0-next.260",
"vite": "^5.3.3"
},
"files": [
Expand Down
11 changes: 2 additions & 9 deletions packages/houdini-svelte/src/plugin/extract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,23 +380,16 @@ describe('parser svelte 5 runes detection', () => {
</script>`,
},
{
runeName: '$state.frozen',
runeName: '$state.raw',
document: `<script>
let count = $state.frozen(0);
let count = $state.raw(0);
</script>`,
},
{
runeName: '$state.snapshot',
document: `<script>
const isHoudiniAwesome = true;
console.log($state.snapshot(isHoudiniAwesome));
</script>`,
},
{
runeName: '$state.is',
document: `<script>
let isHoudiniAwesome = true;
console.log($state.is(isHoudiniAwesome, true));
</script>`,
},
{
Expand Down
5 changes: 2 additions & 3 deletions packages/houdini-svelte/src/plugin/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ type EmbeddedScript = {
useRunes: boolean
}

// Source: https://github.com/sveltejs/svelte/blob/879b0119d53e93c118c9c8519f0f7f54138c34d2/packages/svelte/src/compiler/phases/constants.js#L31
// Source: https://github.com/sveltejs/svelte/blob/b665425e5d2e41c11b3f3fd56e78b515709401c4/packages/svelte/src/utils.js#L403
// Be sure to update this when this list changes.
const svelteRunes: string[] = [
'$state',
'$state.frozen',
'$state.raw',
'$state.snapshot',
'$state.is',
'$props',
'$bindable',
'$derived',
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-svelte-global-stores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"houdini": "workspace:^",
"houdini-svelte": "workspace:^",
"recast": "^0.23.1",
"svelte": "5.0.0-next.243"
"svelte": "5.0.0-next.260"
},
"files": [
"build"
Expand Down
Loading

0 comments on commit 655acc3

Please sign in to comment.