modglot | esno | |
---|---|---|
2 | 10 | |
0 | 1,544 | |
- | 1.2% | |
2.7 | 4.9 | |
10 months ago | 2 months ago | |
Shell | TypeScript | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
modglot
-
Disillusioned with Deno
I started a small hobby project. First with TypeScript and Modern Web Dev Server (https://modern-web.dev/guides/dev-server/getting-started/). I don't want bundling and for a while life was good. But then I had some npm packages that didn't support EcmaScript modules. I found a workaround but suddenly I lost motivation. I then thought, okay, perhaps time to change to Deno.
Half a year later I changed to vanilla Rust, trunk, Webassembly and some JavaScript glue code and suddenly a lot of things got easier. Of course as a Rust programmer it is easy for me. But I am also a JavaScript programmer.
This is just anecdotal but it really seems to me that the JavaScript ecosystem is so deeply flawed to burn out people. Let me list two main points which are broken:
- Types are wonky. TypeScript does a huge work to "fix" JavaScript and I love TypeScript. But TypeScript cannot fix the soundness holes in JavaScript. There will be always things that don't work out of the box.
- The missing dependency story. Node introduced CommonJS, but it didn't work on browsers. Browser just added objects to the browser's Window object. Later there are EcmaScript modules but too late. I wrote a hacky polyglot which does both UMD and EcmaScript modules, but I feel the polyglot to be brittle. https://github.com/nalply/modglot
I am still thinking about it, but I feel JavaScript could go the way of PHP. Still important, but too much a mess to be taken seriously. Perhaps in about ten years. I don't know.
-
Finally, a guide for Node.js and TypeScript and ESM that works
One problem I encountered with ESM TypeScript development on the browser without bundling: many Node packages aren't set up for that.
You might ask why without bundling?
Sometimes you just want to start something simple on the browser and compile to JavaScript on the fly.
I tried the dev server from Modern Web [0], and I liked it. I program in TypeScript and the browser reloads whenever I save a file. Of course I could set up a bundler and for a small program waiting times are negligible. But I hate bundlers. I know it's irrational, but nowadays I program for fun so I think I should have the choice to reject bundlers.
This fails for many Node dependencies. There is a conflict between CommonJS and ESM. I am not 100% sure that what I want to achieve is impossible without forking dependencies and making a small change.
I even found a way to have a CommonJs and ESM polyglot, but this hack is extremely ugly, so my intellectual curiosity is satisfied. I named the hack modglot [1]. I don't think this is a good idea and I don't understand enough to propose something. I am somewhat dejected about the current state of TypeScript development for the browser and paused development.
Now I am programming in Rust again just for fun, but if I return to TypeScript, probably I will try out Deno.
[0]: https://modern-web.dev/guides/dev-server/getting-started/
[1]: https://github.com/nalply/modglot
esno
-
Finally, a guide for Node.js and TypeScript and ESM that works
Love this project, used it quite a bit. However I always opt for using esno[1] instead, merely because of the name; having two tools share the same name throws me off.
[1] https://github.com/esbuild-kit/esno
-
The esm/cjs situation...
Next, I thought well nx is not gonna work for now, so let's keep looking for an alternative to ts-node. Oh look, there is this https://github.com/esbuild-kit/tsx. It natively understands path aliases, no need for any flags. Oh wait...it doesn't do any type checking like ts-node. WHAT? why would anyone execute typescript without type checks during development?.
-
Svelte is migrating from TypeScript to JSDoc
I’ve generally found tsx to be better/less hassle than ts-node
https://github.com/esbuild-kit/tsx
-
TypeScript tooling and ecosystem
For just running Typescript files you have (both for dev and prod) https://github.com/esbuild-kit/tsx with command is generally easier then using ts-node + some file watcher or compiling to js
-
Usage TypeScript?
Just use tsx: https://github.com/esbuild-kit/tsx
- What's the proper tools to use for node.js development?
-
PSA: Speed up your ts-node command with a simple --swc flag
I've been using tsx, which is like ts-node except it uses esbuild under the hood. It's been pretty great. Super speedy.
-
tsx: Node.js enhanced with esbuild to run TypeScript & ESM
And compared to esno?
-
Typescript or JS with Node.js ?
Typescript with TSX for development
-
Unable to run ‘.ts’ - ESM modules and CommonJS
Take a look at Typescript runners like ts-node or esno (https://github.com/antfu/esno)
What are some alternatives?
esyes - Run your TypeScript files quickly and with more positivity
esbuild-node-tsc - Build your Typescript Node.js projects using blazing fast esbuild
tsconfig - Shared TypeScript config for my projects
electron-svelte-typescript-esbuild-template - Starter kit to build cross-platform desktop apps with Electron, Svelte, TypeScript and Esbuild.
node_monorepo
esbuild-svelte - An esbuild plugin to compile Svelte components
documentation-framework - "The Grand Unified Theory of Documentation" (David Laing) - a popular and transformative documentation authoring framework
TS-ESNode - Node.JS Loader hook to transform typescript source and files as node loads them TS-ESNode. TS-Node for ESNext & ESModule Node.JS.
prepackage-checks
esbuild-runner - ⚡️ Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
deno-arm64 - ARM64 builds for Deno
ThinkJS - Use full ES2015+ features to develop Node.js applications, Support TypeScript.