-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only treat instance context exports as accessors (#9500)
* failing test for #9499 * limit export handling to instance context * changeset --------- Co-authored-by: Rich Harris <[email protected]>
- Loading branch information
1 parent
ede1edd
commit c827b0c
Showing
4 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: only treat instance context exports as accessors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/svelte/tests/runtime-runes/samples/module-context-export/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
html: `<p>42</p>`, | ||
|
||
async test({ assert, target, window, component }) { | ||
assert.equal(component.answer, undefined); | ||
} | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/module-context-export/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<svelte:options runes /> | ||
|
||
<script context="module"> | ||
export const answer = 42; | ||
</script> | ||
|
||
<p>{answer}</p> |
c827b0c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-5-preview – ./sites/svelte-5-preview
svelte-5-preview-svelte.vercel.app
svelte-octane.vercel.app
svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview.vercel.app