[chore] use in memory object instead of Cloudflare KV API for demo app
#4266
Closing issue
Describe the bug
I have seen so many people complaining that SvelteKit is slow. No one realizes that a locally created demo app would be making network calls.
E.g. https://discord.com/channels/457912077277855764/939868205869072444/950313663850508328
This would also solve our issues around eventual consistency: #1564
Reproduction
I don't know if these people have particularly slow network connections or the app or host is sometimes being quite slow
Logs
No response
System Info
N/A
Severity
annoyance
Additional Information
No response
Pull request
fix: #4264
I am accessing the Demo app from Tokyo but the response is not good. I considered using indexedDB or Session Storage but did not adopt them because it is important that this process be performed on the back end. And the process should not be complex to avoid making noise, so I finally opted for a simple in-memory object. Any opinions for a better demo app?
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- This message body should clearly illustrate what problems it solves.
- Ideally, include a test that fails without this PR but passes with it.
Tests
- Run the tests with
pnpm testand lint the project withpnpm lintandpnpm check
Changesets
- If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running
pnpx changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0
Info
🦋 Changeset detected
Latest commit: b909690
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| default-template | Patch |
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
@baseballyama I thought using a Map would be more semantically correct, and abstracting the db operations would help with readability, so I've made a PR over at your branch baseballyama#6
The abstractions should make it easier to add some persistence as well if needed.
I don't think there is consensus on this PR yet, but I have modified it so that we can try both in-memory objects and Cloudflare KV API. This allows us to use in-memory objects by default, but also to demonstrate using the API. I'm not sure if we should inform users of this by some means, but I don't think it is necessary at this time.
This is a just proposal, so please close it if it is not in line with the core team's decision.
use in memory object instead of Cloudflare KV API for demo app
• Mar 7, 2022, 4:05 PMAbstract over db operations
Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)