Skip to content

Commit e69d85b

Browse files
committed
Merge branch 'main' into aa-coordination
2 parents 8055046 + f67cf20 commit e69d85b

File tree

4 files changed

+693
-76
lines changed

4 files changed

+693
-76
lines changed

.github/workflows/pkg.pr.new.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
- name: Checkout code
1010
uses: actions/checkout@v4
1111

12+
- name: install corepack
13+
run: npm i -g [email protected]
14+
1215
- run: corepack enable
1316
- uses: actions/setup-node@v4
1417
with:

documentation/docs/07-misc/07-v5-migration-guide.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,39 @@ If a bindable property has a default value (e.g. `let { foo = $bindable('bar') }
722722
723723
### `accessors` option is ignored
724724
725-
Setting the `accessors` option to `true` makes properties of a component directly accessible on the component instance. In runes mode, properties are never accessible on the component instance. You can use component exports instead if you need to expose them.
725+
Setting the `accessors` option to `true` makes properties of a component directly accessible on the component instance.
726+
727+
```svelte
728+
<svelte:options accessors={true} />
729+
730+
<script>
731+
// available via componentInstance.name
732+
export let name;
733+
</script>
734+
```
735+
736+
In runes mode, properties are never accessible on the component instance. You can use component exports instead if you need to expose them.
737+
738+
```svelte
739+
<script>
740+
let { name } = $props();
741+
// available via componentInstance.getName()
742+
export const getName = () => name;
743+
</script>
744+
```
745+
746+
Alternatively, if the place where they are instantiated is under your control, you can also make use of runes inside `.js/.ts` files by adjusting their ending to include `.svelte`, i.e. `.svelte.js` or `.svelte.ts`, and then use `$state`:
747+
748+
```js
749+
+++import { mount } from 'svelte';+++
750+
import App from './App.svelte'
751+
752+
---const app = new App({ target: document.getElementById("app"), props: { foo: 'bar' } });
753+
app.foo = 'baz'---
754+
+++const props = $state({ foo: 'bar' });
755+
const app = mount(App, { target: document.getElementById("app"), props });
756+
props.foo = 'baz';+++
757+
```
726758
727759
### `immutable` option is ignored
728760

playgrounds/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"polka": "^1.0.0-next.25",
1717
"svelte": "workspace:*",
1818
"tiny-glob": "^0.2.9",
19-
"vite": "^5.4.6",
19+
"vite": "^6.0.9",
2020
"vite-plugin-inspect": "^0.8.4"
2121
}
2222
}

0 commit comments

Comments
 (0)