Migrate to TC39 Stage 3 modern decorators (v9.0)#840
Open
lbwexler wants to merge 10 commits into
Open
Conversation
Mirrors the hoist-react v85 / hoist-dev-utils v14 decorator migration across toolbox's client-app (xh/hoist-react#4321): - Removed `experimentalDecorators` from `client-app/tsconfig.json` - Applied codemod `hoist-react/docs/planning/tc39-decorators/codemod-add-accessor.mjs` — inserted 273 `accessor` keywords across 80 files - Applied `codemod-remove-makeObservable.mjs` — removed 88 `makeObservable(this)` calls, 43 newly-empty constructors, and 87 unused `makeObservable` imports - Hand-fixed `admin/tests/grids/GridTestModel.ts:64` where an inline comment between stacked `@bindable` / `@persist.with(...)` decorators prevented codemod regex matching Also added `*.png` to `client-app/src/types.d.ts` — `yarn run tsc` had been failing on pre-existing PNG module-resolution errors from `../../hoist-react/cmp/spinner/Spinner.ts` etc. (they leak in via the `@xh/hoist/*` paths alias, but hoist-react's own `assets.d.ts` isn't visible to toolbox's tsc project). This fix is orthogonal to the TC39 migration but unblocks the pre-commit hook. Requires sibling `hoist-react` branch `tc39-decorators` (v85.0.0-SNAPSHOT) and `hoist-dev-utils` branch `tc39-decorators` (v14.0.0-SNAPSHOT) for runtime — coordinated release required. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches the hoist-react v85 follow-up (d68ffdfc2). - Re-ran `codemod-add-accessor.mjs` after extending its regex for `@decorator @observable.ref foo` pre-decorator patterns — picked up 10 additional sites in `ViewManagerTestModel`. - Removed stray class-level `@managed` on `SimpleRoutingPanelModel`. Pre-existing bug that legacy decorators silently no-op'd; TC39 throws a clearer "kind='class'" error. - Carries the `experimentalDecorators: true` removal from `client-app/tsconfig.json` that was missed in the initial toolbox migration commit (b39f550). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
# Conflicts: # client-app/src/core/svc/DocService.ts # client-app/src/core/svc/GitHubService.ts # client-app/src/desktop/tabs/forms/FormPanelModel.ts # client-app/src/desktop/tabs/forms/PickerPanel.ts # client-app/src/examples/news/NewsPanelModel.ts # docker/tomcat/Dockerfile
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.
Summary
Mirrors the hoist-react v85 / hoist-dev-utils v14 decorator migration across toolbox's client-app (xh/hoist-react#4321). Serves as the canary for the framework migration.
Requires sibling
hoist-reactbranchtc39-decorators(v85.0.0-SNAPSHOT) andhoist-dev-utilsbranchtc39-decorators(v14.0.0-SNAPSHOT) at release time.Commits
b39f5504Migrate to TC39 Stage 3 modern decorators (toolbox v9.0) — removedexperimentalDecoratorsfromclient-app/tsconfig.json, applied theaccessorcodemod (273 sites across 80 files), removedmakeObservable(this)calls (88), empty constructors (43), and unused imports (87). Also added*.pngtoclient-app/src/types.d.tsto resolve pre-existing sibling-checkout type-resolution errors that were blocking the pre-commit hook.97a6f0c6TC39 follow-up: codemod extensions + stray class-level @Managed — re-ran the extended codemod (10 more sites inViewManagerTestModel), removed a stray class-level@managedonSimpleRoutingPanelModel(pre-existing bug that legacy decorators silently no-op'd).Test plan
yarn tsc --noEmitclean,yarn lint:codeclean./app,/admin,/mobile) and example apps (/todo,/contact,/portfolio,/news,/recalls,/fileManager,/weather).Object.keys(model)/JSON.stringify(model)/{...model}sites per the v85 upgrade-notes grep commands — verify no regressions from accessor-field non-enumerability.🤖 Generated with Claude Code