-
Notifications
You must be signed in to change notification settings - Fork 173
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
fix: convert useComputedClass to defineClass #725
Conversation
✅ Deploy Preview for oruga-documentation-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #725 +/- ##
===========================================
+ Coverage 52.12% 54.62% +2.49%
===========================================
Files 32 32
Lines 1385 1461 +76
Branches 512 519 +7
===========================================
+ Hits 722 798 +76
Misses 663 663
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… into bug/computed_class
Hello! Thank you for fixing this error. I wanted to ask if there is a temporary way to ignore this error until you finish fixing it. I am using a dropdown that works perfectly for my use but when changing the size of the window this error pops up on the screen. I just close it and everything and its ok. Is there a way to prevent the error from poping up on the screen temporarily? Thanks you very much! :) |
@darioillusorium Don't use Vue 3.4, use Vue 3.3.x. However, you can also use Oruga 0.7, which is based on the Options API and could work with the latest Vue version. As of 0.8, we have refactored the components to the Composition API, which contains this bug with Vue 3.4. |
When next release with this fix? |
@l00k I don't want to make any date prediction, but I will try to do it this month - be aware that Oruga is a side project and nobody is working full time on it! |
I just thought fix (as independent thing) could be pushed without waiting for other bugfixes or improves. My project which uses oruga is also side thing :) so.. yea |
Fixes #709
Currently, each time a computed is triggered, the
useComputedClass
composable is triggered for each component class. This causes thegetCurrentInstance()
method to be called during thecomputed
hook.I created a new composable called
defineClasses
which will replace the computed component classes and return a reactiveref
value. This way thegetCurrentInstance()
method got only triggered once synchronous during setup. The class is calculated synchronous during setup too and every time thesuffix
is changed by a watcher. Another watcher is used to change the apply state of the class if given. However, this doesn't require the class to be recalculated.This also improves the update time of a computed class, because before, whenever any property or ref value was used to compute the class got updated, the computation for each class calculation used in the computed const got triggered. Now, whenever a property changes, only the relevant class calculation is triggered.
For each component, the "Computed Component Classes" section must be refactored to use the new feature. No component logic or template should be touched.
Proposed Changes
useComputedClass
todefineClasses