Top 6 TypeScript Parsing Projects
Transforming styles with JS pluginsProject mention: Intro to ViteJS | dev.to | 2021-09-15
Under the hood, Vite uses esbuild. For CSS, it can handle PostCSS if you add a config for it, or css-modules if you add .module.css files, or sass. It will also make liberal use of the import.meta to add some sugar methods like glob imports or adding environment variables. You can switch the build to use terser and get a slightly smaller build, but it is a little slower. In my regular usage, I don't notice a huge difference, so I leave esbuild as default.
ECMAScript parsing infrastructure for multipurpose analysisProject mention: We Switched from Webpack to Vite | news.ycombinator.com | 2021-04-28
The thread was originally about CRA vs Vite size on disk (or implicitly, if we're applying it to real world applications, network cost in CI job startup times). And like I said, surrogate pairs don't apply to ASCII.
See this for reference. Note how the first byte must fall within a certain range in order to signal being a surrogate pair. This fact is taken advantage of by JS parsers to make parsing of ASCII code faster by special casing that range, since checking for a valid character in the entire unicode range is quite a bit more expensive.
I don't think I'll have time to make one any time soon, unfortunately. My original plan was to write a compiler in TypeScript using Chevrotain, and see if it's possible to compile down to TypeScript's AST and feed that into its own compiler programmatically. Basically piggybacking on Microsoft's hard work (work smart, not hard). I don't know if it's possible, but it's what I'd try first.
The most significant performance-oriented effort in this space still leveraging JS that I know of is kataw, and while that's quite fast compared to babel, it's still within an order of magnitude from babel. Kataw itself is a CST-based implementation that was created to outperform seafox (a AST-based parser by the same developer).
Babel gained popularity due to the crazy amount of churn in grammar over the past few years, but more and more I think the dust is settling, and flexibility is no longer the name of the game, making an AST-based implementation less appealing. The Rome team must be feeling the heat if the data structure design choices are being informed by performance. I highly doubt someone will be able to compete in performance using a JS implementation in today's landscape.
🌌 Tiniest body parser in the universe. Built for modern Node.jsProject mention: Using Redis Pub/Sub with Node.js | dev.to | 2021-08-30
The tinnyhttp framework doesn't come with a body parser already integrated so I'll install milliparsec, in addition to being lighter than the famous body-parser, it's asynchronous and faster.
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.Project mention: Parse, Don't Validate (2019) | news.ycombinator.com | 2021-06-26
What are some of the best open-source Parsing projects in TypeScript? This list will help you:
Are you hiring? Post a new remote job listing for free.