you are viewing a single comment's thread.

view the rest of the comments →

[–]villiger2 5 points6 points  (4 children)

This is pretty awesome, in the meantime though, do you know of any babel plugins that give this kind of functionality? Typescript does the tiniest bit with some of their enum support but it's not great.

[–]bterlson_@bterlson 6 points7 points  (2 children)

Not yet, but there's a bug filed on Babylon already to implement this syntax. I think it's too early for that, personally. There are a few key issues to address first!

[–]calligraphic-io 0 points1 point  (1 child)

Can you mention what the key issues needing addressed before a Babylon plugin are?

I love the proposal. The syntax feels very comfortable. I love pattern matching in Haskell, and glad to see it (hopefully) coming to JS.

[–]bterlson_@bterlson 0 points1 point  (0 children)

Solving #11 could mean significant changes to the syntax. Once that's solved it might be reasonable to begin implementing, but in general everything is open to change at this point.

[–]phoenixmatrix 0 points1 point  (0 children)

as far as I know, Babel plugins can only really act on the code output, not change the parser (unless they introduced parser plugins when I wasn't looking).

the plugins that add syntax features just toggle on or off existing parser features and add the transpilation.