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

Initial features #1

Closed
28 of 33 tasks
dhoepelman opened this issue Aug 5, 2017 · 1 comment
Closed
28 of 33 tasks

Initial features #1

dhoepelman opened this issue Aug 5, 2017 · 1 comment

Comments

@dhoepelman
Copy link
Member

dhoepelman commented Aug 5, 2017

Must have

For internal viability:

  • Handle & allow expression of the whole TS type system
    • Primitives (bool, num, string)
    • Top (any), Bottom (never), Unit (void) and null (null, undefined)
    • Arrays
    • Indexed Interfaces
    • Interfaces
    • Union
    • Intersections
    • Tuples
    • Enums
    • Object
    • Type aliases (currently modeled as a first-class type similar to interfaces, not 100% sure that is correct)
    • Literal types (string, number/integer, boolean?)
  • Serialize TS types
  • Discover all top-level types (interfaces, aliases) necessary to emit interfaces
    E.g. if you want to publish IFoo { member: IBar } IBar will also need to be emitted
  • Small DSL to define interfaces and/or modify generated interfaces
  • Macro that generates case classes

Should have

For internal and public viability (i.e. if these are checked we could definitely do a public release)

  • Write to files/streams
  • Basic readme and documentation including example project
  • Scala 2.11, 2.12 and 2.13 cross-compilation
  • Publishing to a public maven repository
  • Emit in a namespaces/module/class, handle subpackaging. Including overwriting by user?
  • Solid test suite
  • SBT Plugin to generate the TS files
  • Lots of predefined mappings, e.g. java8 dates, uuid etc.
    • Generics for collections (List[T] etc)
  • Handle or give an error on recursive definitions
  • Mark all subtypes of a specific type as having the same mapping
  • Provide a default parameter for implicit TSTypes, a macro which understands built-in types and case classes so implicits aren't mandatory the be defined

Could have

Useful features which aren't the top priority

  • Generics? Not sure how they are useful in a serialization <> deserialization context like this is used for
  • Style options? i.e. 2-4 spaces indentation, whether to emit (T | undefined) as member: (T | undefined) or member?: T etc.
  • Create a distriminated union from a sealed trait

Won't have

Currently not in scope

  • Generating Scala case classes from typescript interfaces
    So much potential here, basically the dual. Useful to make sure your back-end can parse the frontend JSON. Auto-generate JSON deserialises based on TS interfaces
@dhoepelman
Copy link
Member Author

The project has a lot of the basics, a separate issue has been creates for all missing features

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

No branches or pull requests

1 participant