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

Theme: CodeMirror and some other modules probably extraneous #534

Closed
swelljoe opened this issue Aug 14, 2016 · 8 comments
Closed

Theme: CodeMirror and some other modules probably extraneous #534

swelljoe opened this issue Aug 14, 2016 · 8 comments

Comments

@swelljoe
Copy link

When I watch the network activity, I'm seeing tons of JS libs that aren't used on a given page being loaded. Seems like an unnecessary performance hit. The biggest of them is CodeMirror, but there are a bunch of others.

Wouldn't it be reasonable to only load CodeMirror on pages that have an editor?

@swelljoe
Copy link
Author

I'm asking, as performance seems to have gotten worse of late. Even on a fast network, I find I'm waiting longer than I used to on page loads.

@iliajie
Copy link
Collaborator

iliajie commented Aug 14, 2016

Hi, Joe.

I haven't changed anything in this regard recently.

Yes, there are a lot of things loaded in CodeMirror. I haven't noticed any performance hits due to this issue.

However, having CodeMirror loaded on demand sounds reasonable. Actually, the same way HTML editor is loaded, only on demand.

I'll see what I can do and try to enroll it on the next release.

@iliajie iliajie changed the title CodeMirror and some other modules probably extraneous Theme: CodeMirror and some other modules probably extraneous Aug 14, 2016
@iliajie
Copy link
Collaborator

iliajie commented Aug 14, 2016

You mentioned, Extraneous? What do you mean by that? What is to location of the files that are loaded and shouldn't be in you opinion?

@swelljoe
Copy link
Author

I dunno which ones are doing what. But, there's a lot of them! We should maybe see about using a loader or merging them into a single file. I dunno what the right thing is, but performance is maybe the biggest single source of complaints about the theme at this point.

What is jqueryui being used for, for example? If it's just one or two widgets, maybe those could be merged into the authentic js and kill that dependency. Cacheability is valuable, but since we don't use a CDN for Webmin (and realistically can't), our primary goal should be to reduce number and size of JS files loaded for each page.

@iliajie
Copy link
Collaborator

iliajie commented Aug 15, 2016

All requests are run in asynchronous way and will not provide a significant boost in case of merging dependencies. I will try do it and ship it as a single file but it will create redundancy, as both frames require the same frameworks.

I will see what I can do in terms of dropping/replacing some dependencies.

We would get an improvement (not enormous though) in case of switching to a single frame app but that will require a lot of work.

Thanks for your thoughts, Joe.

@iliajie
Copy link
Collaborator

iliajie commented Oct 16, 2016

Hi, Joe ;)

Ok, I managed to combine styles/scripts in the bundles and avoid redundancy. It's not a single file but make things slimmer as you described above. (making much less server requests)

I could make CodeMirror load on demand but it will break nice UI and at the moment I just added the whole thing at the bundle. In the future, in case I can overcome this issue, I will make it load only on demand.

However, I can't notice a difference not either on 1gbt/s connection nor on 100 mbt/s and things load in a splash in both ways.

@iliajie iliajie closed this as completed Oct 16, 2016
@iliajie
Copy link
Collaborator

iliajie commented Oct 29, 2016

Version 18.20 is out, please upgrade.

@iliajie
Copy link
Collaborator

iliajie commented Nov 18, 2016

Joe, hi.

I managed to remove CodeMirror from default load. It's now loading on demand. It was complicated to make UI look same nice. After some investigation, I managed to do both.

18.30 will have it optimised as well. Probably some other parts too for faster load and better user experience.

I ask you please, let me know how it feels, whenever it's out (beginning of December). I hope you will feel the difference.

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

No branches or pull requests

2 participants