-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
refactor(vue): optimize reactivity handling and reduce bundle size #929
Conversation
Thanks for your contribution @negezor.
Thanks. Makes sense 👍.
I'm not following here. Options and plugins should be reactive. Whenever options or plugins change, the carousel should re-initialize. Or am I misunderstanding what you mean by this?
Thanks! |
Options and plugins will be reactive. We don't just need to store them in a reactive variable, because we only listen for changes to the passed arguments. |
@negezor thanks for clarifying. I think this is a nice refactor of the Vue wrapper so great work 👍🏻. Have you tested the wrapper with your changes? @meirroth and/or @sadeghbarati would you like to skim the code and add anything? |
@davidjerleke yes. I used the fork of version 8.1.5 with these changes on my stage, as well as later on in production. |
Using |
Looks good, thanks 👍 |
Just tag me here when this is approved @meirroth and @sadeghbarati. Thanks 🙏🏻. |
@davidjerleke done 😄 |
Thanks everyone for your improvements/contributions and taking time to review this PR 🎉. I will merge it soon. I’ll make sure to drop a comment here when it has been released in |
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.
Looks good 👍 Tested in my project and works fine.
Will be included in the |
@negezor, @sadeghbarati, @meirroth these improvements were just included in the v8.1.7 release. |
Hello, I accidentally came across your module and, after looking at the source code, I really liked it. I would like to thank you for it.
While examining the Vue implementation, I noticed a few areas for improvement. Here is the list:
shallowRef
instead ofref
. It is standard practice to use it forHTMLElement
and heavy objects that do not require reactivity. We just need to observe the value setting in this case.storedOptions
andstoredPlugins
that do not need reactivity. After all, we only addwatch
forRef
objects.isRef
once and remove unnecessary accesses to.value
.