The default template has been upgraded to a major version along with the front-end framework, what styles and scripts in the site need to be changed?
The default template has been upgraded to a major version along with the front-end framework, what styles and scripts in the site need to be changed? The changes will not stop at the version number. Two typical actions can be seen in the update records publicly released by PbootCMS: the front-end default template's style framework Bootstrap has been upgraded to 5.3.8, and the two dependencies Popper and datetimepicker have been removed.The jQuery from backend to frontend has been upgraded from 1.12.4 to 3.7.1, and an additional correction has been made to the display of the content status checkbox under the interface component library.For sites that have already modified the template, these three places are exactly the scope of regression to cover.
The first place is the class name and component structure
The most common point of destruction in a major version upgrade is naming and structure: the framework replaces a batch of class names and changes the necessary nesting levels of some components, and the style will appear in the form of 'partial misalignment' rather than the whole page collapsing. After the upgrade, pages to be opened item by item include list pages, detail pages, form pages and pagination controls, among which forms and pagination are most likely to be misaligned due to structural changes.
The basis of judgment is not that the page looks okay, but whether the rules using framework class names as selectors in the custom style can still hit. If there is a direct dependency on old class names in the self-built theme, this step should first change the selector before discussing visual fine-tuning.
The second place is the removed dependency library
Remove dependencies is the largest information line in the upgrade record. Taking the date selection control as an example, the old writing method is usually to introduce an independent plugin and add a piece of initialization code; after the framework's large version comes with native controls, both of these need to be changed accordingly, otherwise, the page will appear with two kinds of performance such as 'control does not pop up' or 'pop up two layers'. The same is true for components such as cascading selection, dropdown, and modal boxes that require positioning support. After the dependency relationship is merged, the original order of introduction may become a source of conflict.
The action inside the station is to search for all locations where libraries have been removed, and confirm individually whether to use the framework's native capability or supplement with a control. This step should not omit the search, as references in the template are often scattered across individual pages.
The third place is the behavioral difference across script library versions.
The upgrade of the script library does not bring new interfaces, but the invalidation of old syntax. The removed are usually the abandoned branch syntax and event binding forms. If there is such usage in the custom script, the page performance is 'partial interaction failure'. At the same time, the update record also fixed the display of a checkbox under an interface component, indicating that even if the main function is fine, the style differences at the component level should be checked separately.
It is also worth noting the phrase 'Fixing security vulnerabilities in the old version' in the upgrade reason. Upgrading the script library across versions is also a security maintenance action, and delaying it to 'Style changes' will keep the old version in the foreground of the site.
How do custom templates accommodate this kind of upgrade?
The site modified from the default template, directly covering the update will lose your own changes, the correct order is three steps: first, make a backup of the current template and static resources, AnQiCMS's backup capability supports taking data along with static files; then, compare the differences between the old and new templates, and list the changes separately according to the three categories of 'class name replacement, dependency removal, and initialization rewriting'; finally, use the visual template editor to confirm the changes page by page to ensure that the changes can take effect on the site.
It is recommended to write the checklist according to the control rather than the page: A page may involve three types of controls, such as cascading, date, and checkbox, and going through the controls one by one is less likely to be missed. Update the front-end resource cache after passing all, to avoid the old style files from being hit.
Common questions
Question: If only the title and color are changed, do you also need to follow the template for a major version rollback?Answer: Yes. Few changes do not mean fewer components referenced. The date, dropdown, and carousel scripts in the title area will also be affected by the framework version.
Question: Can I only upgrade the style without upgrading the script library?Answer: It is possible to separate them for a short period of time, but script libraries across versions usually have security fixes at the same time, and staying on old versions for a long time will leave risks on the front page.
Question: After modification, the performance is sometimes good and sometimes bad, what should be checked first?Answer: First check if there are any old dependencies being introduced with the new framework, and then check if the static resource cache still hits the old files, both of these problems will manifest as random failure.