-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Remove any usage of barrel files from core #6507
Comments
We shouldn't close this PLIP until the barrel files are actually removed in Plone 7, right? |
@davisagli this was opened after a brief discussion at the conf and @sneridagh and I just thought about a first step to remove the usage of those files without actually removing the files. When I wrote the PLIP I just had this in mind but maybe did not clarify that properly here, so it's fine for me to close this. On the other hand, though, the actual removal of the files and/or any upgrade needed with it should also have a PLIP and I'm not sure there is one at this time. |
@pnicolli I updated the Deliverables section to make it clear what was already done for Plone 6.1 and what needs to be done for Plone 7. |
@ichim-david I added in the description the pointer to the initial codemod script that I've been using in the Vite PR: |
PLIP (Plone Improvement Proposal)
This is a first step for #5419 and for deprecating the usage of barrel files entirely. Eventually, those files should be removed in Plone 7.
Responsible Persons
Proposer: @pnicolli
Seconder: @sneridagh
Abstract
Barrel files create issues in code splitting and bundling, especially because we currently use an older bundler, but even modern bundlers have a hard time with those. Several articles and examples can be found online
Motivation
Solving this issue is mandatory to improve performance and eventually it is already decided that those files should not exist in Plone 7.
Assumptions
Volto 18 should have the files for backwards compatibility, the usage of those should just be avoided.
Proposal & Implementation
Update every import in core volto. Add a eslint rule that raises a warning for each import from barrel files. Update the docs to reflect this choice and guide the migration.
Deliverables
for Plone 6.1 / Volto 18:
for Plone 7:
Initial work on a codemod for automating the migration:
https://github.com/plone/volto/blob/7b047fb4b2d71395ddba05b7e2570fcec70fc8d4/packages/volto/src/replace-barrel-imports.cjs
Risks
No risks involved. This has to be fully backwards compatible.
Participants
@pnicolli
@sneridagh
@stevepiercy
The text was updated successfully, but these errors were encountered: