packages icon indicating copy to clipboard operation
packages copied to clipboard

Migrate from ES6 classes to prototypes

Open Machy8 opened this issue 2 years ago • 0 comments

  • It makes bundles larger
  • The classes are not classes
  • Naming conventions when using classes are "wierd". Especially for imports
  • Private things are not realy private. The same goes for protected
  • Classes that has properties is complicated to import in webpack or rollup from node modules. Especially, when they are nested in another package @stylify/nuxt-module uses @stylify/stylify. Needs a transformation before import, otherwise it fails
  • Radonly properties are basically constants. However in classes it can be rasigned...
  • Reasigment detection (if variable is reasigned or not) is better for let variable type then for class property.
  • Also: https://medium.com/javascript-in-plain-english/please-stop-using-classes-in-javascript-and-become-a-better-developer-a185c9fbede1 and https://reactjs.org/docs/hooks-intro.html
  • It's simply a mess

Machy8 avatar Jun 05 '22 14:06 Machy8