-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
chore: more cleanup #1884
chore: more cleanup #1884
Conversation
aea98f4
to
ff4292f
Compare
ff4292f
to
f876c1c
Compare
f876c1c
to
5494cf7
Compare
5494cf7
to
bfc5182
Compare
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.
I'm not a fan at all of the changes to the data interface - to me, it seems like another way to remove as
just for the sake of it. In your other PR I didn't mind it in the metadata pages because the fixes in the page were good and it was a nitpick really. However, modifying files purposefully just for this is, in my opinion, "polluting" the commit history (I'm more concerned about the quality and usefulness of our commits since our repo starting getting bigger and bigger and it's no longer a 1 second to clone 😣) without any real improvement, when the real improvement would've been to directly migrate all those files to Composition API.
I'd love to keep the rest of the runtime checks/handles you added, but please also take the extra step (which I know is cumbersome and annoying at times) to migrate them to Composition API 🙏.
frontend/src/components/Layout/Carousel/CarouselProgressBar.vue
Outdated
Show resolved
Hide resolved
frontend/src/components/Layout/Carousel/Item/ItemsCarouselTitle.vue
Outdated
Show resolved
Hide resolved
@aweebs By the way, as mentioned here, you can chat with us in Matrix if you want to get quick replies to your questions and in a more informal way We're bad at doing detailed roadmaps or in publicily document our preferences and conventions (for commits, for instance) because we get all of them resolved in chat (between @ThibaultNocchi and me) and right now we want to get stuff done instead of focusing in proper documentation (which is also much less appealing to work in :P). In the meantime, hopefully we can have you around in Matrix so you don't end up doing extra work that could have been saved with a question in chat beforehand :P |
I'm conflicted about this. I think these Data interface changes do represent some amount of progress since they help with type safety, but agree that they're not significant at the moment. There's 15 components that were updated, and making the full transition to the Composition API will take me a while, but I'm happy to continue forward on that path as separate tasks/PRs.
I'll definitely join the Matrix chat, thanks for pointing that out! |
bfc5182
to
f2da705
Compare
They don't. The rest of the changes in some of those files (because even not all of the files are modified beyond the Data interface, like And yes, I know the repo will grow, the point is not that, but the fact that the commits are as relevant as possible. And, as said before, the interface approach is sbjectively relevant, while Composition API is objectively relevant with not much more effort. When you do a git blame, you must go commit by commit. Going commit by commit takes time, and takes more time if you have even more commits. Style commits for instance are not useful at all when debugging, but commits where a file was migrated to Composition API is 100x times more useful. I'm sorry, but this is a hard no for me. We've been carrying some technical debt issues specifically because of lazy commits and workarounds that "we can change/refactor in future PRs" (and I'm the first culprit of doing that) and we end up completely forgetting or abandoning. The metadata editing section and library view, as you saw, require heavy refactoring just for this sole reason, in my opinion. Bigger stuff of course will still be affected and will require revisits in the future and multiple PRs. But I'd like to get PRs merged in the best possible state within a reasonable scope (that's also why vite is taking so long to get merged, because I could've started working in master directly and leave the client broken for a lot of time). It's true the LoC for this PR will get much bigger with the migration, but I don't mind reviewing them here if you don't want the extra hassle. However, if you prefer another PR, just cherrypick the data interface commit to another branch and start migrating those modified components to Composition API and amend the name afterwards. You can also do it in different commits when the scope of those components is different so, as said above, the git blame is more useful. TL:DR: The Data interface is just a subjective middle-ground for improvements in DX when a migration to Composition API is the real deal and this just seems a lazy (with all due respects, because I know finding all the occurences of as takes some time) approach. |
f2da705
to
cc6ae25
Compare
@ferferga I've removed the Data interface change commit, as well as the commit for deleting |
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.
As some files are conflicting with the implement video playback PR (#1878) and #1889, if you don't mind, I'm going to progressively cherry-pick commits that I'm sure that don't conflict with those, then merge those PRs, and then fix the conflicts of the remaining commits from this PR.
But here you have the greencheck of your changes :)
cc6ae25
to
1153e4c
Compare
1153e4c
to
3c413a1
Compare
0956c78
to
9ff41f2
Compare
|
||
res.push(fetched); | ||
public add = (item: BaseItemDto): BaseItemDto => { | ||
// Without an id this cannot be cached so return a non-reactive version |
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.
This change is necessary since calls like getting devices or apikeys also end up coming through this function, see my comment in axios/index
, but they won't have a valid Id, and this was previously breaking those calls. Now if there no id the non-reactive value is still returned without being cached so those calls will continue working.
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.
@aweebs I like your fallback when the item doesn't have an id.
About the axios interceptor, ideally we should strictly check for everything before calling this method in the interceptor. Previously in the item store we had all the API methods (some, not all of them), which was a maintenance burden. The interceptor-way of working was a middle-ground I came up with to ease the maintenance burden, however it didn't end up working because the Vue 2 limitations.
Just saying all of this if you want to take another challenge :): Investigate all the endpoints that returns BaseItemDto or BaseItemPerson and filter them properly.
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.
I'll add it to my list of things to work on :)
I also added a fairly descriptive TODO to the interceptor so that anyone else who comes across it is also aware of the limitations and that there is work to be done there.
9ff41f2
to
c0e8494
Compare
…ed components Comments have a common base message so that all of these are easily searchable.
This was necessary to prevent breaking calls to get things like api keys
c0e8494
to
810895c
Compare
Kudos, SonarCloud Quality Gate passed! |
Cloudflare Pages deployment
|
Some more cleanup commits stacked on each other.
Goals that this PR builds towards:
@ts-expect-error
exceptions - these can be avoided by typecasting where necessary. It's less safe to completely ignore any static compiling error on a line than to resolve an error with a typecast. Linting rule coming in future PR.as
casts - linting rule incoming in later PR once these are all removed.typecheck
script runs successfullyRecommend reviewing the changes commit by commit