mirror of
https://git.pumpin.online/funkpower/typikon.git
synced 2026-10-22 18:57:13 +00:00
javascript and typescript, as one wasm package for every runtime
WebAssembly rather than a native Node addon: one artifact serves Node, Deno, Bun, a browser and anything built on them, where napi would have meant a prebuilt binary per platform and a source build for whoever the matrix missed. The engine is pure computation and the menologion is already compiled in, so there is nothing for it to give up. A day comes back as a plain object, not a handle. A wasm class would have meant a .free() that every caller eventually forgets, and this way JSON.stringify works and the thing spreads into state. Two serializer defaults had to be overridden to keep the promise that it is the same document --json emits: maps as objects, and an absent field as null rather than undefined, which stringify would otherwise drop entirely. The TypeScript is hand-written, because the generated types for a value crossing as JsValue are `any`, and a binding that types its whole return as `any` is a binding TypeScript cannot check. tsc --strict is a release gate now, the way mypy --strict already is, and the check includes three lines that must fail to compile. The one place this differs from every other binding: no remembered default jurisdiction, because a browser has nowhere to keep one. It is called out in the README, in the types and in docs/versioning.md. The test resolves typikon through a staged node_modules rather than a relative path, so what it exercises is the exports map, and it compares a year of days field by field against the command line for four jurisdictions.
This commit is contained in:
@@ -20,6 +20,13 @@ does.
|
||||
the usage and the discipline. The Python bindings and the C ABI now share it
|
||||
rather than each keeping a copy, and it interns the combinations instead of
|
||||
leaking one per call.
|
||||
- A JavaScript and TypeScript package, behind the `wasm` feature and published
|
||||
to npm as `typikon`. One WebAssembly build serves Node, Deno, Bun and the
|
||||
browser. A day comes back as a plain object rather than a handle: the same
|
||||
document `--json` emits, with nothing to free. The types are hand-written
|
||||
rather than inferred, and `tsc --strict` is a release gate the way `mypy
|
||||
--strict` already is. There is no remembered default jurisdiction there,
|
||||
because a browser has nowhere to keep one; the default is the New Calendar.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user