Skip to content

Dynamically import echarts and three.js#2349

Merged
mcm001 merged 1 commit intoPhotonVision:mainfrom
Gold856:dynamic-imports
Feb 2, 2026
Merged

Dynamically import echarts and three.js#2349
mcm001 merged 1 commit intoPhotonVision:mainfrom
Gold856:dynamic-imports

Conversation

@Gold856
Copy link
Member

@Gold856 Gold856 commented Feb 2, 2026

Description

This splits echarts into its own bundle to speed up the initial page load, and dynamically imports it so it's only loaded when a user navigates to the settings page. This also fixes an issue with the three.js dynamic import where the import was immediately awaited, so the page load was blocked on loading three.js.

old.mp4

Note the UI isn't displayed until after three.js is fully downloaded.

new.mp4

Note that the initial JS bundle is much smaller and three.js is loaded after the UI loads.

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why, including events that led to this PR
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with all settings going back to the previous seasons's last release (seasons end after champs ends)
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@Gold856 Gold856 requested a review from a team as a code owner February 2, 2026 05:43
@github-actions github-actions bot added the frontend Having to do with PhotonClient and its related items label Feb 2, 2026
@mcm001 mcm001 merged commit f4b30da into PhotonVision:main Feb 2, 2026
58 checks passed
@Gold856 Gold856 deleted the dynamic-imports branch February 2, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Having to do with PhotonClient and its related items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants