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

Resources from connections customizer are loaded multiple times #10

Open
vtobias opened this issue Jan 23, 2018 · 4 comments
Open

Resources from connections customizer are loaded multiple times #10

vtobias opened this issue Jan 23, 2018 · 4 comments

Comments

@vtobias
Copy link

vtobias commented Jan 23, 2018

Some resources from connections customizer are loaded multiple times. commonTools.js will be loaded three times if the current page includes three different customizations, as the configuration of each customization lists commonTools.js as dependency.

The issue can be produced in IE and Firefox and in both our tennants (200029520 and 200546718)

Please see attached screenshots.
issue2
issue1

@DanieleVistalli
Copy link

Hello, would you check if what you noticed also applies to the scenario I descriped in this other issue ? #8

With regard to multiple extensions loading the same script I think customizer is not performing "script-deduplication" so what we implemented in our scenarios is a sort of "fragmentation" of scripts so that there's no risk of scripts overlapping.

I'm now working on a more advanced loader of scripts which can manage:

  • Script load order
  • Dependencies / single-load of a script

@stefanopog
Copy link

THIS IS NOT an issue with Customizer itself. This is the way in which the GuestModel Customizer extension has been implemented. The script is loaded multiple times but this does not affect the results as the script understands not to execute if it has already been executed. In case this creates a problem I can suggest how to bypass this

@vtobias
Copy link
Author

vtobias commented Jan 25, 2018

@DanieleVistalli thank you! Could you provide instructions on how to use "script-deduplication" in customer's scenario? I am not familiar with this concept. Thank you!

@DanieleVistalli
Copy link

@vtobias given the details @stefanopog provided you're not going to have issues with the multiple script loading.

Anyway what I mean by "script-deduplication" is just a very hard work of figuring out where you need what and splitting the commonutils library to a specific extension that only loads once.

I'm now working (both actively and pretty hidden so far) on the Floyd extension for customizer that adds a lot of utility functions and services to customizer supporting stuff like:

  • Registry of loaded scripts
  • Load of external CSS and JS files
  • Extensions to the appregistry
  • Additional matchers that run client-side to decide if an extension needs to be loaded or not.

I'm not yet where I want to be but soon I'll push it out so that customizer gains a lot of additional flexibilty.

Performance-wise I read that Customizer is soon getting better support for resource caching so the multiple-script-loading won't even hit the network and the browser.

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

No branches or pull requests

3 participants