ember-resources icon indicating copy to clipboard operation
ember-resources copied to clipboard

[Blocked]: do not compile away properties and methods

Open NullVoxPopuli opened this issue 3 years ago • 2 comments

This should be tested with a couple consumers before merge, this could be considered a breaking change if consumers are not expecting to have to compile away private fields / methods or class fields / methods entirely. I think ember-cli-babel will handle this for them tho.

This is BLOCKED until this is resolved:

  • https://github.com/babel/babel/issues/14917#issuecomment-1242762773 atm, babel compiles in a runtime error if the class-properties transform hasn't ran.
  • Once the above is resolved, this issue should also be able to be closed: https://github.com/babel/ember-cli-babel/issues/447

Did some math in a googlesheet: https://docs.google.com/spreadsheets/d/12k6wnuvE4peVqQRMGFHCYq3fXgx5tsadlyPIolEQKnY/edit?usp=sharing

Improvement by not compiling away properties and methods        
  js min min + gzip min + brotli
/index.js -5.21% -5.54% -1.52% -2.63%
├── core/class-based/index.js -8.85% -6.82% -6.90% -7.40%
├── core/function-based/index.js -6.95% 0.00% 0.00% 0.00%
└── core/use.js 0.00% 0.00% 0.00% 0.00%
/util/cell.js -8.74% -21.21% -10.51% -12.34%
/util/debounce.js -3.13% -9.05% -7.09% -5.92%
/util/ember-concurrency.js -2.35% -8.51% -7.48% -7.59%
/util/function-resource.js 0.00% 0.00% 0.00% 0.00%
/util/function.js -4.40% -9.88% -5.24% -4.57%
/util/helper.js 0.00% 0.00% 0.00% 0.00%
/util/keep-latest.js 0.00% 0.00% 0.00% 0.00%
/util/map.js -31.26% -67.61% -42.88% -42.59%
/util/remote-data.js 0.00% -10.76% -6.31% -5.52%

NullVoxPopuli avatar Sep 10 '22 12:09 NullVoxPopuli

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e8ddba
Status: ✅  Deploy successful!
Preview URL: https://4e677c96.ember-resources.pages.dev
Branch Preview URL: https://do-not-compile-away-properti.ember-resources.pages.dev

View logs

Estimated impact to a consuming app, depending on which bundle is imported

js min min + gzip min + brotli
/index.js 13.06 kB 3.07 kB 1.32 kB 1.14 kB
├── core/class-based/index.js 4.07 kB 1.76 kB 869 B 743 B
├── core/function-based/index.js 5.61 kB 552 B 269 B 213 B
└── core/use.js 2.91 kB 415 B 256 B 203 B
/util/cell.js 1.83 kB 660 B 371 B 308 B
/util/debounce.js 2.56 kB 707 B 381 B 321 B
/util/ember-concurrency.js 4.25 kB 1.41 kB 682 B 580 B
/util/function-resource.js 216 B 154 B 123 B 87 B
/util/function.js 3.86 kB 1.62 kB 668 B 569 B
/util/helper.js 1.8 kB 303 B 218 B 177 B
/util/keep-latest.js 1.75 kB 512 B 296 B 235 B
/util/map.js 4.35 kB 1.42 kB 695 B 594 B
/util/remote-data.js 4.86 kB 1.58 kB 634 B 562 B

github-actions[bot] avatar Sep 10 '22 12:09 github-actions[bot]

ember-resources should use this in the next major: https://github.com/ef4/decorator-transforms it'd be a major, because it'll require a min version of ember-cli-babel in consuming apps.

NullVoxPopuli avatar Dec 22 '23 16:12 NullVoxPopuli