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

Load all async-{xyz} asynchronously instead of upfront during the boot process #10

Open
ibdafna opened this issue May 12, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ibdafna
Copy link
Owner

ibdafna commented May 12, 2021

Plotly saves on memory by lazy-loading dependencies its apps require. These generally tend to come from the dash-core-components distribution, and are retrieved using GET requests which Flask serves. WebDash currently loads all of them upfront during the boot process.

webdash/src/webdash.ts

Lines 123 to 140 in 9857988

// Dash core components
const dccDir = `${sitePackagesDir}dash_core_components/`;
const dccFiles = [
"async-plotlyjs.js",
"async-graph.js",
"async-markdown.js",
"async-highlight.js",
"async-dropdown.js",
"async-slider.js",
"async-datepicker.js",
"async-upload.js",
"dash_core_components.min.js",
"dash_core_components-shared.js",
];
for (const fileName of dccFiles) {
scriptTags.push(await this.generateScriptBlob(dccDir, fileName));
}

It would probably make more sense to stay true to the original intention and load these asynchronously whenever an app that depends on them, requests them.

@ibdafna ibdafna added the enhancement New feature or request label May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant