Repository navigation
Load amCharts and the heavy admin plugins only where they're used - #564
Merged
Merged
Conversation
amCharts is no longer loaded on every page: pages with charts include it before their chart bundle, and the WeDigBio rate modal fetches it when first opened. In the admin, jqGrid and jQuery UI load only on pages with the subjects grid, Summernote only with an editor and the datetimepicker only with date fields, which takes the admin bundle from 786 kB to 94 kB.
20 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loads amCharts and the heavy admin plugins only on the pages that use them, now that the build is Vite (#562).
amCharts
Both layouts included
common/amchart.blade.phpon every page: amCharts core, charts, the animated theme, maps and the world and US map data from amcharts.com, about 450 kB compressed, only so the WeDigBio rate modal in the menu could draw its chart.common/amchart.blade.phpis now just the CDN tags, with the map libraries behind['maps' => true].amcharts-loader.js), and reuses them after that. If the modal is closed before they arrive, it doesn't start its 5-minute refresh.Admin plugins
The admin bundle carried jqGrid, jQuery UI, Summernote and the datetimepicker on every admin page.
admin-app(was everything)admin-grid: jQuery UI,ui.multiselect, jqGrid,jqgrid.js#jqGridTable(subjects, expedition create, edit, show and clone).textareaeditor.date-time-pickerfieldsjQuery UI is only used by the grid's column chooser, so it moves into the grid chunk. Bootstrap-select, bootbox, notify and ClipboardJS stay in the main bundle, since they're used across the admin.
Tested locally (biospex.test)
yarn buildsucceeds;php artisan test --compact: 632 passed.data-selected-value). Expedition create loads the grid chunk (25 rows, Livewire managers). Event create loads the datetimepicker (both fields). Project edit loads Summernote (editor and toolbar). Statistics and admin events load amCharts and render.To verify on development
See #548.