Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
131 stars 47 forks source link

Switch some unnecessary classes to interfaces #457

Open hossam-nasr opened 1 year ago

hossam-nasr commented 1 year ago

Some of the classes that the Durable SDK exports are essentially serving as interfaces. Here's an example of the HttpManagementPayload class:

export class HttpManagementPayload {
    /** @hidden */
    [key: string]: string;

    /** @hidden */
    constructor(
        /** The ID of the orchestration instance. */
        public readonly id: string,
        /** The HTTP GET status query endpoint URL. */
        public readonly statusQueryGetUri: string,
        /** The HTTP POST external event sending endpoint URL. */
        public readonly sendEventPostUri: string,
        /** The HTTP POST instance termination endpoint. */
        public readonly terminatePostUri: string,
        /** The HTTP POST instance rewind endpoint. */
        public readonly rewindPostUri: string,
        /** The HTTP DELETE purge endpoint. */
        public readonly purgeHistoryDeleteUri: string
    ) {}
}

We should consider switching these types of classes to interfaces. The benefit of this:

However, this is technically a breaking change, since using an instanceof operator would no longer work on these classes.

davidmrdavid commented 1 year ago

@hossam-nasr : Just following up. I believe we agreed to keep this class as is in our discussion. Is that correct?

hossam-nasr commented 1 year ago

@davidmrdavid Yes, I believe we decided to deprioritize this for this release. I'm keeping this for future reference without the preview tag