-
Notifications
You must be signed in to change notification settings - Fork 738
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
Use consistent KDS imports across the whole Kolibri #11561
Comments
This issues is to target the |
I would like to work on this issue. |
Hi @ShivangRawat30, thank you, I'm assigning you. Good luck and let us know if you needed anything. |
I think maybe we should consider strongly replacing all uses of vendored code with KDS components directly. This would be a substantial amount of work, however, so could be created as a separate issue to be dealt with down the road as it would involve updating many places in Kolibri to import/use a new component. |
@nucleogenesis Yes, definitely. Even though I used vendored components as an example, this issue is more general and includes imports of regular KDS components as well. You can find cases where the same logic is imported in two different ways. |
@nucleogenesis And we'll be most likely tweaking location of composables one way or another too and those are regular KDS paths. So this will help in that case as well. |
@nucleogenesis I'm more than up to to not be reaching to vendored files directly eventually. Not sure what was the motivation for that. |
@MisRob If No One is working on this issue anymore can i work on it ?? Please assign it to me and let me know. Thank You |
Hi @ShivangRawat30 are you still working on this issue? If there is anything we can help you with, let us know. |
@AlexVelezLl @MisRob Could you please provide Slack Channel link where i can discuss GSOC related queries ? |
Hi @PR4NJ41! Sorry, we don't have a slack channel for GSoC 2024 yet, but please stay tuned for when we have everything ready =). In the meantime, you can open new GH Discussions or use this discussion for anything related to Kolibri. |
@AlexVelezLl I am currently working on an other issue, you can assign the issue to someone else in the mean time. |
Thanks @ShivangRawat30! @PR4NJ41 I just assigned it to you 🙌 |
@AlexVelezLl Thanks for assigning me the issue. Just to confirm, i have to work on the |
Hi @PR4NJ41! yes, you should work on they develop branch. |
Hi @AlexVelezLl, I found 2 components named UiToolbar
The 1st one was already present in what should i do with the 2nd one? |
This is in
This is the other file.
|
Hi @PR4NJ41. Could you try replacing the places where the UiToolbar from If they are incompatible, let's leave the |
Hi @AlexVelezLl, I replaced it. @MisRob @AlexVelezLl I raised a PR please review it. Thank you |
Sorry, I totally missed the content of this issue. This is entirely the wrong direction of travel, and we should be removing references to KDS in the core API spec, not adding them. If import paths update in KDS that is a breaking change that should be documented, and then can quickly be addressed in the upgrade in Kolibri with a global find replace. Apologies for the delay here, but I think I had seen the title and assumed it was about switching to direct imports from KDS and not this away around. |
@rtibbles So do i have to remove Kolibri.coreVue.. used in files ? |
Also, I ran |
Ok, Thank You. I will try to fix other issues. |
please notify when you create a slack channel @AlexVelezLl |
@rtibbles My main concern is consistency and am not very opinionated which direction we choose. This issue is a result of discussion with @AlexVelezLl during one of the reviews, where he mentioned that using core can prevent from replacing many imports in case we change them in KDS. I though that was a good argument and therefore leaned towards that direction. However at that time, I didn't know of #5488 and the current organization seemed to indicate that it's a common practice to put KDS components to core. I assume that #5488 is the main reason you suggest taking the opposite approach? If that's so, I think it makes sense. |
Yes, when I saw the title of the issue I had assumed it was just consistently not using the core imports, rather than the other way around! #5488 is a response to the tendency towards extreme bloating of the core API that we have seen - KDS imports are a little bit different, inasmuch as we do bundle all of the KComponents into the core through the use of the plugin and global registration, but just importing directly from KDS means that we don't have to maintain as much in the core API, and can be easily updated with a find and replace, even if import paths change. |
I have updated the issue to reflect the opposite direction here. @PR4NJ41, please feel free to resume this work if you are able! |
If we are using the 2nd approach then do i have to remove all imports which are using "kolibri.coreVue" or only certain ones. |
Directly, so any imports for modules that we could import directly from KDS should be imported directly from KDS. Note that there are lots of other "kolibri.coreVue" imports that are not for KDS imports, so you can leave these as they are. |
I would like to help with this issue. |
@vaibhav-rm I am already working on this |
Okie, Let me know If I could be of any help. Good luck. |
Thank you @PR4NJ41, we appreciate your flexibility and patience |
I'm sorry @Abhinav1148, but this has been already resolved here #11742 and will soon be merged. Please always check if there's already an asignee in an issue. If yes, than it's already taken. If no, send us a message a first and wait until we assign you. |
I'm sorry @MisRob for this mistake, I'll take care of that from now onwards. |
No problem, I feel sorry this was your first experience! I just posted more information to your pull request :) |
Fixed in #11742 |
There are currently two ways we import KDS (Kolibri Design System) logic (e.g. a component, a mixin, a composable) to Kolibri:
(1) Via
kolibri.coreVue
First, a piece of KDS logic, in this example
UiIconButton
, is imported fromkolibri-design-system
and registered in apiSpec.jskolibri/kolibri/core/assets/src/core-app/apiSpec.js
Line 22 in 4de6c2f
kolibri/kolibri/core/assets/src/core-app/apiSpec.js
Line 192 in 4de6c2f
This makes it available in the whole Kolibri for import from
kolibri.coreVue
:kolibri/kolibri/plugins/learn/assets/src/views/QuizRenderer/index.vue
Line 160 in 4de6c2f
(2) Directly
The other approach imports a piece of KDS logic, in this example
UiAlert
, to a Kolibri component directly from thekolibri-design-system
package:kolibri/kolibri/plugins/learn/assets/src/views/QuizRenderer/index.vue
Line 159 in 4de6c2f
Goal
The goal of this issue is to use approach (2) everywhere. Using direct imports from KDS will ensure consistency and make it clear where code is being imported from.
Acceptance criteria
coreVue
imports for KDS are replaced by direct imports in all Kolibri filesapiSpec.js
Out of scope
Note that we also use direct KDS styles imports, for example
@import '~kolibri-design-system/lib/styles/definitions';
. Dealing with these Sass imports is not in the scope of this issue and they can stay as are.Guidance
kolibri.coreVue
importsapiSpec.js
, remove it.coreVue
import with the direct importThe text was updated successfully, but these errors were encountered: