-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Support runes #425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: Support runes #425
Conversation
🦋 Changeset detectedLatest commit: 0a61e91 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 |
Pull Request Test Coverage Report for Build 6898873227Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
I could not figure out how to test this because the globals are different for Svelte4 and Svelte5. Once I created the expected files for Svelte5, but there are too many additional lines. Any suggestions? |
Wow! I noticed this PR after opening #426. This PR seems to be a little more advanced than #426 as type information for runes is added.
In #426, the idea is to explicitly opt in to runes mode using an option to make it work. |
From the user's point of view, using Svelte5 = being able to use runes, so if there is a way to not force users to configure it, that would be good. About test, how about to extract variables part and prepare only this part for Svelte4 and Svelte5 separately. One question, my understanding is that the Svelte compiler is not bundled with |
I think my todo is there.
|
Oh but your PR supports |
Yeah, we specifying |
What do you think is the best way to do Next Action?
|
I think we can consider what our options are after Svelte v5 is released. I believe we can remove options or even change the defaults for options.
Yeah, I would like to change and merge #426 after this PR is merged. |
Oh, I think it's a good idea to judge by svelte version rather than using options. Installing svelte v5 means the user is explicitly using pre-release. |
src/parser/globals.ts
Outdated
"$state", | ||
"$derived", | ||
"$effect", | ||
"$effect.pre", |
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.
Since $effect.pre
is a member of $effect
, I don't think it is necessary to define it here.
"$effect.pre", |
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.
Fixed!
Tomorrow I will add more tests for runes. |
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.
It looks mostly good, but I did make one comment 😃
if ( | ||
scopeManager.globalScope!.through.some( | ||
(reference) => reference.identifier.name === svelte5Global, | ||
) | ||
) { |
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.
By moving this judgment before the switch
, I think we can eliminate the four same implementations.
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.
Ohhhhh...
0a61e91
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.
LGTM!
No description provided.