chore(ts7): adopt the TypeScript 7 native compiler (tsgo)#442
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
ac23b4a to
647bc79
Compare
Make the editor packages compatible with, and benefit from, the native Go
compiler (TypeScript 7 / tsgo) while keeping the npm publish path on stable tsc.
- Add @typescript/native-preview (pinned 7.0.0-dev.20260624.1). tsgo coexists
with typescript@6, which Next typegen and the IDE plugin still need until the
TS 7.1 programmatic API ships.
- Fix two react-three-fiber JSX augmentations the native checker rejects but
tsc tolerated:
- viewer: map only LineBasicNodeMaterial (the one webgpu node material used as
a JSX tag) instead of the whole three/webgpu namespace (TS2320/TS2590).
- plane-box-select-tool: drop the redundant `IntrinsicElements extends
ThreeElements` block — it duplicated R3F's global augmentation and, by
referencing @react-three/fiber's ThreeElements directly, hit a bun peer-dep
variant-directory duplicate under tsgo (TS2320). r3f.d.ts already covers
those JSX intrinsics. Types-only — no runtime change.
- check-types -> tsgo --noEmit (editor, @repo/ui, editor app, ifc-converter app)
- emit-package dev watch -> tsgo --build --watch
- build/publish stay tsc --build (prepublishOnly + release.yml unchanged;
emitted .d.ts is byte-identical to tsc output)
- bump next 16.2.6 -> 16.2.9
tsc remains the source of truth and fallback. Published artifacts unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
647bc79 to
1b4c656
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adopts the TypeScript 7 native compiler (
tsgo, via@typescript/native-preview) for type-checking and local dev watch, while keeping the npm publish path on stabletsc. Also bumps Next 16.2.6 → 16.2.9.The blocker for TS 7 here was the react-three-fiber +
three/webgpuJSX augmentation inviewer: mapping the wholethree/webgpunamespace (ThreeToJSXElements<typeof THREE>) made the native checker fail with TS2320 (heritage conflict onPMREMGenerator: core-three'sWebGLRendererarg vs webgpu's abstractRenderer), TS2430, and TS2590 ("union too complex").tsc 6tolerated it. This narrows the augmentation to the one webgpu node material used as a JSX tag —<lineBasicNodeMaterial>— following R3F's "extract the classes you need" guidance. Types-only; runtimeextend(THREE)is unchanged.Changes
@typescript/native-preview(pinned7.0.0-dev.20260624.1). Coexists withtypescript@6, which Next typegen and the IDE plugin still need until the TS 7.1 programmatic API.viewer/index.tsx: narrow the R3Fthree/webgpuJSX augmentation (see above).check-types→tsgo --noEmit(@pascal-app/editor,@repo/ui, editor app, ifc-converter app).core,viewer,mcp,nodes,ifc-converter):dev→tsgo --build --watch.build/ publish unchanged — stilltsc --build;prepublishOnly+release.ymluntouched. Emitted.d.tsis byte-identical totscoutput.next16.2.6 → 16.2.9 (apps).Why publish stays on tsc
tsgois a nightly preview — we don't ship nightly-emitted artifacts.tsc --builddetectstsgo's.tsbuildinfoversion mismatch and always rebuilds, and release runs on a clean CI runner, so the publish path is never contaminated by a localtsgodev build.Note for consumers
The augmentation narrowing only affects hypothetical external consumers who relied on the old whole-namespace JSX typing to get implicit types for other webgpu node materials (none beyond
lineBasicNodeMaterialare used in this repo). Acceptable pre-1.0; the reason is documented in the source comment.How to test
bun installbun run check-types→ 9/9 green (emit packages build viatsc^build; editor/ui/apps type-check viatsgo)bun run check→ exit 0 (no new diagnostics from this PR)bun run build→ publish build (tsc) succeeds;dist/*.d.tsunchangedbun dev→ emit packages watch-rebuild viatsgo --build --watchChecklist
check-types9/9,checkexit 0,build7/7,tsgo --build --watchinitial build OKbun checkpasses)mainbranch🤖 Generated with Claude Code
Note
Low Risk
Changes are limited to dev/CI type-check tooling, a targeted R3F type augmentation, and a patch Next bump; production build and publish paths still use tsc.
Overview
Adopts
tsgo(@typescript/native-preview) for monorepo type-checking and package dev watch, while publish/CI emit stays on stabletsc --build.Tooling: Root adds pinned
@typescript/native-preview;check-typesscripts in the editor/ifc-converter apps and several packages switch fromtsc --noEmittotsgo --noEmit. Emit packages (core,viewer,mcp,nodes,ifc-converter) usetsgo --build --watchfor localdevinstead oftsc --build --watch.Types fix for TS 7: In
packages/viewer, the R3Fthree/webgpuJSX module augmentation no longer maps the wholeTHREEnamespace (ThreeToJSXElements<typeof THREE>); it only declareslineBasicNodeMaterial, which unblocks the native checker (TS2320/TS2590). The editorplane-box-select-tooldrops a redundant localJSX.IntrinsicElementsextension.Deps: Next is bumped 16.2.6 → 16.2.9 in editor and ifc-converter apps (lockfile updated).
Reviewed by Cursor Bugbot for commit 1b4c656. Bugbot is set up for automated code reviews on this repo. Configure here.