modern debugging template, only load the 1.1mb of echarts javascript when the metrics are shown

Description

When the modern debugging template is enabled, the huge 1.1mb echarts-all.js javascript library is always loaded for every request.

Can this be delay loaded only when the metrics tab is selected?

Environment

None

Activity

Show:
Zac Spitzer
April 23, 2019, 4:35 PM

there's an online custom build tool for echarts which lets you select just the chart type required, instead of loading support for every possible chart type

https://echarts.baidu.com/builder.html

i.e this config produces a 366k echarts library (I'm not sure what options are being used for Lucee, I think only one type of chart is being used currently for Lucee)

https://echarts.baidu.com/builder/echarts.html?charts=line&components=gridSimple,title,legendScroll,tooltip&api=true&version=4&versionCode=4.2.1

Pothys - MitrahSoft
April 30, 2019, 8:22 AM

I've added a fix for this issue. Lucee loads the 1.1mb of echarts when metrics are shown. So I've updated the corresponding jquery file to load the specific chart as per reporter's said.

Pull request: https://github.com/lucee/Lucee/pull/674

Zac Spitzer
April 30, 2019, 10:52 AM

as it is no longer the echarts-all.js version, the file should be renamed echarts-custom.js

if you use this approach, you can just load it when required (i.e. if the metrics tab is clicked)

 

Pothys - MitrahSoft
May 7, 2019, 11:05 AM

I've added the approach that was mentioned by Zac in the above comment. Now the echarts-all.js loaded at the time of only when we click the Metrics button.

Michael Offner
May 9, 2019, 3:15 PM
Fixed

Assignee

Michael Offner

Reporter

Zac Spitzer

Priority

New

Labels

Fix versions

Sprint

None

Affects versions

Configure