TJS findings
tosijs-native is the first project written natively in .tjs from scratch (tjs-lang 0.14.1
since 2026-12-03, 0.14.0 and rc.9 before; tosijs-ui 1.20.1, Bun 1.4.2), and Longtime Listener,
an app built on it, the second (below: A second project).
The owner's question
was whether that is viable, or whether to switch to Bun + TypeScript and file the issues. This
file is the evidence. Each finding was reproduced in isolation and is filed on the virta board
(task numbers in brackets). Dogfooding tjs-lang as it approaches 1.0 is worth doing for its own
sake, so the aim is to overcome these, not just record them: when one is fixed upstream, retire
its workaround here and strike the finding.
Verdict
Viable, now for an app as well as a library. Authoring, running, testing, linting and
documenting .tjs all work, with no workarounds left in this project's code. Of the 33
findings (30 on tjs-lang, 3 on tosijs-ui), 30 are fixed upstream, most within a day of their filing: 0.14.0 fixed the first
sixteen, 0.14.1 (2026-12-03) the linter, codegen and test findings that 0.14.0's new linter
brought out, and main (unreleased after 0.14.2) the mock block (31), three hours after it was
filed. bun run check is plain tjs check src --max-warnings 0 again.
Open: the published types (28), and a name that is never declared passing tjs check (32),
which cost the second project a crash at start that check had passed; and on tosijs-ui, an
icon's style fill dropped silently (33).
What remains is the published types (28): generated .d.ts is still too coarse to publish,
so src/index.d.ts stays hand-written, guarded by src/exports.test.ts and bun run typecheck (a TypeScript consumer, types/consumer.ts, compiles against dist/). That's an
accepted state for now. TJS's primary goal is to replace TypeScript with JavaScript as it
should be; emulating TypeScript is secondary (the owner, 2026-12-02). The aim is the finessed
types written in the TJS source, with the .d.ts generated from them: precise types the author
states in TJS, not perfect inference.
What worked
bun testimports.tjsthrough thetjs-lang/bun-pluginpreload (bunfig.toml) with no further setup. Tests stay.test.ts, becausebun testdoes not discover.test.tjs. Since 0.14.1 a test block runs with its imports andtjs testruns.test.tjsfiles, so the contract suite could move into.test.tjs(not done yet: it would add a lane besidebun test).- Validation at the boundaries came free and is the right shape: a bad config or bridge
is refused at the call (
defineConfig,createNative) with aMonadicError, whichextends Error, and since 0.14.0 it names the failing field (call: expected function, got number). The internals are unvalidated closures. Is/IsNotreplaced a hand-written deep-equal in the contract suite./*# … */blocks in.tjsbecome tosijs-ui doc pages, andtjs emitwrites.mdfrom the same blocks.Bun.buildwithtjs-lang/bun-build-plugin(0.14.0) bundles the graph intodist/index.js, which plain Node imports with no TJS installed. WithsharedPreludethe bundle carries one TJS runtime.
Open
tjs checkpasses a name that is never declared. [#4735] Reproduced on 0.14.1 and on main (2026-12-04): a misspelt local (return summbesidelet sum) and a build-time define a build forgot (TESTR) both get ✓, and each throwsReferenceErrorthe first time it runs. A signature example catches one only on the paths it walks, and a:!return runs none. Longtime Listener's dev server, started before itsTESTERdefine existed, served an app that died at start aftertjs check src --max-warnings 0had passed. Suggested: a no-undef rule against the file's declarations, its imports and the target's globals, and a way to declare build-time globals with an example value, so they are typed too.Generated
.d.tsis too coarse to replace a hand-written file. [#4569] Re-measured on 0.14.1 (2026-12-03):tjs emit src --dtswrites 166 lines against 664 hand-written, andtypes/consumer.tsgets 16 errors against them (17 on 0.14.0). The predicate-onlyTypeimport that stopped it compiling at all is fixed (#4568), as are async returns, optional members, descriptions and typed arrows in examples (#4590, #4591, #4592, #4586). What is left:createNativereturnsPromise<Record<string, any>>, so every call on the API is unchecked (the consumer's five@ts-expect-errorlines go unused); the status lists areany[], so noPurchaseStatusorLocationStatusunion can be derived from them; andNativeConfiglackscapabilities. The first is this project's to state: theNativeAPI as a TJSTypewith typed arrow members, which 0.14.1 can now carry to the.d.ts. The others wait on #4569 (typed constants, a type derived from a list). Overloads keyed by an event name (on('pause', …)) wait on a language decision [#4593]. Whentypes/consumer.tscompiles against the generated file,src/index.d.tsgoes.
Fixed on main (after 0.14.2, unreleased)
A documented[#4719] Filed from Longtime Listener at 09:37 on 2026-12-04, fixed upstream at 12:27 (one recognizer for test blocks inmock { }block is a parse error intjs check.parse()andtjs(); on the way,class Latest { }andclass Unmock { }had been losing their bodies in plain.jstoo). Verified on main with the repro and a control (a mock test that should fail still fails). Until the release, the second project's shared feed fixtures live in abun testfile.
Fixed in 0.14.1 (2026-12-03)
Exported declarations are reported unused, and[#4233]Typedesugaring is linted.no-explicit-new tells you to drop[#4562] The rule is retired. The 66newon built-ins, where doing so throws or changes meaning.new Error(…)that becameError(…)stay as they are: both forms agree.no-unused-vars resolves a use against every scope in the file.[#4563]safe-assign makes a nullable[#4565] Aletimpossible.let x: T | nullmay be cleared, and the annotation's status is settled [#4588].No way to configure or suppress a rule.[#4566]// tjs-ignore <rule>: <reason>, andtjs check --jsongives each diagnostic a code and a line [#4585]. With 22–25 fixed the wrapper that filtered the linter's false positives,bin/check.ts, is gone.[#4237] TheDate.now()warns while calling itself safe.wallClockstand-in is gone from five files.[#4238]awaiton the right of&&or||emits JavaScript that does not parse.return (await a()) && (await b())runs, andtjs()now parses its own output, so the class fails at transpile time. The await-into-a-variable notes are gone.Line numbers drift after a typed parameter list spread over several lines.[#4564][#4567]tjs runcannot import an exportedTypefrom another file.A test block that uses an import cannot run in the pass.[#4583][#4584] It warns now, and namesDate(x)gets past the raw-Date refusal.LegacyDate(x)for a real Date.
Fixed in 0.14.0 (2026-10-31 upstream; adopted here 2026-12-02)
[#3587]tjs emit --dtsdrops re-exports.Types imported from another file become[#3588]anyin.d.ts.A[#3589]Typeused inside anotherType's example becomesany[].A[#3590]nulldictionary-default member is typednullin.d.ts.[#3592] The package still ships one bundle, which is what an app wants anyway.tjs emitleaves./x.tjsimport specifiers unrewritten.No[#3593]Bun.buildplugin ships.tjs-lang/bun-build-plugin; its output was byte-identical to ours, andbin/tjs-build-plugin.tsis gone.The runtime prelude is inlined once per module.[#3594]sharedPrelude: true(tjsBundlerinbin/build.ts). See 21 for the numbers.A[#3595]Typeexample with function-valued members rejects every value.Bridgeis declared by example, and the bridge constructors return:! Bridge.A dictionary default cannot have an[#3591]undefinedmember.A typed parameter with a default is a parse error.[#3596]Errors for a nested mismatch don't say where.[#3597]Class constructor parameters are not validated.[#3598]Return examples are only tested by[#3599] Now an opt-in (tjs check.TJS_RUN_TESTS=1, orrunTestson the plugins). This project keepscheckas the lane that runs them.A parameter defaulting to[#3609]nullaccepts onlynull.
Suggestions filed (2026-12-02)
What would make the toolchain one round wheel, from this project's experience:
- One command for a whole project, with a table of each lane and what removes it [#4589]:
on 0.14.1,
checkand tests are done, types are the rest of #4569, formatting is after 0.14 (#2170, #2165), and the bundle default waits on a tree-shakable prelude. - JSON diagnostics, each with a line and a rule id [#4585]: shipped in 0.14.1.
- TJS-typed arrow functions in examples, so an API object's methods reach
.d.ts[#4586]: shipped in 0.14.1. - The shared prelude as the
Bun.builddefault [#4587]: measured upstream, and it would enlarge most bundles (gzip absorbs small inline copies) until the prelude is tree-shakable (#3610). - Deciding whether a
let's annotation is enforced or documentation [#4588]: settled in 0.14.1. - Evidence and design points for the frozen formatter cards (#2170, #2165), gofmt's model: no options, no reflow, a before/after program comparison, made possible by TJS's newline rule, which removes the need for semicolons.
A second project: an app (2026-12-04)
Longtime Listener, the owner's podcast player (closed source, so described here, not quoted),
was written in .tjs from an empty repo to an app on two iPhones, an Android phone and a Mac
in about three and a half hours: 15 modules, about 3,900 lines, a pure core (feed parsing, the
listening rules, the cache planner, promotion detection, the library file and its merge) under
a tosijs and tosijs-ui interface, bundled by Bun.build with tjs-lang/bun-build-plugin and
run in WKWebView, Android's WebView and Chrome. It used tjs-lang 0.14.1.
- The lanes held.
tjs check src --max-warnings 0ran 28 inlinetestblocks and every signature example on each change; 19bun testcases (the player against stand-in audio elements, the shelf, two devices' library files) ran through the preload. Notjs-ignorewas needed. - Examples caught the author. Several wrong signature examples (a cache plan's expected
size, what is culled, a slug) failed
checkwhile writing, before anything ran, which is the point of a colon value being a worked example. A test block beside the function it tests (measuring what a kept part of an MP3 holds; parsing a Content-Range) kept each rule next to its code. - What got in the way: the
mockblock (31, now fixed on main) and an undeclared name passing check (32). Nothing else: no type gymnastics, no build plugin of its own, no.d.ts(an app publishes none, so 28 does not touch it). - Lessons that were not TJS's: WebKit hangs a seek made before an audio element's first play, and draws Apple's lock screen from the page's own media session; both are written up in tosijs-native's media docs.
Not tjs-lang (tosijs-ui)
A fill or stroke given in an icon's style is dropped silently. [#4736] Reproduced on 1.20.1 (and the same code on main):
icons.star({ style: { fill: 'red' } })comes back withfill: var(--tosi-icon-fill, none), because the icon's own fill and stroke are set after the caller's props. The documented ways work (--tosi-icon-fill, or a_FF9500Fsuffix), and Longtime Listener's favourite star uses the variable.[#3600] Fixed in tosijs-ui 1.17.0: the build stops before writing anything and prints the install command.buildSiteneedshappy-dom, which tosijs-ui declares as an optional peer.tosijs-ui scrapes[#3601] Fixed in tosijs-ui 1.17.0, using tjs-lang's grammar to find them (/*# … */doc blocks, not TJS's own/# … #/.findDocCommentSpans, which tjs-lang 0.14.0 exports). This project still writes/*#blocks, which also work.A relative[#3926] Fixed in tosijs-ui 1.19 (the path is made root-absolute at build time); the inline-SVG workaround is gone.logopath breaks the header on every nested page.
21. The TJS runtime's share of an app's bundle
Measured 2026-11-25 (#4272) on rc.9: the runtime tjs emits at the top of each module
(__tjs_rt: monadic errors, type checks, value descriptions) was 37,991 bytes of a
200,908-byte bundle, and the __tjs metadata on functions another 11,195.
Measured 2026-12-02 on 0.14.0, what an app ships (index.js and the chunks it imports,
not the contract suite):
| build | raw | minified | minified, gzip |
|---|---|---|---|
| a runtime per module (our old plugin, or theirs by default) | 207,723 | 119,948 | 33,793 |
sharedPrelude (what bin/build.ts now does) |
174,023 | 98,153 | 28,441 |
Not a blocker; a cost to weigh against the checks it buys. tjs-lang's docs/shared-runtime.md
proposes one runtime shared by many published libraries, after 1.0.