Repository navigation
Done
Labels
area: extensionVS Code extension host (TypeScript): commands, launcher, servers, servicesarea: python-backendPython analysis backend (backend/)area: xr-sceneBrowser runtimes of the XR scenes and LivePanel (A-Frame/BabiaXR, templates/components)stream: cleanup-refactorEpic #26: deep cleanup and restructuring of the extensiontfmAdds the issue to the TFM board automatically. Do not removeuser-storySub-issue of an epic ([Story] title prefix)
Description
As a developer reading or extending the code,
I want pieces written with outdated idioms rewritten in the current idiomatic form of their language,
so that the code base reads consistently, uses the language's safer constructs, and new contributors do not copy old patterns.
Context
Requested by the maintainer on 2026-11-25 as an extension of epic #26. The code base grew over several years, so some files still use patterns that newer language features replace.
Scope
- Inventory first (
docs/cleanup/modernization.md): for each idiom, the count, the files and the modern replacement, measured with a script so the number can be re-run.- TS:
require()where a static import works (the eight load-bearing lazyrequire()inModularTreeDataProviderstay);- promise chains and callback APIs where
async/awaitorfs.promisesapply; var;namespace;- string concatenation where template literals belong;
- index loops where
for…ofor array methods fit; - optional-chaining or nullish candidates;
- avoidable
anyand casts.
- Browser JS under
templates/:var;- prototype-based classes;
- IIFE module patterns where the load order allows;
arguments;- manual DOM loops.
- Python:
%and.format()where f-strings fit;os.pathwherepathlibis clearer;- legacy
typingaliases. This item stays compatible with Python 3.8, which the backend supports again since chore(python): dead-code removal (#31) and backend simplification (#36) #50; PEP 585 generics need 3.9.
- TS:
- The rewrite:
- one commit per idiom per area;
- behaviour-neutral, each change covered by existing tests or a characterization test landed first;
- where it can catch a regression, an ESLint or ruff rule stops the old idiom from coming back.
Out of scope
- Anything the cleanup skill marks load-bearing.
- The XR field-schema contract.
- Formatter-style churn: no blanket reformatting.
Acceptance criteria
- The inventory, with before/after counts per idiom, is in the doc.
- Each idiom is at 0, or every remaining instance is named and justified.
-
npm test,test:analysis,test:pythonand the matching browser harnesses green after every commit. Text pins are respected. - Runs after [Story] Route all diagnostics through the logger and the CodeXR output channel #34 and [Story] Simplify and de-duplicate the TypeScript analysis pipeline, export and settings code #35, which rewrite many of the same functions, and before or with the
src/reorganization story.
Metadata
Metadata
Assignees
Labels
area: extensionVS Code extension host (TypeScript): commands, launcher, servers, servicesarea: python-backendPython analysis backend (backend/)area: xr-sceneBrowser runtimes of the XR scenes and LivePanel (A-Frame/BabiaXR, templates/components)stream: cleanup-refactorEpic #26: deep cleanup and restructuring of the extensiontfmAdds the issue to the TFM board automatically. Do not removeuser-storySub-issue of an epic ([Story] title prefix)
Activity
docs(cleanup): refresh the #55/#56 analysis after #40 merged
Merge pull request #59 from Code-XR-Project/claude/project-thread-n2s…
Merge pull request #62 from Code-XR-Project/claude/project-thread-n2s…
aMonteSl commentedon Nov 25, 2026
Part A (Python and standalone browser runtimes) merged into
v1.2.1via #62, with CI green on Linux, Windows and macOS.typinggenerics 310 → 12 (the rest are contract or test-pinned), and ruff now enforces the modern idioms withtarget-version = "py37".var289 → 0, withno-varacross all linted template scripts. The 9 multi-part runtimes (2,014var) are deferred to 1.3.0, as recorded indocs/cleanup/modernization.md.backend/srctargets 3.7.The TypeScript part follows next.
Generated by Claude Code
Merge pull request #64 from Code-XR-Project/claude/project-thread-n2s…
aMonteSl commentedon Nov 25, 2026
Done. Part B (TypeScript) is merged into
v1.2.1via #64, with CI green on Linux, Windows and macOS. Part A (Python and browser runtimes) merged earlier via #62.TypeScript, per row of
docs/cleanup/modernization.md§5:require()of Node built-ins: 7 → 0.substr: 1 → 0.a && a.b: 10 → 0.any: 130 → 84. These commits change types only, and the production bundle stays identical. Four folders now haveno-explicit-anyas an error.??for object-typed defaults: 48 converted. The||on external JSON, storage and settings is kept on purpose..then()→await: no site qualifies.Deferred to 1.3.0:
varin the 9 multi-part browser runtimes (2,014);fs.promises;any.Details are in §6 and §7 of
modernization.mdand in the session logs56a-modernize-py-js.mdand56b-modernize-ts.md.Generated by Claude Code