microsoft / microsoft/DynamicProto-JS

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

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
28
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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
     */
}  

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README's description of the existing Rollup plugin and identify how the requested Webpack post processor should recognize each @DynamicProtoStub comment form. Done means the resulting Webpack code removes the tagged stub methods while the TypeScript declarations retain the prototype-level definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.