Closed jackw closed 2 weeks ago
The current version of Grafana OnCall, at the time this issue was opened, is v1.9.25. If your issue pertains to an older version of Grafana OnCall, please be sure to list it in the PR description. Thank you :smile:!
btw, this is what we're seeing when loading up an empty dashboard on an ephemeral instance, to give you an idea of potential impact on overall load times:
Has been merged to IRM, will close it once it's been released
hey, @teodosii , thanks!
it's been released / deployed, and there is good improvement but we're still seeing a 1.3MB module.tsx
bundle for oncall-app
. it looks like there's no Suspense
or lazy
in grafana-oncall-app/src/module.tsx ?
Hey @leeoniya
I did merge another PR regarding this
Not entirely familiar with how the Coverage
tool works on a minified version, but after these changes when we build the plugin the largest file is much smaller than what he had in the past.
Network tab on oncalldev environment
As for the coverage tab this is the result
I'm not sure how accurate is the coverage tab, as if you look closely it's saying that a huge chunk of it is taken by the library tinycolor
, but that's not true, as if you inspect the bundle closely with tools such as bundle-analyzer, it's actually moment-timezone taking the biggest chunk (which would be the next step in reducing the bundle size by removing dep of that, as most of our date handling is in dayjs)
Last PR regarding momentjs has been merged and the bundle size decreased by another ~700kb. Here's a screenshot of it in ops environment. From 2.8mb to 235kb
What would you like to see!
Hello! 👋
Whilst auditing Grafana javascript payloads we've noticed that your Grafana app plugin is not taking advantage of code splitting. This is resulting it a large amount of unused Javascript being preloaded before the Grafana application can render anything. We're aware applications grow over time and generally we're not great at keeping on top of this but we would really appreciate it if you could put some time into code splitting this app plugin to help us reduce the amount of javascript code we're loading up front.
The following are worth considering when taking on this task:
Below are two examples of Grafana plugins that have recently been code split or are in the process of being code split. The motions are generally the same for all app plugins as the module.js revolves mostly around the AppPlugin class. These should help give you a better understanding of what's involved:
Further information:
Product Area
Other
Anything else to add?
No response