Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

use-static-MODEL_NAME-for-constructor.name-alternative #183

Conversation

devdoomari3
Copy link

why: I'm having trouble with webpack production mode's name-mangling.
Specifically, even when I create:

class User extends Typegoose {
  ... 
}

the 'User' class often is not 'User' after name-mangling.

This is problematic when I use webpact --production.

ps: a better solution would be to add a 'preserve-name-for-next-line-comment' feature on uglifyjs, but I'm still waiting for that to happen)

@coveralls
Copy link

coveralls commented Aug 24, 2018

Coverage Status

Coverage increased (+0.5%) to 86.782% when pulling 3bcfe32 on devdoomari3:add-constructor.name-alternative-MODEL_NAME into 15910d8 on szokodiakos:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 86.782% when pulling f575f35 on devdoomari3:add-constructor.name-alternative-MODEL_NAME into 15910d8 on szokodiakos:master.

@hasezoey
Copy link
Contributor

@devdoomari3, if you still use typegoose, or want to help, could you rebase / edit your pr to be working with the lastest master or close it?


ps: a better solution would be to add a 'preserve-name-for-next-line-comment' feature on uglifyjs, but I'm still waiting for that to happen)

does uglifyjs still dosnt have this feature?
Note: i dont know webpack or uglifyjs

@hasezoey
Copy link
Contributor

hasezoey commented Aug 2, 2019

@Ben305 should this be made as a "wontfix"?
its not mainly typegoose's fault for this, and it should (by design) use the class name

@devdoomari3
Copy link
Author

@hasezoey sorry for the late reply...

I also think typegoose isn't the right place to insert this 'fix'
(the correct fix would be adding options to preserve class names in uglify / terse js)
you can discard this PR.

ps.
mishoo/UglifyJS#3263 : didn't work out...

https://github.com/terser-js/terser
has options regarding 'mangle' -> 'preserve', but I really hope they would implement comment-based options.

@hasezoey
Copy link
Contributor

hasezoey commented Aug 6, 2019

@devdoomari3 if its not an issue with typegoose / anymore, could you close this?

@devdoomari3 devdoomari3 closed this Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants