Addeded CHANGELOG-BS5.md file, updated MIGRATE-DEV-BS5.md and updated jQuery library

This commit is contained in:
Marc Farré 2024-10-01 10:32:05 +01:00
parent 1c1e88f953
commit 8ea5ee815a
3 changed files with 67 additions and 29 deletions

11
CHANGELOG-BS5.md Normal file
View File

@ -0,0 +1,11 @@
HumHub Changelog
================
Bootstrap 5 migration
------------
- Enh: Upgrade Bootstrap library (Bootstrap 3 v2.0.0 => Bootstrap 5 v2.0)
- Enh: Upgrade Select2 Bootstrap Theme (Bootstrap 3 v0.1.0-beta.4 => Bootstrap v5 1.3.0)
- Enh: Upgrade jQuery library (3.6.4 => 3.7.1)
- Enh: Add [scssphp library](https://github.com/scssphp/scssphp) allowing to compile SCSS to CSS with PHP
TODO: Add PR of `bs5` merge into `develop`

View File

@ -55,33 +55,6 @@ Module and Theme Migration Guide to Bootstrap 5
- `humhub\widgets\GlobalConfirmModal` use `humhub\widgets\modal\GlobalConfirmModal` instead
## LESS is replaced with SCSS
LESS format is not supported anymore.
Use SCSS instead. See https://getbootstrap.com/docs/5.3/customize/sass/
### Convert LESS to SCSS
Rename `less` folder to `scss` and rename all `.less` files to `.scss`.
Prefix all SCSS files with `_` except the `build.scss` file.
E.g.: `less/variables.less` -> `scss/_variables.scss`
Un can use the following tool to convert LESS to SCSS: https://less2scss.awk5.com/
However, you need to check the output manually.
### Variables
- `$default` is deprecated. Use `$light` or `$secondary` instead.
- New variables: `$secondary`, `$light` and `$dark`
In all SCSS files except `_variables.scss`, replace all SCSS variables with CSS variables.
E.g.: `color: $primary` -> `color: var(--primary)`
### Select2 stylesheet
`static/css/select2Theme` folder has been removed, and the SCSS file moved and renamed to `static/scss/_select2.scss`
## Bootstrap widgets
Name spaces starting with `yii\bootstrap` are now `yii\bootstrap5` (a compatibility layer is provided, but will be removed in the future).
@ -209,6 +182,60 @@ Replacements:
Doc: https://getbootstrap.com/docs/5.3/utilities/flex/#media-object
## Themes and Modules: LESS is replaced with SCSS
LESS format is not supported anymore.
Use SCSS instead. See https://getbootstrap.com/docs/5.3/customize/sass/
### Convert LESS to SCSS
Rename `less` folder to `scss` and rename all `.less` files to `.scss`.
Prefix all SCSS files with `_` except the `build.scss` file.
E.g.: `less/variables.less` -> `scss/_variables.scss`
Un can use the following tool to convert LESS to SCSS: https://less2scss.awk5.com/
However, you need to check the output manually.
### Variables
- `$default` is deprecated. Use `$light` or `$secondary` instead.
- New variables: `$secondary`, `$light` and `$dark`
In all SCSS files except `_variables.scss`, replace all SCSS variables with CSS variables.
E.g.: `color: $primary` -> `color: var(--primary)`
### Select2 stylesheet
`static/css/select2Theme` folder has been removed, and the SCSS file moved and renamed to `static/scss/_select2.scss`
## Themes
### Build file
The `build.scss` file mustn't import parent theme files anymore, as it is automatically done by the new compiler.
Take example with the `HumHub` community theme.
### Compiler
Grunt compiler has been removed.
Instead, compile your theme online, using the new "(Re)build Theme CSS" button in Administration -> Settings -> Appearance.
If you use the "Updater", you don't need anymore to recompile your theme CSS after updating HumHub core, as it will be done automatically.
But if you upgrade HumHub without this module, you will have to click on the "(Re)build Theme CSS" button after each HumHub core upgrade.
### Overwritten view files
Most of the views have been refactored to use the new Bootstrap 5 HTML tags and classes.
Please review all overwritten view files. See https://community.humhub.com/s/theming-appearance/wiki/134/Migration%3A+Identify+Template+Changes+ for more information.
The most important change concerns the `protected/humhub/views/layouts/main.php` file, which has been refactored with bs5 flex logic (instead of floating right elements).
## Documentation
- BS3 to BS4: https://getbootstrap.com/docs/4.6/migration/ and https://www.yiiframework.com/wiki/2556/yii2-upgrading-to-bootstrap-4

View File

@ -44,14 +44,14 @@
"npm-asset/imagesloaded": "^5.0",
"npm-asset/intersection-observer": "^0.7.0",
"npm-asset/jplayer": "^2.9",
"npm-asset/jquery": "~3.6.3",
"npm-asset/jquery": "~3.7.1",
"npm-asset/jquery-autosize": "^1.0",
"npm-asset/jquery-knob": "^1.2",
"npm-asset/jquery-ui": "^1.13.2",
"npm-asset/jquery.cookie": "^1.4.1",
"npm-asset/kbw.timeentry": "^2.0",
"npm-asset/nprogress": "^0.2",
"npm-asset/select2": "^4.0.4",
"npm-asset/select2": "^4.0.13",
"apalfrey/select2-bootstrap-5-theme": "^1.3.0",
"npm-asset/socket.io-client": "^2.0",
"npm-asset/swiped-events": "^1.0.9",