tldraw/apps/vscode/extension/src
David Sheldrick ee6aa172b2
Unfurl bookmarks in worker (#4039)
This PR adds a `GET /api/unfurl?url=blahblah` endpoint to our worker.

I tried out the existing cheerio implementation but it added 300kb to
our worker bundle in the end, due to transitive dependencies.

So I implemented the same logic with cloudflare's sanctioned streaming
HTML parser `HTMLRewriter` and it seems to work fine.

I also made the vscode extension do its fetching locally (from the node
process so it's not bound by security policies), retaining the cheerio
version for that. At the same time I fixed a bug in the RPC layer that
was preventing unfurled metadata from loading correctly.

In a few months we can retire the bookmark-extractor app by just
deleting it in the vercel dashboard.

### Change Type


<!--  Please select a 'Type' label ️ -->

- [ ] `feature` — New feature
- [x] `improvement` — Product improvement
- [ ] `api` — API change
- [ ] `bugfix` — Bug fix
- [ ] `other` — Changes that don't affect SDK users, e.g. internal or
.com changes


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Do link unfurling on the same subdomain as all our other api
endpoints.
2024-07-01 14:40:03 +00:00
..
extension.ts replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
file.ts [DX] sensible defaults for createTLStore (#3886) 2024-06-05 14:29:54 +00:00
TldrawDocument.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
TldrawEditorProvider.ts replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
TldrawWebviewManager.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
unfurl.ts Unfurl bookmarks in worker (#4039) 2024-07-01 14:40:03 +00:00
utils.ts replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
WebViewMessageHandler.ts Unfurl bookmarks in worker (#4039) 2024-07-01 14:40:03 +00:00