Skip to content
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

Add deprecation notices to the Upgrade guide #6426

Merged
merged 7 commits into from
Oct 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,124 @@ The `react/jsx-key` rule has been enabled in ESlint for catching missing `key` i
You might catch some violations in your project or add-on code after running ESlint.
Adding the missing `key` property whenever the violation is reported will fix it.

### Deprecation notices for Volto 18

#### `@plone/generator-volto`

```{deprecated} Volto 18.0.0
```

The Node.js-based Volto project boilerplate generator is deprecated from Volto 18 onwards.
Although you can still migrate your project to Volto 18 using this boilerplate, is recommended that you migrate to use [Cookieplone](https://github.com/plone/cookieplone).
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
After the release of Volto 18, it will be marked as deprecated, archived, and it won't receive any further updates.

##### Alternative

Migrate your project to use a [Cookieplone](https://github.com/plone/cookieplone) boilerplate.

#### Volto project configurations

```{deprecated} Volto 18.0.0
```

It's been a while that you can configure Volto using an add-on.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
The "project" way, so you configure Volto using `src/config.js` in your project is deprecated and will be removed in Volto 19.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

https://github.com/plone/volto/issues/6396
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

##### Alternative

It's recommended and hevily encouraged that you do all your project configuration in a policy add-on.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
You can move your project to use [Cookieplone](https://github.com/plone/cookieplone) which provide the necessary boilerplate for it.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

#### SemanticUI
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

```{deprecated} Volto 18.0.0
```

SemanticUI library is not maintained anymore and will be removed in Plone 7.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Any usage in add-ons and projects is discouraged and not recommended.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

Related PLIPs:
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

- https://github.com/plone/volto/issues/6321
- https://github.com/plone/volto/issues/6323
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
##### Alternatives

Use any supported component framework of your choice for implementing new components, specially in the public theme side.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
In the case that you create new widgets or components for use them in the CMSUI (non-public side) it is recommended that you use [`@plone/components`](https://github.com/plone/volto/tree/main/packages/components) library as an alternative, although it's still in development phase and has still to be finished in the next months.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

#### `lodash` library

```{deprecated} Volto 18.0.0
```

`lodash` has not received any updates since 2021 which makes it kind of concerning too in terms of future maintainability.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Lots of `lodash` utility helpers can be replaced nowadays by vanilla ES. It is decided that will be removed from Plone 7 since it has performance issues (bloated bundles) and it's not prepared for ESM.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Plone 7 will use the `lodash-es` library (ESM ready) instead and it will be replaced by modern vanilla ES alternatives whenever possible.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

##### Alternatives

The usage of `lodash` is becoming not necessary, since over time vanilla JS/ES features has make them obsolete.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Take a look at this URL to check if you have better alternatives every time that you want to use `lodash`:
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
https://javascript.plainenglish.io/you-dont-need-lodash-how-i-gave-up-lodash-693c8b96a07c
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

If you still need some of its utilities you can use `lodash-es` instead.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

#### `@loadable/component` and Volto `Loadables` framework

```{deprecated} Volto 18.0.0
```

`@loadable/component` and Volto `Loadables` framework will be removed from Plone 7 because it's a Webpack only library and it does not have Vite plugin support.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Overall, from React 18 this library is not necessary since it has the initial implementation of the "concurrent mode".
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
React 19 will improve even add more the features around it.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

##### Alternatives

The recommendation is to use plain React 18 lazy load features and its idiom for lazy load components.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

```jsx
const myLazyComponent = lazy(()=> import('@plone/volto/components/theme/MyLazyComponent/MyLazyComponent'))

const RandomComponent = (props) => (
<React.Suspense>
<MyLazyComponent />
</React.Suspense>
)
```

There's no support for pre-loading or lazy load entire libraries as in `@loadable/component` but there would not be really necessary anymore, once we get rid of all the barrel imports files (see next deprecation).
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

#### Removal of all existing main barrel imports files (`src/components/index.js`, `src/helpers/index.js`, `src/actions/index.js`)
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

```{deprecated} Volto 18.0.0
```

Volto had this barrel imports (centralized files where other imports are re-exported in order to improve the developer user experience since the developer only has to remember to import from the re-exported place, not the full path).
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
It became a bad practice, since bundlers rely on the import pathway in order to determine if bundle code together or not.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
Since the barrel imports direct import all the code, a lot of imports ended up in the same main chunk of code.
stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
Modern bundlers like Vite also use that technique, so it heavily relies on this.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, what? Vite relies on barrel imports, or some other technique? Can you clarify?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nono, Vite knows where to place the module imported (chunks) relying on the imports. So, it works better without barrel import files.

stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
We have to remove the barrel imports in order to increase the natural number of chunks that Volto divides on (specially on routes), and the code splitting is done the right and natural way.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

This will force us to rewrite all the imports everywhere (core, projects and add-ons) once we implement it.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

##### Alternative

We can start implementing only direct imports in our code right away, preparing for the upcoming change, so we don't have to in the future.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved

```diff
-import { BodyClass } from '@plone/volto/helpers';
+import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
```

Once this is implemented, a codemod will be provided to fulfill a smooth migration.
sneridagh marked this conversation as resolved.
Show resolved Hide resolved


(volto-upgrade-guide-17.x.x)=

## Upgrading to Volto 17.x.x
Expand Down
Loading