Skip to content

[PiranhaJS] Proposals for Enhancing PiranhaJS: Tree Sitter Integration, Support for Stage 2 Proposals, and Class Variable Cleanup #650

@vivek-freshworks

Description

@vivek-freshworks

Feature request:

  1. Currently, PiranhaJS relies on the Esprima parser, which lacks support for stage 2 proposals. How can I handle decorators in my project using PiranhaJS? Can I contribute a pull request to replace Esprima with Babel parser to address this?

  2. I've noticed that class variables are not being cleaned up at all in PiranhaJS. For instance, in the provided input and expected output example, class variables was are retained. How can we ensure proper cleanup of class variables in PiranhaJS?

Input:

class Abc {
  get myFlag() {
    return isFlagTreated(featureFlag);
  }

  method() {
    return window.myVar && this.myFlag;
  }
}

Expected Output:

class Abc {
  method() {
    return window.myVar;
  }
}

Doubt: Why hasn't Javascript transitioned from legacy to Tree Sitter? Are there specific reasons for this?

@anag004 @s7rthak @mkr-plse

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions