Skip to content

Enhanced Examples #1263

Open
Open
@hzoo

Description

@hzoo

Ref #59

Maybe this is just weird, but it would be pretty cool to see real world examples of specific syntax out out on github. So if you are learning about arrow functions we can provide some basic examples but maybe you'd like to see how it's used in an actual codebase?

  • examples we can come up with (simple, easy to learn) REPL: Examples #59
  • examples from our unit tests (basically "syntax" coverage, but not as helpful to developers to learn from)
  • examples from babel/github itself (no context but more real world usage)
    • hardcode a script to find kinds of syntax, or create an AST/Babel grep kind of tool that prints a codeframe of the relevant syntax
    • Use GitHub Archive/Google BigQuery's database to search github for uses of a certain syntax/pattern (filter JS repositories, filter by stars, date)? (may need to pin the commit/file)
    • populate examples?

For example: Searching on github for JS repositories with a > 1000 stars, https://github.com/reactjs/react-redux/blob/7337f1a5de42c76b69e56f713ac933aedcb12867/src/connect/connect.js#L31 has an example of an arrow function

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions