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
[Vue] add support for on demand loading of plugin UMD files when a component in a plugin is first used. #18980
Conversation
…ponent in a plugin is first used.
Adding this to the current milestone, but I'm not sure when it is desired to include it. |
af9cf74
to
27d6e8a
Compare
ac56348
to
722cba1
Compare
bb540c6
to
c602aa7
Compare
This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers |
@diosmosis would you mind rebasing that one to 5.x-dev? We've decided not to put that into the last 4.x release to lower the risk of regressions we might need to fix. Also we will have more time to test that, after it was merge to 5.x-dev... |
…r plugin existence in vue-entry processing to use it
e6d210e
to
c60c6ce
Compare
@sgiehl should be up to date w/ 5.x-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it with the TagManager PR and seems to work smoothly. Left a comment. Otherwise I guess this should be good to merge.
…into vue-async-umd-loading
fixed |
@diosmosis Could you check the failing UI tests? Seems the language selection is no longer visible in installation and updater. Seems there is a javascript error in that case. |
@sgiehl fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now and tests are also passing again
…mponent in a plugin is first used. (#18980) * Proof of concept for on demand loading of plugin UMD files when a component in a plugin is first used. * add more comments * debug ui test failure * more debugging * even more debugging * try again? * more debugging * more debugging * more fixes * more debugging * fix path * more debugging * fix path again, more debugging * try this again * try this again * try this again * another debug attempt * more debugging * another attempt * more debugging * more debugging * more debugging * more debugging * more debugging * more debugging * more debugging * more debugging * try to fix issue * undo debugging changes * fix last fix * add integration tests for new functionality * revert changes to FrontController which should not have been added to PR * Login always loaded * put list of plugins to load on demand client side and modify check for plugin existence in vue-entry processing to use it * remove unneeded interim event * handle case where pluginsToLoadOnDemand is not set as global Co-authored-by: sgiehl <stefan@matomo.org>
Description:
This PR provides on demand loading of a plugin's Vue module, so it does not have to be loaded on each page load.
To set a plugin's Vue module to be loaded on demand you'd have to:
{ plugin: 'MyPluginName', component: 'MyComponentName' }
.If you need to use a plugin that's loaded like this in another plugin, you won't be able to import as you would normally. Instead you'll need to use the
importPluginUmd
method:Note: that adapters for stores or anything that gets added via angular(...).adapter will not be available, so making a plugin load on demand is a potential BC break. For TagManager this is acceptable since the old models weren't meant to be reused.
To see a plugin that uses this, see: matomo-org/tag-manager#461
Review