…cript (#4136)
* internal(website): Reorganize Playground into editor/monaco/preview
Split the 362-line monaco-init into focused modules (setup, typeLibs,
theme, navigation, modelPath), group preview execution under preview/,
and replace forwarding modules with direct imports. Behavior is
unchanged; the new README documents the SSR, incremental-loading,
mobile/bot and hidden-tab invariants a future change must keep.
- monaco/: setup side effect, table-driven type libs (same chunks and
order), cross-tab navigation, `/<id>/<path>` model URI helpers
- editor/: InteractiveEditor (Monaco or mobile react-live) and
StaticEditor (SSR/crawler/loading markup)
- userAgent.ts: one source for bot/mobile regexes (isGoogleBot → isBot)
- Remove PlaygroundEditor, PlaygroundLiveEditor, DiffEditorChooser
aliases, the unused readOnly prop, and unreferenced resources/
- Unit tests for highlight selections and model paths
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Keep highlightSelections free of website-only deps
CI runs Playground unit tests without website dependencies installed,
so parse the highlight range in InteractiveEditor and pass line numbers.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Cover useModelId and empty highlight ranges
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Restore PlaygroundEditor, PlaygroundLiveEditor, DiffEditorChooser, readOnly and resources
Keep these entry points and the readOnly option available for future
use; they now point at the reorganized editor modules.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Restore deletions Staff already accepted
cf2de88 brought the dead files and the unused editor prop back.
This commit restores the deletions Staff already accepted.
Review: #4104 (review)
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* internal(website): Keep restored Playground files and readOnly prop
Reverts 82bf2d0 per Nathaniel's choice to keep PlaygroundEditor,
DiffEditorChooser, the readOnly prop and Playground/resources for now.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Correct useModelId comment and DiffEditor README chain
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Scope import completions per playground, accept bare path= metastrings
Import completions for relative paths now list only files from the same
playground instead of every Monaco model on the page. Fence metastrings
accept unquoted path=a.ts (used in docs/rest/api/RestEndpoint.md). Also
prettier-formats the Playground README.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Declare playground editor globals with valid TypeScript
`declare globals { … }` is not TypeScript; the playground globals only typed
because parser error recovery leaked the wrapped declarations into global
scope, and DateTimeFormat silently became `any`.
Mount editor-types/globals.d.ts as a module and alias its exports, React,
JSX, NumberFlow, Temporal, DateTimeFormat and Manager into `declare global`.
Also type TextInput/TextArea/Formatted props that referenced unresolved names.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkVym3YjjuSjBKhLLwvZm6
* internal(website): Type use and mockFetch playground globals
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkVym3YjjuSjBKhLLwvZm6
* internal(website): Type React jsx-runtime, path-to-regexp and bignumber.js in playgrounds (#4137)
Mount real declarations for `react/jsx-runtime` (was an empty stub),
`path-to-regexp` (never mounted, so @data-client/rest's PathFunction and
ParamData were unresolved) and `bignumber.js` (stub whose types were never
mounted), and declare `BigNumber` as a playground global since the preview
scope provides it.
Claude-Session: https://claude.ai/code/session_01W5R8xxJwz7dAy3Uk2v5eH5
Co-authored-by: Claude <noreply@anthropic.com>
* internal(website): Type csstype and number-flow in playgrounds (#4139)
* internal(website): Type React jsx-runtime, path-to-regexp and bignumber.js in playgrounds
Mount real declarations for `react/jsx-runtime` (was an empty stub),
`path-to-regexp` (never mounted, so @data-client/rest's PathFunction and
ParamData were unresolved) and `bignumber.js` (stub whose types were never
mounted), and declare `BigNumber` as a playground global since the preview
scope provides it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W5R8xxJwz7dAy3Uk2v5eH5
* internal(website): Type csstype and number-flow in playgrounds
React's CSSProperties and NumberFlow's props resolved through unmounted
modules, so style values and NumberFlow format/trend/plugins were any.
Mount csstype (comments stripped, 85KB -> 31KB gzipped) and a bundled
number-flow/lite; number-flow/plugins re-exports from it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SP4rqYKdew65uNyP8xeJ9m
* internal(website): Bundle @number-flow/react types with number-flow
Bundle @number-flow/react's .d.ts with its number-flow/lite and
number-flow/plugins imports inlined, instead of mounting those as
separate modules with a hand-written plugins stub. uuid and number-flow
now share one editor-types rollup config and resolver.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SP4rqYKdew65uNyP8xeJ9m
---------
Co-authored-by: Claude <noreply@anthropic.com>
* internal(website): Simplify Playground metastring, model path and type-lib helpers
- One metaValue() parser for title= and path= (quotes optional for both)
- One anchored model-id regex; stripModelId is a replace
- Mark preview-scope global libs in MODULE_LIBS instead of modules[0]
- language is required on InteractiveEditor (codeModel always sets it)
- Drop unused return from Monaco setup
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
* internal(website): Simplify playground globals parsing
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkVym3YjjuSjBKhLLwvZm6
* internal(website): Simplify playground editor-types build
Bundle globals.d.ts from the editor-types rollup config (one rollup run,
identical output), make mockFetch generic to match its editor declaration,
and trim the README note.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkVym3YjjuSjBKhLLwvZm6
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Requested by Nathaniel · project thread
Stacked on #4136 (base is its branch, which now includes #4137; retarget to
masteronce #4104 and #4136 merge).Motivation
Before:
editor-types/react.d.tsimportscsstypeand@number-flow/reactimportsnumber-flow/liteandnumber-flow/plugins, none of which were mounted, so style values and NumberFlow'sformat/trend/pluginsprops wereany.After:
Solution
csstype:copywebsitetypes.shreprintscsstype/index.d.tswithout comments (newscripts/strip-dts-comments.mjs). Its MDN JSDoc is ~75% of the file, so this cuts the chunk from 85KB to 31KB gzipped (react.d.ts is 33KB) at the cost of CSS property hover docs.@number-flow/react: instead of a verbatim copy, rollup-plugin-dts now bundles it with itsnumber-flow/liteandnumber-flow/pluginsimports inlined (8KB, only importsreact), so no extra modules are mounted.uuid-types.rollup.config.jsbecomeseditor-types.rollup.config.js, building bothuuidand@number-flow/reactwith one shared resolver for./x.jsand extensionless./ximports (uuid.d.tsoutput is unchanged).Verification
tsWorker+ realfetchTypeLibs/addTypeLibs) over 119 playgrounds (281 files): no playground diagnostics changed, so no docs code had invalid style props. In the libs, theCannot find moduleerrors forcsstype/number-flow/*are gone; the only new ones are TS1038 (declareinsidedeclare module), which every lib already has andskipLibCheckhides.yarn workspace rdc-website typecheck, lint and prettier clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01SP4rqYKdew65uNyP8xeJ9m