[chore] use in memory object instead of Cloudflare KV API for demo app
fix: https://github.com/sveltejs/kit/issues/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:
- [x] 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
- [x] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.
Tests
- [x] Run the tests with
pnpm testand lint the project withpnpm lintandpnpm check
Changesets
- [x] 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
🦋 Changeset detected
Latest commit: b90969068413ff14dc5c4706fc832370fa5d00a6
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 https://github.com/baseballyama/kit/pull/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.