You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a planning discussion thread. Comments may be used to share code snippets and ideas or to add/correct pros/cons list.
Plan
Propose Interfaces that can be implemented in an unintrusive way so Type Definitions can be auto generated.
Identify and document challenging areas of the code base, along with a TypeScript code snippet that overcomes the challenge (i.e. function overloading https://www.typescriptlang.org/docs/handbook/functions.html, default parameters, Interface inheritance, constructor, nested generics)
Pros
Reduces amount of dev tools required, i.e. babel wouldn't be needed as transpiler anymore
Helps dom support with TypeScript's robust transpiling support for ES8 to ES3.
More maintainable code base using generics and type information
JavaScript developers consuming testdouble in js can benefit from type definitions, inline documentation and auto-complete
TypeScript developers consuming testdouble in ts can benefit from rich generics support
Type definitions would be automatically generated and wouldn't have to be manually maintained
Cons
A rewrite is a rewrite is a rewrite: a phased approached could be developed to ease the transition (i.e. Typed Interfaces to proxy existing JavaScript implementations)
Risky, testdouble depends on JavaScript quirks and single threaded execution to guess what the developer means by pulling the last item on the stack. A plugin may be required to provide such features to developers. While this would greatly reduce complexity of the codebase and open it up for even richer features. However, this in turn increases development and continued maintenance effort.
The text was updated successfully, but these errors were encountered:
Here's a TypeScript library starter that encapsulates best practices for creating packages that can target node and the browser which is what's needed for this project: https://github.com/Hotell/typescript-lib-starter
This is a planning discussion thread. Comments may be used to share code snippets and ideas or to add/correct pros/cons list.
Plan
Pros
dom
support with TypeScript's robust transpiling support for ES8 to ES3.Cons
The text was updated successfully, but these errors were encountered: