-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: catch error on @const tag in svelte:boundary in DEV mode #15369
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0ab422b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
We definitely need a test for this
you can specify |
Test added. |
Should be fixed now |
|
Please wait to merge. |
I think it's way better like that, since it modifies fewer files... |
I agree...much better now...let me just check a couple of things as soon as we get the actual playground |
I was trying to understand if the dev flag was needed but while exploring this I think the whole accessing eagerly const tags is not really needed. Commenting the line make no test fail... @dummdidumm you added that line here ...any insight? |
I'm not sure to understand the reason, but in DEV mode, the
@const
tag add a$.get()
"to eagerly evaluate the expression in order to hit any 'Cannot access x before initialization' errors"When used in a
<svelte:boundary>
, this code need to be inside the$.boundary()
.So I added
const_dev_statements
property intoSvelteBoundary
which is populated by ConstTag when his parent is aSvelteboundary
.Not sure if this need a test, neither how to test in dev mode.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint