Anyone know of any Rollup plugins that are capable of renaming/minifying "private" instance attributes?
-
Show this thread
-
Replying to @brian_d_vaughn
Have you looked at the fb internal Babel transform which does this?
1 reply 0 retweets 1 like -
-
Replying to @brian_d_vaughn @ur_friend_james1 reply 0 retweets 2 likes
-
Replying to @sebmck @ur_friend_james
Oh thanks! I tried playing with @babel/plugin-proposal-private-methods in the Babel REPL but it seemed broken.
1 reply 0 retweets 1 like -
Replying to @brian_d_vaughn @sebmck
yeah i think this is actually a bit different to the proposal plugin. specifically when minification is enabled it does this._foo -> this.$0 (incrementing id per property) https://fburl.com/sqynofd4
1 reply 0 retweets 1 like -
Replying to @ur_friend_james @brian_d_vaughn
Yeah, it also prepends the class name to the property to avoid subclasses overriding. You could still guess the property names but it's not very reliable and it's pretty obvious when you do. http://instance.Foo _$0
1 reply 0 retweets 0 likes -
Replying to @sebmck @ur_friend_james
Interesting. In my case I don't care about overriding. I just want things to be as small as possible. Are FB-internal plug-ins like this okay to fork for OSS?
1 reply 0 retweets 0 likes
It would probably involve going through the open source process, even if the code wasn't verbatim because it's a derivative.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 
No. Link me?