-
Notifications
You must be signed in to change notification settings - Fork 4
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
Reduce js bundle size #48
Comments
@dwitvliet The largest 4 seem to be cytoscape.js, jquery, jquery-ui and core.js, which is what babel adds to the bundle to ensure ES6 features are available in all browsers. Here are a couple of ways off the top of my head that we could potentially reduce dependencies.
In terms of lazy loading that would be really good for the case when the user enters the site normally, but if they get a link to a network we would have to load the whole bundle. Another interesting thing to note is that AWS/pagespeed/whatever that server is doing seems to already be splitting our bundle into two parts: One bundle has all the dependencies, the other has all the nemanode specific code. Let me know what you think about these ideas. |
Great visualization. Lodash also takes up a considerable part.
Having the library in a bundle separate from the main code is intentional. Since the main code changes on every update but the libraries do not, it prevents the user from having to reload the entire bundle on an update. It's set up here. |
TODO:
|
I don't know why lodash says it takes up that much because we do install only the modules we need. That said, we could just implement the functions ourselves. I also found a couple of functions that we import into the bundle but dont' actually use so I can remove those. I can try feeding in the browserlist field from package.json into the bablerc file to see if it removes code included from core.js |
…if the network elements objects are empty. refs #48
1.17 MiB seems excessive. Can be optimized either by lazy loading or by cutting down on dependencies.
The text was updated successfully, but these errors were encountered: