Discussion on: What JS Libraries Have You Made?

evanplaice profile image
Evan Plaice

The first RFC compliant CSV parser for JS. My most popular lib w/ 500+ stars and 500k+ downloads.

ES Module Libs

A modern ESM rewrite of jquery-csv optimized for size/speed

Like lodash but every operator is implemented using reduce. Started out as sort of a joke but now it has 62 operators.

The rest can be found at VanillaES

Web Component Libs

Render markdown w/ syntax highlighting

Easily embed a Monaco editor. Monaco is the code editor used by VSCode.

The rest can be found at VanillaWC

What libraries are you proud of?

All of them? They all address a specific need.

I kill off all my projects that don't see much use and/or are too much of a pain to maintian (ex framework-specific components).

What did they seek to accomplish?

Jquery-csv raised the bar for all CSV parsers in the JS ecosystem. I tried out dozens of half-baked CSV parsers before writing this one. The goal was to do one that is 100% spec compliant. Now the majority of CSV libs target spec compliance as a baseline.

The VanillaWC org demonstrates that you don't need any build tools (ex webpack) or libs (ex lit-html) to build web components. It has the potential to really lower the bar for develoment and adoption.

The VanillaES org will only become more relevant as the entire JS ecosystem shifts over to using ESM. The impact of JS becomes a LOT smaller when the code os 50% the size and 80% of that can be tree-shaken out. We have just barely started to see the full potential of ESM.

How successful do you think they are?

Not successful enough. If I put in a LOT more effort into promoting my projects they'd be much more successful.

But, I don't get paid to work on Open Source so the incentive isn't really there.

What did you learn?

The CSV parser and other parsers I've written inspired me to learn advanced RegEx and Formal Language Theory. My approach is non-traditional but I write some of the fastest parsers in the entire JS ecosystem.

The ESM peojects helped me practice and develop really great workflows for working w/ bleeding-edge JS and participate on the node/modules team. I'm planning to write a whole series of articles about this soon.

The web component projects helped me really refine my understanding of the platform. There is a ridiculous amount of untapped potential in this space. I hope to build my career on this soon.

tamb profile image
Tamb Author

The CSV parser is something I wish I had looked up like a few months ago when I was scraping data. So cool!

evanplaice profile image
Evan Plaice

IMO, CSV-ES is a good option but I've had to hold back on promoting the ESM stuff for the past 8 months until Node + ESM was no longer experimental.

The big shift to ESM in the Node ecosyste won't happen until Node 14.x hits LTS in October.

Thread Thread
tamb profile image
Tamb Author

That's gonna be great. I've been fine with UMDing my libraries but ultimately it's annoying. TypeScript does cover that issue though, at least that's what I've found. Your markdown component is sick too! Nice stuff!

Thread Thread
evanplaice profile image
Evan Plaice

UMD is probably the best universal target until IE can be dropped.

I don't use TS for library dev but all my libs are TS compatible. I kinda hope TS overtakes Webpack for compilation b/c its output is a lot more faithful to the spec. ESM in webpack is pretty much just CommonJS w/ ESM syntax and a lot of Node-specific behavior.

Spec ESM is damn good. Tree-shaking to remove dead code works beautifully. The major downside is you can't use non-strict JS w/ modules so it'll obsolete a ton of older libraries. That and pre-ESM libs that yeet their namespace onto the global context are painful to integrate.

For lib dev I use JS to lower the barrier-to-entry for contributors, add JSDoc types that compile to TS typings for all the type checking/intellisense goodies, and ship CommonJS for Node backward compat. Tooling w/ ESM support (ex testing) is still lagging but that should get better as time goes on.

Thanks! The wc-markdown is my favorite of the collection. It's what loads all of the content on my personal website. Hopefullt, one day I'll finish that markdown-es parser so I can optimize the heck out of it.