Skip to content

internal(website): Reorganize Playground into editor/monaco/preview - #4104

Merged
ntucker merged 14 commits into
masterfrom
claude/project-thread-9udgck
Oct 4, 2026
Merged

ntucker merged 14 commits into
masterfrom
claude/project-thread-9udgck

Conversation

@ntucker

@ntucker ntucker commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Motivation

Before: the Playground folder mixed Monaco bootstrap, preview execution, editor UI and shared chrome at one level; monaco-init.ts was a 362-line side-effect module; the SSR / incremental-loading / mobile / crawler behaviors lived only in scattered comments, so a cleanup could drop one silently. Import completions offered files from every playground on the page, and unquoted path= metastrings were ignored.

After: the same behavior, organized by concern, with a Playground/README.md that lists every invariant (SSG markup, chunking and CDN hints, mobile/bot fallbacks, hidden Demo tabs, editor and preview behaviors) to check changes against. Import completions list only the current playground's files, and path=Todo.ts works like path="Todo.ts".

Solution

  • monaco/: setup.ts (the side-effect entry: UA gate, resource hints, CDN loader, compiler options), typeLibs.ts (table-driven; same webpack chunk names, lazy-once data-client chunk, fetch and addExtraLib order), theme.ts, navigation.ts (cross-tab go-to-definition + import completions, now scoped per playground via siblingFilePaths), modelPath.ts (the /<id>/<path> URI scheme that used to be a cross-file comment), highlightSelections.ts (pure, tested), plus moved options, language, resourceHints, generated preloadManifest (generator path updated), useAutoHeight.
  • editor/: InteractiveEditor (was PlaygroundMonacoEditor; Monaco on desktop, editable react-live on mobile/bots, client-only) and StaticEditor (the SSR/crawler/loading markup, previously duplicated). TextEditTab collapses its two branches into one. codeModel accepts quoted or bare path=.
  • preview/: Preview, PreviewBlock, PreviewWrapper, StoreInspector, Tree, FixturePreview, transformCode, temporal join LivePreview/scope.
  • userAgent.ts: one definition of the bot and mobile regexes; isGoogleBot → isBot (it matched every crawler).
  • Kept for now (Nathaniel's call; Staff deletion request waived): PlaygroundEditor / PlaygroundLiveEditor entry points (now aliasing the new editor modules), DiffEditorChooser, the readOnly prop, and Playground/resources/.
  • HooksPlayground reuses PlaygroundProps instead of a duplicate interface. raw-plugin.js warning filter now targets monaco/typeLibs.ts.

Verification

  • yarn test --selectProjects ReactDOM --testPathPatterns website/src/components/Playground: 4 suites, 19 tests pass (new ones cover highlight selections, model paths, sibling files and bare path=); website typecheck and lint clean.
  • Full docusaurus build on master and on the reorg: same 265 asset files with the same named chunks (PreviewWithScope, PreviewBlock, *DTS), no new warnings, and all 170 generated HTML pages identical after normalizing hashed class names and script tags (the one remaining diff is a build-time timestamp in a fixture).
  • Adversarial review (Fable) of the full diff found no behavior regressions.

Follow-ups (own PRs)

  • typeLibs.ts adds extra libs as declare globals { … }, which is not TypeScript syntax (declare global); needs an in-browser check that the fix adds no new diagnostics.
  • Unused website files: website/ambientsource-plugin.js, website/src/components/useIntersectionObserver.tsx, website/src/components/Demo/Demo.module.css (pending Nathaniel's OK).

Dispositions for every review follow-up (folded, moved or rejected, with reasons): #4104 (comment)

🤖 Generated with Claude Code

https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK


Note

Medium Risk
Large structural refactor of hydration-sensitive playground and Monaco bootstrap code; behavior is intended to be unchanged but regressions in SSR, lazy loading, or editor navigation would affect every docs page with live examples.

Overview
Reorganizes the docs Playground by concern (editor/, monaco/, preview/) and documents SSR, chunking, mobile/bot, and hidden-tab invariants in Playground/README.md. The old monaco-init.ts and PlaygroundMonacoEditor are replaced by monaco/setup.ts plus smaller modules (typeLibs, theme, navigation, modelPath, highlightSelections) and InteractiveEditor with a shared StaticEditor for SSG/hydration placeholders.

Behavior tweaks: relative import completions use siblingFilePaths so only files in the same playground are offered; fence metastrings accept bare path= / title=; crawler detection is centralized as isBot in userAgent.ts (was isGoogleBot). HooksPlayground imports PlaygroundProps from Playground; webpack warning suppression and the Monaco preload generator point at the new monaco/ paths.

Reviewed by Cursor Bugbot for commit 5b856f4. Bugbot is set up for automated code reviews on this repo. Configure here.

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
@ntucker ntucker self-assigned this Oct 3, 2026
@changeset-bot

changeset-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5b856f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-site Ready Ready Preview Oct 4, 2026 4:09pm UTC

Request Review

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

The typecheck check (Vercel Preview Deployment workflow) fails on src/components/HomepageFeatures.tsx(80,5), a file this PR doesn't touch. The error comes from two copies of @types/react (@docusaurus/theme-common/node_modules/@types/react vs the root one) making the SVG module type incompatible with SvgComponent. The same check is red on the recent runs for #4059 and #4103, and I reproduced the identical three errors on a clean master checkout locally; there are no other typecheck errors with this PR's changes. No fix exists yet, so I'm not widening this PR for it; deduping @types/react (or loosening SvgComponent to accept the SVGR component type) would clear it.


Generated by Claude Code

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

@ntucker ntucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (+ FOLLOW_UP after merge). First Staff pass on cd885d85.

Behavior-neutral reorg checks out: monaco/ / editor/ / preview/ split preserves CDN hints, webpack chunk names (PreviewWithScope, PreviewBlock, *DTS, lazy-once data-client), UA gates (isBot / isMobileOrBot), hidden-Demo latch, SSR StaticEditor markup, and DiffEditor mobile/bot fallback. Alias removals (PlaygroundEditor, PlaygroundLiveEditor, DiffEditorChooser) and resources/ deletion look unused. TextEditTab collapse and HooksPlayground → shared PlaygroundProps are equivalent. New pure tests for highlightSelections / modelPath are real, not rubber stamps. README invariants are the right entropy hedge here.

Draft: Bugbot not required until Ready (Lead owns Ready after /simplify). Website typecheck red on HomepageFeatures.tsx is pre-existing on master (author note); not introduced here.

FOLLOW_UP (do not block merge)

  1. monaco/typeLibs.ts: declare globals { … } is not valid TS (declare global). Same pre-existing bug the PR correctly left alone for neutrality — fix post-merge so React / NumberFlow / Temporal preview globals actually typecheck in Monaco.
  2. Dead website files still present (called out in PR open questions): website/ambientsource-plugin.js, website/src/components/useIntersectionObserver.tsx, website/src/components/Demo/Demo.module.css — delete in a cleanup PR once unused is confirmed.
  3. Optional later: fixtures never shown in row layout; import completions list models from every playground on the page; unquoted path= metastrings — all pre-existing, fine as separate PRs.

@ntucker
ntucker marked this pull request as ready for review October 3, 2026 15:28
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.01%. Comparing base (f03332e) to head (5b856f4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4104      +/-   ##
==========================================
+ Coverage   97.93%   98.01%   +0.08%     
==========================================
  Files         158      160       +2     
  Lines        3095     3127      +32     
  Branches      619      622       +3     
==========================================
+ Hits         3031     3065      +34     
  Misses         18       18              
+ Partials       46       44       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
claude added 2 commits October 3, 2026 15:48
…ffEditorChooser, 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

@ntucker ntucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGE_THIS_PR — tip cf2de88e restores dead code Staff already blessed deleting on cd885d85 (review). “Kept for future use (per review)” misreads that note: Staff said the removals looked unused, not that they should come back.

Please undo the mistaken restore:

  1. Delete website/src/components/Playground/resources/ again (PlaceholderBaseResource.ts, TodoResource.ts). Still zero importers; README already says “currently unreferenced”; examples/Demo own their own copies. Dead sample code bitrots.

  2. Delete DiffEditorChooser.tsx and have DiffEditor.tsx import DiffEditorMonaco directly (as on the Staff-reviewed tip). The chooser is a no-op alias; SSR/mobile/bot handling already lives inside DiffEditorMonaco.

  3. Drop the unused readOnly prop on InteractiveEditor (and the editorOptions useMemo). No caller passes it; cd885d85 / the initial reorg commit already removed it as unused. Pass shared options through again.

PlaygroundLiveEditor can stay — InteractiveEditor actually uses it for the mobile/bot path. Optional polish (not required): EditorSurface can import InteractiveEditor directly instead of the PlaygroundEditor alias.

Hold merge until this lands and Bugbot is green on the tip.

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>

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Lead Engineer: 82bf2d06 puts back the deletions Staff already accepted. Review: #4104 (review)

Why. cf2de88e restored dead Playground code and said it was "kept for future use." Nothing outside that code used it.

What was checked before deleting.

  • website/src/components/Playground/resources/ (PlaceholderBaseResource.ts, TodoResource.ts) is only referenced inside that folder. Docs and examples have their own copies.
  • DiffEditorChooser.tsx was only imported by DiffEditor.tsx. DiffEditor now imports DiffEditorMonaco directly, which is what it did before cf2de88e.
  • readOnly existed only on InteractiveEditor. No caller passed it. The editorOptions memo that existed to spread readOnly onto the shared options is gone, and the editor passes options again.
  • PlaygroundEditor.tsx was const PlaygroundEditor = InteractiveEditor. Staff allowed EditorSurface to import InteractiveEditor directly. After that switch nothing else imported the alias, so the alias file is deleted too. PlaygroundLiveEditor stays, because InteractiveEditor still uses it for the mobile and bot path.

Checks. A playground test command on this tree exited 0. The captured log only shows Running one project: ReactDOM, so I am not citing a suite count. Lint on the edited editor files exited 0. Not merging until Bugbot is green on 82bf2d06.

The PR description still has the "Kept for future use" bullet from cf2de88e. That sentence is now false. The pull-request update tool would not edit the human-written description.

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

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

c529c24 reverts 82bf2d0. In the project thread, Nathaniel chose to keep PlaygroundEditor, DiffEditorChooser, the readOnly prop and Playground/resources/ for now, which overrides the deletion requested in review 5401577634. On c529c24, the website typecheck and lint pass, and all 17 Playground tests pass.


Generated by Claude Code

@ntucker ntucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Staff: CHANGE_THIS_PR

Tip c529c24 undoes the dead-code cleanup that was already landed on 82bf2d06. Please revert this restore and keep the simpler graph.

Undo (delete / rewire back)

  1. Delete website/src/components/DiffEditorChooser.tsx and point DiffEditor.tsx at DiffEditorMonaco again (Chooser is an identity alias; only consumer is the rewired call site).
  2. Delete website/src/components/Playground/PlaygroundEditor.tsx and import InteractiveEditor from EditorSurface again (same identity alias; the PlaygroundLiveEditor re-export is unused — InteractiveEditor already imports LiveEditor directly).
  3. Delete website/src/components/Playground/resources/ (PlaceholderBaseResource.ts, TodoResource.ts) — no in-repo consumers; README already says "currently unreferenced".
  4. Drop the unused readOnly prop (and the useMemo options merge) from InteractiveEditor — nothing passes it.

Keep

  • PlaygroundLiveEditor — still used as the mobile/bot fallback inside InteractiveEditor.

PR-body "Nathaniel’s call / kept for now" is not an in-repo migration. If ownership wants to waive deletion of unused aliases/resources, that needs an explicit Grok Bot waive; Staff prefers deletion in this PR.

Prior FOLLOW_UPs unchanged (declare globals → declare global; dead ambientsource / useIntersectionObserver / Demo.module.css; optional row-fixtures / import-completions / unquoted path=).

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staff Reviewer: Hold. Do not start the undo in #4104 (review).

Lead reports Nathaniel chose to keep PlaygroundEditor, DiffEditorChooser, the readOnly prop, and Playground/resources/ on c529c24. That change request stays open only until Grok Bot waives it or says to delete them. Not merging. The branch is still behind master.

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staff Reviewer: Nathaniel waived the deletion. Keep DiffEditorChooser, PlaygroundEditor, Playground/resources/, and the unused readOnly prop on InteractiveEditor. #4104 (review) is waived, not an open change request. Do not delete them in this PR. Still not merging until he says to.

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Lead Engineer: Nathaniel waived the deletion request in #4104 (review).

Keep these, as the project thread already chose:

  • DiffEditorChooser
  • PlaygroundEditor
  • website/src/components/Playground/resources/
  • the unused readOnly prop on InteractiveEditor

Motivation: an explicit waive from Nathaniel, via Grok Bot, overrides Staff's preference to delete them in this PR. Findings that support keeping them are the project-thread restore at c529c24 and the PR body note that they are kept for now. Do not undo them.

This does not clear the merge. Bugbot and CI are already green on 1feb6b27, but merging still needs a separate go-ahead from Nathaniel. I am not merging.

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

This comment follows up on every Staff review of this PR. No code changes are needed in this PR.

Review 5401440867: all FOLLOW_UPs stay as follow-ups

  1. declare globals → declare global in monaco/typeLibs.ts. This changes which types Monaco sees in every playground. Two things could add new red squiggles: the inlined React .d.ts contains exports, and declare global only works in a module lib. Checking that needs a browser pass, which is out of scope for a behavior-neutral reorg.
  2. website/ambientsource-plugin.js, useIntersectionObserver.tsx and Demo/Demo.module.css are still unused (grep finds no importers). This PR doesn't touch them, and Nathaniel wants dead code kept for now, so deleting them belongs in a separate cleanup PR.
  3. Unshown row-layout fixtures, import completions across playgrounds, and unquoted path= are all pre-existing. Each should be its own PR.

Reviews 5401577634 and 5402268417: deletions waived
Per Nathaniel's waive, DiffEditorChooser, PlaygroundEditor, Playground/resources/ and readOnly stay. The head is up to date with master (1feb6b2), and CI and Bugbot are green.

All of the follow-ups above are now listed in the PR description.


Generated by Claude Code

…hain

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015H36Yk4WBpytw9L7RRVCTK
…re 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

ntucker commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Where each follow-up from Staff, the adversarial review and my own notes ended up:

Folded into this PR (f5d3562)

  • Import completions now list only the other files in the same playground, not every Monaco model on the page. The logic is in siblingFilePaths in monaco/modelPath.ts and is tested.
  • Fence metastrings now accept unquoted path=a.ts. Three RestEndpoint.md editors (Todo.ts, method.ts, body.ts) were silently getting default.ts instead. Tested.
  • The Playground README is now prettier-formatted. The useModelId comment and the DiffEditor chain are fixed (7bf8c88).

Moved to their own PRs

  • declare globals → declare global in monaco/typeLibs.ts. It changes Monaco typings on every playground, so it needs a browser check that no new diagnostics appear.
  • Deleting website/ambientsource-plugin.js, useIntersectionObserver.tsx and Demo/Demo.module.css. That PR will confirm with Nathaniel first, since he chose to keep unused files for now.

Rejected

  • Fixtures in row layout: not shown on purpose. EditorSurface explicitly passes fixtureContent only in stacked layout, where there is room above the editor. The fixtures still drive the preview through MockResolver.
  • Trailing ; after one declare module lib string: an empty statement with no effect on types.
  • HooksPlayground reusing PlaygroundProps with optional groupId/row: types only. The runtime defaults are unchanged, and MDX callers are untyped.
  • Deleting DiffEditorChooser, PlaygroundEditor, resources/ and readOnly: waived by Nathaniel.

Validation: 19 Playground tests pass, and the website typecheck and lint are clean.


Generated by Claude Code

claude added 2 commits October 4, 2026 09:14
…e-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
@ntucker
ntucker merged commit c3ce245 into master Oct 4, 2026
24 checks passed
@ntucker
ntucker deleted the claude/project-thread-9udgck branch October 4, 2026 16:32
ntucker pushed a commit that referenced this pull request Oct 4, 2026
#4104 landed on master; keep this branch's typeLibs.ts and README.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkVym3YjjuSjBKhLLwvZm6
ntucker added a commit that referenced this pull request Oct 5, 2026
…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>

This branch was successfully deployed

1 active deployment
Preview — 5b856f45 Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants