-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: improve partial evaluation #15781
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: improve partial evaluation #15781
Conversation
🦋 Changeset detectedLatest commit: 0ef68b9 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 |
|
This is great, thank you! Hope you don't mind me jumping in, I started out with some minor comments but got carried away. Am keen to get this in to bring us slightly closer to #15292 (comment) — was there anything else you had planned for this PR or is it ready to go in its current form? |
I was thinking of maybe looking into some of the goals I outlined, such as adding more globals and maybe some function analysis, how does that sound? |
Adding more globals sounds good. I feel like function analysis could potentially become a bit of a rabbit hole with diminishing returns; maybe if you have something in mind it could be a good follow-up PR though? |
I started working on function analysis last night, I'll try pushing it (along with more globals and a couple of other smallish things) now and if there are too many possible issues, I'll remove it (and maybe work on it in a follow-up PR) |
That's not too bad, I honestly expected more failing tests. |
After looking more into the failing tests, I've decided against trying to work on this in this PR, but since it does seem rather promising, I'll work on it in another PR, probably after #15792 gets merged. |
Currently the only failing test has to do with sourcemaps, and I don't quite understand it, could you please fix it? |
looking into it |
This further improves the partial evaluation implemented in #15494. It accounts for sources that are declared as
$state
, but never reassigned to (and can be treated as constants), and other (somewhat more complex) cases.A few possible end goals for this:
closes #14280
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