FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Fix some development code not getting optimised out

Open absidue opened this issue 3 years ago • 0 comments


Fix some development code not getting optimised out

Important note We may remove your pull request if you do not use this provided PR template correctly.

Pull Request Type Please select what type of pull request this is:

  • [x] Bugfix

Description Webpack doesn't know about vue's computed properties or vuex stores, so it doesn't know how to optimise them out. This PR fixes that by marking development only code in a way that webpack understands, so it can remove the dead code properly while optimising the release builds. This PR also gets rid of some unnecessary isDev computed properties. This change doesn't make a big size or speed difference but even a 849 byte decrease in size and an unmeasurably small performance improvement are better than including dead code in a release build.

Screenshots (if appropriate) before

after

Testing (for code that is not small enough to be easily understandable) yarn dev and yarn build

Opening the settings will test both the geolocation names for trending the fetching of the invidious instances.

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.17.1

absidue avatar Sep 21 '22 21:09 absidue