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

Allow declaring methods and publications under models #1820

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 8, 2023

  1. Allow declaring methods and publications under models

    Almost all of our publications and models are associated (or at least
    primarily associated) with a model. This is reflected in the way we name
    our methods ("verbNoun"). However, we previously placed all methods in a
    single flat directory and did the same with publications.
    
    Instead, allow declaring methods and publications as part of creating a
    new model class. This has the convenient side-effect of reducing the
    imports you need to operate on a model to just the model class itself.
    It also makes the internal identifier for a method or publication match
    how we refer to it in code (e.g. `ChatMessages.methods.send`).
    
    For now, the implementations of the methods and publications are still
    in the same files as before; that's potentially something to reevaluate
    in the future. Additionally, it arguably makes it harder to enumerate
    all methods and publications, but that might be an acceptable tradeoff.
    ebroder committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    0b70431 View commit details
    Browse the repository at this point in the history