dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Don't use pre-minified Vue version

Open moio opened this issue 1 year ago • 3 comments

Summary

Fixes https://github.com/rancher/dashboard/issues/12306

This changes the way scripts are minified and source maps are computed. Instead of using a pre-minified Vue version, use the full version and minify it using the existing minifier.

That moves minification after source map creation, restoring expected resource map functionality.

Occurred changes and/or fixed issues

Original With this PR
Javascript file size in dist/js 13 MB 13 MB
Source map file size in dist/js 43 MB 45 MB
Build time reported by yarn 110 s 75 s

File size change is modest, and occurs basically only in source maps which are not loaded by most users. Runtime is also shorter in my setup. All tests were run on 2.9.1.

Technical notes summary

Should be completely transparent to non-developer users.

I hope this works.

Areas or cases that should be tested

Regular test of a new Rancher version should be more than sufficient to catch any regressions, which by the way are not expected as the change uses a value that was already in place for development builds.

Checklist

  • [x] The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • [x] The PR has a Milestone
  • [x] The PR template has been filled out
  • [ ] The PR has been self reviewed
  • [x] The PR has a reviewer assigned
  • [x] The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • [x] The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

moio avatar Oct 21 '24 13:10 moio

@rak-phillip to look at this and see what needs to be ported over to 2.10.x

gaktive avatar Oct 21 '24 16:10 gaktive

@rak-phillip / @gaktive I'm in discussions with Silvio about this in slack. Generally looking good for 2.9 but investigating further.

ATM not sure any change is needed for 2.10 as it avoids the min version (and just uses 'vue' but i'm not sure if that's prod/dev/something else). So we need to validate 2.10 prod builds output vue fns in performance logs

richard-cox avatar Oct 21 '24 16:10 richard-cox

@richard-cox about chunk size: in my 2.9.1 setup js/chunk-*.js are all exactly matching (to the byte), apart from chunk-vendors.*.js which is 31001 bytes (~30 kB) longer.

moio avatar Oct 22 '24 08:10 moio

Here is a stack trace from Chrome in the exact same situation, patched and unpatched:

Screenshot 2024-10-22 at 11 08 51 Screenshot 2024-10-22 at 11 07 31

Many more function names are now readable - unfortunately not 100% of them (despite correct names being there in the source maps, which can be read by clicking).

moio avatar Oct 24 '24 12:10 moio

Please let me know if anything more is need from my part.

Thanks for the reviews.

moio avatar Oct 24 '24 12:10 moio

@moio i've created issues to cover the required milestones

richard-cox avatar Nov 06 '24 14:11 richard-cox