unsplash / intlc

Compile ICU messages into code. Supports TypeScript and JSX. No runtime.
MIT License
56 stars 3 forks source link

Slim the AST a bit #125

Closed samhh closed 2 years ago

samhh commented 2 years ago

This had been bugging me for a while and came up when talking to @Magellol.

ICU.Message was a sum type (Static | Dynamic) and is now a newtype holding a Stream. NEStream (non-empty Stream) is removed. There was only one part of the codebase that cared about whether the message was static or not, the TypeScript compiler as it pertains to the argument (x or ()), and that's trivially replaced with a quick any call.

ICU.Arg was essentially just an additional wrapper around ICU.Interpolation's data (name and type).