d7b80baa31
Currently, we only use native `structuredClone` in the browser, falling back to `JSON.parse(JSON.stringify(...))` elsewhere, despite Node supporting `structuredClone` [since v17](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) and Cloudflare Workers supporting it [since 2022](https://blog.cloudflare.com/standards-compliant-workers-api/). This PR adjusts our shim to use the native `structuredClone` on all platforms, if available. Additionally, `jsdom` doesn't implement `structuredClone`, a bug [open since 2022](https://github.com/jsdom/jsdom/issues/3363). This PR patches `jsdom` environment in all packages/apps that use it for tests. Also includes a driveby removal of `deepCopy`, a function that is strictly inferior to `structuredClone`. ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [x] `sdk` — Changes the tldraw SDK - [x] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [x] `improvement` — Improving existing features - [x] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. A smoke test would be enough - [ ] Unit Tests - [x] End to end tests
94 lines
3.1 KiB
JSON
94 lines
3.1 KiB
JSON
{
|
|
"name": "@tldraw/docs",
|
|
"description": "A docs site for tldraw.",
|
|
"version": "2.0.0-beta.2",
|
|
"private": true,
|
|
"author": {
|
|
"name": "tldraw Inc.",
|
|
"email": "hello@tldraw.com"
|
|
},
|
|
"homepage": "https://tldraw.dev",
|
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/tldraw/tldraw"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/tldraw/tldraw/issues"
|
|
},
|
|
"keywords": [
|
|
"tldraw",
|
|
"drawing",
|
|
"app",
|
|
"development",
|
|
"whiteboard",
|
|
"canvas",
|
|
"infinite"
|
|
],
|
|
"scripts": {
|
|
"dev": "concurrently \"NODE_ENV=development next dev --port=3001\" \"tsx ./watcher.ts\" --kill-others",
|
|
"next-dev": "next dev",
|
|
"lint": "yarn run -T tsx ../../scripts/lint.ts",
|
|
"build": "yarn create-api-markdown && yarn refresh-content && next build && yarn check-links",
|
|
"start": "yarn create-api-markdown && yarn refresh-content && next start",
|
|
"fetch-api-source": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/fetch-api-source.ts",
|
|
"fetch-releases": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/fetch-releases.ts",
|
|
"check-links": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/check-broken-links.ts",
|
|
"create-api-markdown": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/create-api-markdown.ts",
|
|
"refresh-content": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/refresh-content.ts",
|
|
"refresh-embeddings": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/refresh-embeddings.ts",
|
|
"refresh-everything": "yarn fetch-api-source && yarn fetch-releases && yarn create-api-markdown && yarn refresh-content && yarn refresh-embeddings && yarn format",
|
|
"clean": "rm -rf node_modules .yarn",
|
|
"format": "yarn run -T prettier --write .",
|
|
"watch-content": "tsx ./watcher.ts"
|
|
},
|
|
"dependencies": {
|
|
"@ariakit/react": "^0.4.1",
|
|
"@codesandbox/sandpack-react": "^2.11.3",
|
|
"@microsoft/api-extractor-model": "^7.26.4",
|
|
"@microsoft/tsdoc": "^0.14.2",
|
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
"@radix-ui/react-navigation-menu": "^1.1.4",
|
|
"@tldraw/utils": "workspace:*",
|
|
"@types/broken-link-checker": "^0.7.1",
|
|
"@types/node": "~20.11",
|
|
"@types/sqlite3": "^3.1.9",
|
|
"@types/ws": "^8.5.9",
|
|
"@vercel/analytics": "^1.1.1",
|
|
"classnames": "^2.3.2",
|
|
"concurrently": "^8.2.2",
|
|
"dotenv": "^16.3.1",
|
|
"eslint": "^8.37.0",
|
|
"eslint-config-next": "13.2.4",
|
|
"github-slugger": "^2.0.0",
|
|
"gray-matter": "^4.0.3",
|
|
"next": "^14.0.4",
|
|
"next-mdx-remote": "^4.4.1",
|
|
"next-themes": "^0.2.1",
|
|
"octokit": "^3.1.1",
|
|
"openai": "^4.11.1",
|
|
"patch-package": "^8.0.0",
|
|
"postinstall-postinstall": "^2.1.0",
|
|
"prettier": "^3.0.3",
|
|
"prettier-plugin-organize-imports": "^3.2.3",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"react-hotkeys-hook": "^4.4.1",
|
|
"rehype-autolink-headings": "^7.0.0",
|
|
"rehype-highlight": "^7.0.0",
|
|
"rehype-slug": "^5.1.0",
|
|
"rehype-slug-custom-id": "^1.1.0",
|
|
"rimraf": "^4.4.0",
|
|
"sqlite": "^5.0.1",
|
|
"sqlite3": "^5.1.6",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.3.3",
|
|
"unist-util-is": "^6.0.0",
|
|
"unist-util-visit": "^5.0.0",
|
|
"vectra": "^0.4.4",
|
|
"ws": "^8.16.0"
|
|
},
|
|
"devDependencies": {
|
|
"linkinator": "^6.0.4"
|
|
}
|
|
}
|