Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ast-types 0.8.18 #304

Merged
merged 1 commit into from
Aug 5, 2016
Merged

Update to ast-types 0.8.18 #304

merged 1 commit into from
Aug 5, 2016

Conversation

fkling
Copy link
Contributor

@fkling fkling commented Jul 20, 2016

... to include TypeParameter information (benjamn/ast-types@d5ce040). See also flow/flow-codemod#6 (comment) .

This would also require a new (patch) release of recast.

@fkling
Copy link
Contributor Author

fkling commented Jul 20, 2016

Mmh, I guess the printer needs to be updated? I'll look into it.

@fkling
Copy link
Contributor Author

fkling commented Jul 20, 2016

Updated the printer as well. Tested the print result in the node REPL:

var n = {
    "type": "TypeParameter",
    "name": "X",
    "bound": {
        "type": "TypeAnnotation",
        "typeAnnotation": {
            "type": "GenericTypeAnnotation",
            "id": {
                "type": "Identifier",
                "name": "T",
                "typeAnnotation": null,
                "optional": false
            },
            "typeParameters": null
        }
    },
    "variance": "minus",
    "default": {
        "type": "NumberTypeAnnotation",
    }
};
recast.print(n); // PrintResult { code: '-X: T=number' }

cc @jeffmo, @keyanzhang regarding the generated code. I don't know how NullTypeAnnotation should be printed (if at all), it doesn't seem to be used by any other nodes.

@jeffmo
Copy link

jeffmo commented Jul 20, 2016

NullTypeAnnotation is the null annotations:

var a: null = null;

@fkling
Copy link
Contributor Author

fkling commented Jul 20, 2016

Ah OK. And it's not referenced anywhere else in the definition because it simply extends Type. Alright, will update the PR.

... to include `TypeParameter` information (d5ce0400511bdf6b063c13728c4fa09edd9e122d). See also flow/flow-codemod#6 (comment) .
@fkling
Copy link
Contributor Author

fkling commented Aug 5, 2016

Ping? Without this, jscodeshift is unusable on files that use the latest flow syntax, @benjamn. 😞

@benjamn benjamn merged commit 05a0e5f into benjamn:master Aug 5, 2016
@benjamn
Copy link
Owner

benjamn commented Aug 5, 2016

Done! Thanks for the bump. https://github.com/benjamn/recast/releases/tag/v0.11.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants