[FEATURE] UI: Implement initialisation using new component mechanism#7969
Conversation
78d4d3f to
27d9233
Compare
27d9233 to
1811305
Compare
1811305 to
c1d0a1c
Compare
|
Please note the pipelines do not yet pass, since I need to amend some of the php unit tests. There are unit tests which initialise the UI framework entirely, which is not the best idea in general. If we decide to move forward with this PR, I will rewrite said unit tests and see that the pipelines pass. There are also 77(+) usages of |
c1d0a1c to
2e93f2a
Compare
|
Jour Fixe, 30 SEP 2024: Thibeau notified us about an upcoming workshop about the changes coming with the component revision. It takes place at 07 October, 13:00 to 14:30. |
2e93f2a to
3db20b1
Compare
|
The workshop has been rescheduled to 21. October from 13:00 to 14:30. |
3db20b1 to
14198b4
Compare
|
I have rebased onto the latest trunk and incorporated the new prompt and progress component families. |
|
@thibsy thanks for the changes in the language interface |
|
Jour Fixe, 11 NOV 2024: @thibsy asks all developers to have a final look on this PR as it should be merged next week. Please notify Thibeau if you object against the current suggestion. |
|
Hi @thibsy, thanks for the PR, I'm sure it will be very useful as a future reference for implementing the new dependency mechanism in other components. I'm not sure I understand the changes in |
|
Hi @schmitz-ilias, Thanks for looking into the PR. It looks like I have made a mistake here. I thought As to why this implementation is located outside of the framework: The component bootstrap mechanism provides a scheme of integration strategies, which e.g. let components define an interface of some service that must be implemented by another component. This is the case for the Kind regards, |
14198b4 to
f57768b
Compare
There was a problem hiding this comment.
Hi @thibsy,
thanks for the PR.
The changes in ...
- DataProtection
- TermsOfService
... look good to me.
Refinery:
- Please extract
$this->language->loadLanguageModule('validation');to a method (e.g.)loadLanguageModulesand move the loading of the "validation" language module to this method.
Authentication:
Please answer:
- Why does the "Authentication" component define a session-based key/value storage used by the UI framework? Because
ilSessionis a file in the "Authentication" component? Somehow this looks not right for me. This is not a hard "no" or "rejected", but when doing some quick research in component/bundle-based PHP frameworks, such implementations/strategies of a "Storage"-like interface are often located within the actual component (of which "Domain" ever, here "UI"), or put in into a separate "KeyValueStorage" component. Of courseilSessionis a k/v storage itself and astaticclass, so I could live with the proposed solution in this PR. But a "KeyValueStorage" folder (either as a separate component or within another component) would be my personal preference.
Best regards,
Michael
f57768b to
7c6b7fe
Compare
|
Hi @mjansenDatabay, Thanks for looking into this PR. I implemented the requested changes inside the I agree that Kind regards, |
757ced0 to
499208c
Compare
499208c to
a59b171
Compare
Hi @klees,
I have finished my work on the new UI framework initialisation!
In order to incorporate the UI framework initialisation, which uses the new component bootstrap mechanism, I needed to create some sort of bridge between these components and the legacy initialisation.
Let me summarise the relevant changes of this PR:
Init\AllModernComponents: In order to incorporate bootstrapped components into the legacy initialisation, or to create some kind of bridge between those two things, I had to introduce a newComponent\EntryPointwhich should be used instead of a direct call toilInitialisation::initILIAS(). This class basically maps bootstrapped components and populates them inside the legacy service locator$DICwith the same offsets as before. This is rather important, because ourDI\Containerand also lots of array-access-like usages will be made to these offsets throughout the code base. Btw, I think this adapter beautifully shows how ugly a service locator really is.Language\Language::loadLanguageModule()calls: I needed to move some of these method calls into other methods, because they were performed in the constructor. This is a bad idea in general, but in this specific scenario it led to issues, since functionality was required inside the bootstrap build process of components which have not been migrated and was therefore not available.Language\LanguageLegacyInitialisationAdapterandUICore\GlobalTemplateInitialisationAdapter: I needed to add some "legacy component" adapters in order to inject some implementation into bootstrapped components, of components which are not yet migrated. This needed to be done so functionality is kept alive at runtime, while keeping things compatible with the bootstrap build process.ILIAS\LegalDocuments\Setup\ConsumerObjective: I noticed that this objective was flaky, because it depended on theclass.ilInitialisation.phpfile to be loaded first. This file contained the initialisation of the global$DICoutside of the class declaration, so loading this file to check for interface implementations declared this variable as a side effect. (ping @mjansenDatabay)$provide, in order to support the legacy mechanism which lets plugins exchange them. We have already discussed that we should not support this mechanism in the future, but until then we needed to expose them.UI\Implementation\Renderer\Template::addInLoadCode(): I noticed this method had no usages, so I removed it to get rid of theilGlobalPageTempaltedependency there and hereby inUI\Implementation\Renderer\ilTemplateWrapperFactorytoo.Language\Languageinterface: I noticed the UI framework accesses methods of this service which have not been populated on the interface yet, I therefore added them. (ping @katringross)UICore\GlobalTemplateinterface: I added aUICore\GlobalTemplateinterface which we can use to type-hint the (legacy)ilGlobalPageTemplatelike we do with language.dependency_resolution.phpfiles to use the::classconstant of components, so renaming things will also affect these disambiguation files. (stumbled over this two, three times)Kind regards,
@thibsy