Open zfzackfrost opened 5 years ago
@zfzackfrost currently there is no official Flow support. Is that kind of annotation valid for TS?
@zfzackfrost currently there is no official Flow support. Is that kind of annotation valid for TS?
@borislit Not that exactly. But the the code itself is the same, in terms of characters. I'm not as familiar with Typescript as I am with flow, but I know that this part of the syntax:
(variable: type)
appears in Typescript functions. My hunch is that Glean is trying to parse Typescript annotations, even in normal JS files.
We are not using Typescript but are using Flow instead. It appears that Glean tries process Flow type annotations that are also valid Typescript. In these cases it displays an error like the following:
For instance, trying to run glean on the following throws code from our web app causes
Extract Component
to fail:However, when the Flow type annotation (inside the onClick binding, if you missed it :smile: ) is taken out, it works as expected. So this code extracts with Glean correctly:
I'm pretty sure this isn't the expected behavior.
-- Zack Frost