Skip to content

[Proposal] Simpler class transformation #12516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bigopon opened this issue Nov 26, 2016 · 2 comments
Closed

[Proposal] Simpler class transformation #12516

bigopon opened this issue Nov 26, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@bigopon
Copy link

bigopon commented Nov 26, 2016

Please ignore if this already discussed.

  • Current problem
    Suppose I have a class like this:
class MyClass {
   //....
   // Here I have 100 class methods
}

This will be transformed into:

function MyClass() {}
// 100 times of this repeated: MyClass.prototype.method... = fn
  • Expected behavior - Ideal transformation
    Can we have something like this instead:
var _proto = MyClass.prototype
// 1000 class methods ?
_proto.method1 = fn
_proto.method2 = fn
  • After minification
    // a lot less output code after minification
// var a = MyClass.prototype;
// a.method1 = fn
// a.method2 = fn

Imagine if we have 20 of classes like this, the amount of prototype repeated will be big, not counted the long class names

Can we have it enhanced in this way ?

@aluanhaddad
Copy link
Contributor

This looks like a duplicate of #9638

@bigopon
Copy link
Author

bigopon commented Nov 27, 2016 via email

@mhegazy mhegazy closed this as completed Nov 28, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Nov 28, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants