-
-
Notifications
You must be signed in to change notification settings - Fork 231
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: use generator function for generic worker, computeds in stores, simplifications #2525
Merged
+1,160
−1,362
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cloudflare Pages deployment
|
ferferga
force-pushed
the
improve-generic-worker
branch
from
December 6, 2024 09:47
15dc971
to
f285dc1
Compare
ferferga
force-pushed
the
improve-generic-worker
branch
from
December 6, 2024 09:49
f285dc1
to
46a43e5
Compare
This spawns the worker only when needed, avoiding the extra memory usage of keeping it running all the time Also properly release the worker in JVirtual Signed-off-by: Fernando Fernández <[email protected]>
ferferga
force-pushed
the
improve-generic-worker
branch
from
December 27, 2024 14:18
46a43e5
to
a58c6a8
Compare
Initially, when we were migrating to Vue 3, `value` was really annoying to work with. However, as time has passed by, using `value` provided a clear advantage over reactive: It was clear when a value was reactive, when without it, it was not. Also, using TypeScript getters meant we had to do some dirty workarounds (like verify in watchers if the id of the item currently playing was the same after the current one after shuffling). With computed, we can use the `previous` argument of the callback and everything should be more performant (since everything is cached and recalculated only on dependency changes, instead of on every access) We could also refactor some properties to use VueUse's computedAsync ( like `currentPlaybackInfo` in `playbackManager`) and keep everything consistent (so we don't end up with a mixed usage of computed and getters)
Also took some tips from https://www.totaltypescript.com/tsconfig-cheat-sheet Not implemented any of the options mentioned, but also it's worth looking to https://www.totaltypescript.com/typescript-is-coming-to-node-23 to prepare for future Node native TypeScript support. Signed-off-by: Fernando Fernández <[email protected]>
This greatly simplifies the timing of the cleanups performed when the current user logs out of the application Signed-off-by: Fernando Fernández <[email protected]>
ferferga
force-pushed
the
improve-generic-worker
branch
from
December 29, 2024 02:20
a58c6a8
to
e6f5a06
Compare
Quality Gate passedIssues Measures |
ferferga
changed the title
refactor: use generator function for generic worker
refactor: use generator function for generic worker, computeds in stores, simplifications
Dec 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This spawns the worker only when needed, avoiding the extra memory usage of keeping it running all the time
Also properly release the worker in JVirtual
TODO: Playback manager doesn't shuffle correctly with thisGiven the shuffling issue that was going on due to a race condition between the currentPlaybackUrl and the currentItem in playbackManager, I took the plunge to also do a refactor I was looking forward to do since some long time. Every commit has detailed explanations.