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

Service Dependency Type-Checking #38

Closed
wants to merge 16 commits into from

Commits on Jul 18, 2023

  1. feat(types): Add TypedConstructable type

    This utility type allows us to easily type classes
    with both an expected instance type, and a set
    list of arguments.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    092ab05 View commit details
    Browse the repository at this point in the history
  2. feat(Service): introduce Service type-checking

    While this implementation is very... verbose,
    it does work and I see no practical way around it
    in the current version of TypeScript.
    
    I've tried to condense the documentation by way
    of TSDoc inheritDoc tags, but they don't actually
    display in solutions such as VSCode.
    This makes the documentation worse, as the docs
    for each static overload wouldn't be visible without
    scrolling to the generic fall-through overload.
    
    Currently, the "everything is an option object" overload
    isn't type-checked.  This makes the code a bit less
    verbose, but it may be desirable.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    f518d99 View commit details
    Browse the repository at this point in the history
  3. fix(Service): add type-detection for built-ins

    Add support for using built-ins as dependencies
    in the type-checking algorithm.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    8ab5b5c View commit details
    Browse the repository at this point in the history
  4. feat(Service): type-check built-ins correctly

    Ensure built-ins are converted to the correct type
    when type-checking dependencies.
    For instance, String should convert to string.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    49592f6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    21f2d43 View commit details
    Browse the repository at this point in the history
  6. fix(Service): remove type-check test code

    The code was never meant to make it into
    a commit, but oh well.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    f62bcd7 View commit details
    Browse the repository at this point in the history
  7. style(Service): rename MaybeTransformBuiltIn to MapBuiltInToNativeType

    The new name is more descriptive of what the type does.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    623641b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d7d8cf4 View commit details
    Browse the repository at this point in the history
  9. refactor(Service): replace ServiceSubject with ServiceWithDependencies

    Furthermore, simplify the type-resolution algorithm and remove its
    dependency on arrays with a fixed number of items.
    The new implementation is compatible with arrays of any size.
    
    A major advantage of this implementation is that it **dramatically**
    simplifies the implementation of dependency type-checking,
    while also removing the need for multiple Service / JSService overloads.
    Overall, this means much less code duplication.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    540f676 View commit details
    Browse the repository at this point in the history
  10. fix(JSService): tighten implementation signature

    This brings the JSService in-line with that of Service.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    70f156e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    307c4be View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    dbd46fd View commit details
    Browse the repository at this point in the history
  13. refactor(JSService): rename service-subject to typed-dependencies

    This makes it more clear what the file does.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    c20a986 View commit details
    Browse the repository at this point in the history
  14. fix(JSService): introduce TSignore

    This is temporary. I'd like to find a better way.
    However, currently TypeScript thinks the type
    is excessively deep if we cast it.
    freshgum-bubbles committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    c560aac View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    3eb580f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    2c0abbe View commit details
    Browse the repository at this point in the history