3 ms·
Aren't the Babel people trying to define a common standard format for the AST so different parsers and code generators can better work together? That said, if
by pluma 10y ago
Aren't the Babel people trying to define a common standard format for the AST so different parsers and code generators can better work together?
That said, if you look at TS as a superset of Babel plugins, there's actually not much to TS that is TS-specific. Adding that to Babel would be relatively simple.
You seem to be arguing it's a slippery slope. We're not talking about arbitrary syntax. We're talking about a fairly well-established syntax extension backed by Google and Microsoft. It doesn't have to perfectly universal and generic to support TS.
EDIT: If you were specifically addressing the parent: yes, if every syntax extension was created as a parser plugin, getting them to work together would be messy, but that's basically what we have in PostCSS isn't it? Plugins explicitly instructing users "this conflicts with X, please add it after Y but before Z" -- which is fine IMO as you only need to care about the most popular ones and everybody else knows their stack is experimental.
- phpnode 10y ago> Aren't the Babel people trying to define a common standard format for the AST so different parsers and code generators can better work together? Actually kind of the opposite - babel used to use the common ESTree AST format, but they've moved away to something similar but incompatible.