…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; retarget to
masteronce #4104 and #4136 merge). Follow-up for the pre-existing module-typing gaps noted there.Motivation
Before: the playground editor mounted
react/jsx-runtimeasdeclare module "react/jsx-runtime" { import './'; }, which exports nothing (TS2439 inside the lib), so the@data-client/reactlibs'react_jsx_runtime.JSXreferences errored andjsx/jsxsimports failed.path-to-regexpwas never mounted, so@data-client/rest'sPathFunction/ParamDatawere unresolved.editor-types/bignumber.d.tswas a stale v9 stub pointing at atypes.d.tsthat was never mounted, sobignumber.jswasany, andBigNumber(provided by the preview scope) was "Cannot find name" without an import.After:
Solution
copywebsitetypes.shnow copies@types/react/jsx-runtime.d.ts(with"./"rewritten to"react", since ambient modules can't use relative imports),path-to-regexp/dist/index.d.ts, andbignumber.js/dist/bignumber.d.mts(v11 moved its types todist/, so the old copy path no longer existed). The generated copies are committed like the other editor types.MODULE_LIBSentries now name their mount file instead of a directory, soreact/jsx-runtimemounts at@types/react/jsx-runtime.d.tsalongside the newpath-to-regexpentry. The hand-written jsx-runtime stub is gone.globalScopeLib()addsexport import BigNumber = _BigNumber, so the global is a value, type and namespace like the import.Verification
tsWorker+ TS 5.9.3 running the realfetchTypeLibs/addTypeLibs) over 119 playgrounds (281 files) indocs/, blog, pages and homepage demos: no playground diagnostics changed. In the libs, the TS2439/TS2694 jsx-runtime errors, bothCannot find module 'path-to-regexp'errors and the bignumber stub errors are gone; the only new lib diagnostics are TS1038 (declareinsidedeclare module), which every existing lib already has andskipLibCheckhides.node_modules/monaco-editor): Monaco markers on 10 pages (homepage, network-transform, computed-properties, RestEndpoint, resource, Collection, …) are identical before and after. A probe model confirmsBigNumberglobal and import are typed,jsxresolves, and unknown names still error.yarn workspace rdc-website typecheckand lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01W5R8xxJwz7dAy3Uk2v5eH5
Generated by Claude Code
Note
Low Risk
Changes are limited to playground editor type vendoring and Monaco wiring; no runtime app or package API behavior.
Overview
Improves Monaco intellisense in the docs playground by mounting real type definitions for modules that
@data-clientlibs already reference.copywebsitetypes.shnow vendors@types/react/jsx-runtime(with./imports rewritten toreact),path-to-regexpfromdist/, and bignumber.js v11 types fromdist/bignumber.d.mtsinstead of the broken v9 stub path.typeLibs.tsregistersreact/jsx-runtimeandpath-to-regexp, mounts each lib at an explicitnode_modules/...file path (not alwaysindex.d.ts), drops the empty hand-writtenjsx-runtimeshim, and exposesBigNumberas a typed global inglobalScopeLib()alongside the preview scope.Reviewed by Cursor Bugbot for commit 8a9b608. Bugbot is set up for automated code reviews on this repo. Configure here.