kit icon indicating copy to clipboard operation
kit copied to clipboard

[chore] use in memory object instead of Cloudflare KV API for demo app

Open baseballyama opened this issue 3 years ago • 4 comments

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 test and lint the project with pnpm lint and pnpm 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 changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

baseballyama avatar Mar 07 '22 16:03 baseballyama

🦋 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

changeset-bot[bot] avatar Mar 07 '22 16:03 changeset-bot[bot]

@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

gtm-nayan avatar Mar 08 '22 03:03 gtm-nayan

The abstractions should make it easier to add some persistence as well if needed.

gtm-nayan avatar Mar 08 '22 04:03 gtm-nayan

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.

baseballyama avatar Mar 13 '22 14:03 baseballyama