fix: correctly resolve $app/state (alternative)#13192
Conversation
fixes #13179 Uses the same approach as the other virtual modules to differentiate between client and server
🦋 Changeset detectedLatest commit: ebd0d32 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 |
|
do we want to keep the separate client and server files and rely on them being side effect free and the unused import treeshaken or consolidate all code into the index file and branch inside this one file? looking at https://github.com/sveltejs/kit/blob/main/packages/kit/src/runtime/app/stores.js maybe app/state.js instead of a subdirctory with 3 files would follow that pattern more closely? |
|
I kept it like this because it made code easier to reason about - TBH we should maybe go the other way around if we want to consolidate. And also, if we require Vite 6 in SvelteKit 3, we could switch back to the package.json approach, as that seems to work there. |
|
It works 👍🏼 Vite 5 example with this PR |
Alternative to #13181, fixes #13179
Uses the same approach as the other virtual modules to differentiate between client and server
Note that I haven't tested this out with an actual Vite 5 project yet (if someone could that would be great; I probably won't have much time to do so)
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.