Rewrite in TypeScript and drop jQuery - #3
Conversation
D3ller
commented
Jul 1, 2026
- Fully migrated to TypeScript: The core codebase and all demos have been rewritten in TypeScript, providing strict typing, better autocompletion, and a much safer developer experience (DX).
- Dropped jQuery dependency: Completely removed all jQuery code in favor of modern, native JavaScript (Vanilla JS) for better performance and lighter codebase.
- Zero-config bundling: Klapy.ts now bundles all its required dependencies directly out of the box. No need to manually import them anymore, it's plug-and-play!
…gration Core: - Make animation (Blapymotion) and websocket (BlapySocket) optional and auto-detected from separate standalone builds (dist/BlapyMotion.js, dist/BlapySocket.js) instead of being bundled in the core. Convert BlapySocket to TypeScript. - TemplateManager: scope template resolution to direct-child templates (:scope >) so nested sub-block templates no longer leak/accumulate into parents; add null guards in generateHtml/addBlapyIndices; align with upstream Blapy v2.1.2. - Move html-extension.d.ts and shared types under src/shared/types. Build/dev: - Add per-module vite configs and chain them in the build script. - Add docker-compose dev env; fix websocket container crash-loop by installing ws from the demo's own package.json. Demos: - Fix helloworld (animation), demo_json_nested_blocks (jQuery .attr leftover), demo_json_init_with_mustache; migrate demos to the modern dist/blapy.umd.js; drop bundled lib/ vendor copies.
…yMotion.js/BlapySocket.js) instead of the removed blapy2.js
…rvice, renamed TemplateManager methods/signatures, real Mustache/json2html rendering)
…tale tests don't double/pollute the unit run
…no jQuery, optional BlapyMotion/BlapySocket, bundled deps)
|
Rewrote iFsm to kFSM in TypeScript: The module has been migrated, though there is still room for structural improvements. Extracting it into a standalone npm package would be ideal, but this is deferred for a future update due to time constraints. |
|
The idea behind Blapy is to remain fully vanilla JavaScript and to have as few dependencies as possible. TypeScript would add another dependency, which is not desired. Removing jQuery, however, would be a really good thing and would be very welcome. |
|
I’ve actually already removed jQuery, so Blapy is now fully vanilla JavaScript on that side. Regarding TypeScript, it would only be a development dependency. The distributed package could still be plain JavaScript with no additional runtime dependency for users. So it wouldn’t really go against the goal of keeping Blapy lightweight, although I understand if you want to keep the source itself dependency-free as well. |