Skip to content

Unify the main function name of Integration packages #657

@2chanhaeng

Description

@2chanhaeng

Summary

Unify the main function names of Integration packages.

Problem

For most Integration packages, the main component is a function of type <TContextData>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData>) => Handler<TContextData> that takes a Federation object and a ContextDataFactory factory function and turns them into a middleware handler. However, the name of this function differs by package, adding to user confusion.

Proposed Solution

To reduce this confusion, we are unifying the main function names. Just as the ContextDataFactory type is defined separately for each package but has the same name, it should be entirely possible to unify the main function names as well.

Alternatives Considered

However, changing all the name right now would cause even greater confusion for users. To avoid this, in the current 2.x version, we will unify the names and keep the existing names as aliases, but mark them as deprecated to encourage users to use the unified name.

Scope / Dependencies

  • Almost of all integration packages
  • packages/init: template files

Additional Suggestions

  • Setting the second argument of the main function optional and setting its default value to () => void 0.
  • Exporting the main function as default.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions