modglot

UMD-ESM polyglot (by nalply)

Modglot Alternatives

Similar projects and alternatives to modglot

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better modglot alternative or higher similarity.

modglot reviews and mentions

Posts with mentions or reviews of modglot. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-21.
  • Disillusioned with Deno
    1 project | news.ycombinator.com | 26 Feb 2024
    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
    18 projects | news.ycombinator.com | 21 Nov 2023
    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

Stats

Basic modglot repo stats
2
0
2.7
10 months ago

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com