Skip to content

Commit

Permalink
Bump Svelte version, add support for $state.is rune
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppahBaws committed May 22, 2024
1 parent f2b4272 commit cec86db
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion e2e/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"houdini-svelte": "workspace:^",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "5.0.0-next.133",
"svelte": "5.0.0-next.138",
"svelte-check": "^3.6.7",
"svelte-eslint-parser": "^0.33.1",
"svelte-preprocess": "^5.1.3",
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.133",
"svelte": "5.0.0-next.138",
"vite": "^5.1.6"
},
"files": [
Expand Down
7 changes: 7 additions & 0 deletions packages/houdini-svelte/src/plugin/extract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ describe('parser svelte 5 runes detection', () => {
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
3 changes: 2 additions & 1 deletion packages/houdini-svelte/src/plugin/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ type EmbeddedScript = {
useRunes: boolean
}

// Source: https://github.com/sveltejs/svelte/blob/8b1a26904a0d50d058564198904db578276ae775/packages/svelte/src/compiler/phases/constants.js#L31
// Source: https://github.com/sveltejs/svelte/blob/d4718e0755eac1e505292d0fb7cfd8682eca3048/packages/svelte/src/compiler/phases/constants.js#L31
// Be sure to update this when this list changes.
const svelteRunes: string[] = [
'$state',
'$state.frozen',
'$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.133"
"svelte": "5.0.0-next.138"
},
"files": [
"build"
Expand Down
92 changes: 46 additions & 46 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cec86db

Please sign in to comment.