DynamicProto-JS icon indicating copy to clipboard operation
DynamicProto-JS copied to clipboard

[Enhancement] A Post Processor is required for WebPack to remove @DynamicProtoStub tagged methods

Open MSNev opened this issue 5 years ago • 0 comments

While a rollup plugin is available to remove the stub functions tagged with @DynamicProtoStub, we should really look at providing a version for WebPack.

As per the readme, tagged functions/methods should be removed from the resulting code as they are necessary to ensure that TypeScript provides the correct resulting definition (*.d.ts) where the functions are declared as "prototype" level functions.

/**
 * The typedoc comments
 */
// @DynamicProtoStub
public toBeRemoved():void {
}
 
// @DynamicProtoStub
public toBeRemoved():void {
}

/**
 * This function does stuff
 * @param args - used in the function
 */
public myFunction(args:string): void {
    ...
} // @DynamicProtoStub - Function will be removed

public myFunction2(): void {
...
}  // @DynamicProtoStub - Function will be removed

/**
 * This function does stuff
 * @param args - used in the function
 */
public myFunction(args:string): void {
    // @DynamicProtoStub - Function will be removed
}

public myFunction2(): void {
    /* @DynamicProtoStub 
     * Function will be removed
     */
}  

MSNev avatar Dec 17 '20 01:12 MSNev