Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay script loading #620

Open
flibbertigibbet opened this issue Nov 15, 2016 · 0 comments
Open

Delay script loading #620

flibbertigibbet opened this issue Nov 15, 2016 · 0 comments
Labels

Comments

@flibbertigibbet
Copy link
Contributor

The site could be faster, particularly on mobile, if script loads were delayed until needed. In particular, map-related things on the home page aren't needed until navigating to get directions, or the screen resizes large enough to see the map. See discussion on #616.

However, there are some interrelated dependencies that may make this challenging. In particular, there is a chain of scripts that expect cartodb.js and Leaflet objects to be defined, but currently need to be loaded whether or not the map has actually been initialized yet. Also, the JS scripts will need to know whether the app is running in development mode or not to know which scripts to load.

So, code splitting and delayed loading via Weback or similar may be desirable, but would likely require significant refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants