Commit graph

63 commits

Author SHA1 Message Date
renovate[bot]
f9424a487d
Update NPM Development dependencies (#11297) 2024-05-05 21:08:19 -04:00
renovate[bot]
c1a2a60182
Update NPM Development dependencies (#11196)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-29 08:33:12 +02:00
renovate[bot]
23f8e1c3c8
Update NPM Development dependencies (#11083) 2024-04-21 20:52:13 -05:00
renovate[bot]
cbd500141f
Update NPM Development dependencies (#10947)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-15 09:03:19 +02:00
renovate[bot]
86419c8ab9
chore(deps): update npm development dependencies (#10827)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2024-04-08 07:00:42 +00:00
renovate[bot]
23e8279093
chore(deps): update npm development dependencies (#10716) 2024-04-01 16:10:33 +00:00
renovate[bot]
20d69ea504
chore(deps): update npm development dependencies (#10697) 2024-04-01 10:45:07 -04:00
renovate[bot]
72aa1ce00f
Update dependency uuid to v9.0.1 (#10615)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 12:05:17 +00:00
renovate[bot]
b6b737c937
Update dependency @miniflare/storage-memory to v2.14.2 (#10614)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 12:04:59 +00:00
renovate[bot]
b074e7dc9b
Update dependency @miniflare/kv to v2.14.2 (#10613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 12:03:41 +00:00
renovate[bot]
e81f1f7971
Update NPM Development dependencies (#10610)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 12:53:29 +01:00
renovate[bot]
e0ab5629cc
Update dependency wrangler to v2.20.2 (#10577) 2024-03-25 17:50:23 -05:00
Charlie Marsh
563374503f
Enable short URLs in the playground (#6383)
## Summary

This PR adds a [Workers
KV](https://developers.cloudflare.com/workers/runtime-apis/kv/)-based
database to the playground, which enables us to associate shared
snippets with a stable ID, which in turn allows us to generate short
URLs, rather than our existing extremely-long URLs.

For now, the URLs are based on UUID, so they look like
https://play.ruff.rs/a1c40d58-f643-4a3e-bc23-15021e16acef. (This URL
isn't expected to work, as the playground isn't deployed; it's only
included as an example.)

There are no visible changes in the UI here -- you still click the
"Share" button, which copies the link to your URL. There's no
user-visible latency either -- KV is very fast.

For context, with Workers KV, we provision a Workers KV store in our
Cloudflare account (`wrangler kv:namespace create "PLAYGROUND"`), and
then create a Cloudflare Worker that's bound to the KV store via the
`wrangler.toml`:

```toml
name = "db"
main = "src/index.ts"
compatibility_date = "2023-08-07"

kv_namespaces = [
  { binding = "PLAYGROUND", id = "672e16c4fb5e4887845973bf0e9f6021", preview_id = "0a96477e116540e5a6e1eab6d6e7523e" }
]
```

The KV store exists in perpetuity, while the Worker can be updated,
deployed, removed, etc. independently of the KV store. The Worker itself
has unfettered access to the KV store. The Worker is exposed publicly,
and just does some basic verification against the request host.
2023-08-11 02:31:09 +00:00