In an effort to better organize commonly used functions within the UIkit base theme, we will be moving functions to class methods. This will allow us to better organize code. This issue will track these changes so users can stay informed. The functions being replaced will be marked as deprecated for clarity in API parsing and IDE's who supported code completion and hints.
Commit 32fe492 on 7.x-2.x is the first commit in this plan. We may create separate classes as the needs arise, but for now all methods will be contained in the UIkit
class in the \Drupal\uikit\UIkit
namespace.
Please be advised: Once this plan is fully implemented and we are ready to completely remove all functions being replaced by class methods, the X Autoload module will be required in order for the UIkit base theme to work properly. We'll be adding a warning message to the theme settings page to inform users of this requirement so they have time to update their Drupal installations. Otherwise users will receive the WSOD!
Comments
Comment #2
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedDeprecated tags have been added to the functions being converted to class methods. The second commit made a correction to which method is replacing
uikit_get_active_path()
.Commit 867cc8c on 7.x-2.x
Commit 1fcc805 on 7.x-2.x
Comment #3
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedComment #4
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedConverted functions to class methods in 7.x-3.x. Will be pushing the X Autoload requirement on the 7.x-3.x branch sooner, planned for the 7.x-3.0-beta7 release.
Commit 2d6c6ba on 7.x-3.x
Comment #5
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedRemoved deprecated functions and replaced with UIkit class methods in 7.x-2.x. The X Autoload module will now be required for the 7.x-2.x-dev branch and the next stable release, 7.x-2.9.
Also replaced the
uikit_load_include()
function with\Drupal\uikit\UIkit::loadIncludeFile()
.uikit_load_include()
is now deprecated and will be removed before the 7.x-2.12 release.Commit cf5e45d on 7.x-2.x
Comment #6
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedApplied the same changes in comment #5, this time on the 7.x-3.x-dev branch.
Commit 440b377 on 7.x-3.x
Comment #7
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedAdded a change record for the X Autoload module requirement. #2916345: X Autoload module is now required
Comment #8
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedSince #474684: Allow themes to declare dependencies on modules still needs work and will also need a backport to Drupal 7, we are removing the X Autoload module requirement from UIkit 7.x-x.x.
We will continue to move functions to class methods outlined in this plan without the need for the X Autoload module. X Autoload made loading UIkit's namespaces easier, but we came across many WSOD when testing installations without the X Autoload module enabled.
Comment #9
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedClosing due to stable move of functions to class methods. Future issues with the UIkit class should be reported by creating a new issue.