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

PLIP: remove support for old style resource registries in Plone 5.2 #1742

Closed
zopyx opened this issue Sep 2, 2016 · 13 comments

Comments

@zopyx
Copy link
Member

commented Sep 2, 2016

Proposer: Andreas Jung

Seconder: Jens W. Klein

Abstract

Remove/disable support for old-style resource registries (cssregistry.xml and jsregistry.xml) completely.

Motivation

With Plone 5.1 the support for old-style CSS and Javascript registrations (cssregistry.xml and jsregistry.js) should be dropped completely. Any code/add-on trying to register or update a GenericSetup profile containing such configurations should raise an exception. Besides a speaking error message why the exception occurs ("your using an old-style configuration...") the message should indicate how to proceed instead (e.g. a link to the new-style registry docs). An explicit failure is better here than silently ignoring those files or just logging of the failure.

Reasons

Dealing with old-style registrations in the context of the new Plone resource registry implementation in terms of the "plone-legacy" bundle has been broken throughout the complete Plone 5.0 releases. Many of these issues are documented on Github and various postings of mine on community.plone.org. The overall impression is that there is no reasonable solution for fixing the handling of old-style registrations for Plone 5. Fixes are more workarounds and appear like duct-type fixes. Every Plone 5.0.x brought new problems with the support of legacy registrations.

Integrators and maintainers of legacy code need a clear story how to deal with their old code when they need to move forward Plone 5. Javascript and in particular support for arbitrary thirdparzy Javascript modules is essential and crucial nowadays. Although the support for thirdparty Javascript modules in Plone 5 through the new resource registries implementation is still tricky, partly fragile and not consistent, removing another fragile way doing things in Plone is in the interest of every integrator (saving money, resources and motivation).

Proposal & Implementation

There is no reference implementation for this PLIP. As a first step it should be sufficient to add checks to the exisiting resource registry code base that deals with the plone-legacy bundle or deals with the import of the related XML configuration files. In a later step the codebase could be cleaned up by removing all plone-legacy bundle related code.

Risks

This PLIP will clearly break all-ons that would possibly work with Plone 5.0 with the plone-legacy bundle approach. However there is no way to make the legacy bundle approach work under all circumstances. Stability and consistent behavior of the Plone installation is king - both for end-users, developers and integrators - in particular a must for an enterprise-grade CMS.

Deliverables

  • PR removing/disabling cssregistry.xml and jsregistry.xml
  • Documentation how migrate old code and old-style registrations to the new Plone 5 RR implementation. The documention partly exists.
  • The current RR implementation is still fragile to use in particular because of RequireJS. There is no canonical way for integrating a particular JS addon with Plone. It is very easy to break the resource registry with thirdparty JS addons or your own code. Note that many integrators in particular ppl from outside the Plone core developer community are not Javascript experts (including the author) and are not familar with all aspects of modern Javascript development including RequireJS, the Javascript tool chain and packaging story. The requirement here is: you need a particular JS addon in Plone providing some functionality required by business constraints. You want to include and use this add-on easily in Plone with being an expert. You read the installation docs of a particular JS add-on and you want and expect it to work exactly in the same way in Plone 5.

Participants

  • Andreas Jung

@zopyx zopyx added this to the Plone 5.1 milestone Sep 2, 2016

@zopyx zopyx changed the title PLIP: remote plone-legacy bundle support in Plone 5.1 PLIP: remove plone-legacy bundle support in Plone 5.1 Sep 2, 2016

@zopyx zopyx changed the title PLIP: remove plone-legacy bundle support in Plone 5.1 PLIP: remove/disable plone-legacy bundle support in Plone 5.1 Sep 2, 2016

@hvelarde

This comment has been minimized.

Copy link
Member

commented Sep 2, 2016

I think this must be done after #1406 is implemented; I also think that features for 5.1 are already defined so maybe this will have to wait until 5.2.

@zopyx

This comment has been minimized.

Copy link
Member Author

commented Sep 2, 2016

Waiting for 5.2 means at least another year of brokenness and inconsistent behavior. There should be a clear and documented way how to do right now and not at some point in the future.

@hvelarde

This comment has been minimized.

Copy link
Member

commented Sep 2, 2016

IMO, smaller, less ambitious releases are faster to achieve and preferable all the time; but let's wait to see what the @plone/framework-team thinks about this; I'm +1 on your proposal.

also, lessons have to be learned from this broken feature: instead of trying to re-implement the legacy bundle using the new resource registry, we should have left the old resource registry usable as described in #1663 (comment).

@zopyx

This comment has been minimized.

Copy link
Member Author

commented Sep 2, 2016

If someone need to touch an add-on for Plone 5 then it should be sufficient to do the work once instead of adjust some code now to Plone 5 and having the need to move registry information at a later release...I don't want to see such API changes in a .2 release...stuff should be stable after 5.1..it's ok for me to change it now in a .1 release based on experience made with 5.0 but not for 5.2 IMO

@jensens

This comment has been minimized.

Copy link
Member

commented Sep 2, 2016

I think we will discuss this at the next framework team meeting.

@datakurre

This comment has been minimized.

Copy link
Member

commented Sep 3, 2016

I think this would help those, who really want to make add-one supporting both Plone 4 and 5, because then the package could trivially have separate resource files and registrations for both versions in a single profile.

@datakurre

This comment has been minimized.

Copy link
Member

commented Sep 3, 2016

@hvelarde I've now submitted a possible implementation (plone/plone.app.registry#24) for #1406, so it should no longer be a blocker for this.

@thet

This comment has been minimized.

Copy link
Member

commented Sep 20, 2016

Title changed from: PLIP: remove/disable plone-legacy bundle support in Plone 5.1
To: PLIP: remove support for old style resource registries in Plone 5.1

Plone legacy bundles are still handy.

@thet thet changed the title PLIP: remove/disable plone-legacy bundle support in Plone 5.1 PLIP: remove support for old style resource registries in Plone 5.1 Sep 20, 2016

@ebrehault

This comment has been minimized.

Copy link
Member

commented Sep 20, 2016

@zopyx this PLIP has been approved by the @plone/framework-team

@jensens

This comment has been minimized.

Copy link
Member

commented Nov 6, 2016

I second this. Removal should be easy. @zopyx do you already have some branch where I can try code / help with this task?

@zopyx

This comment has been minimized.

Copy link
Member Author

commented Nov 6, 2016

I did not commit to work on the removal.

2016-11-06 13:35 GMT+01:00 Jens W. Klein notifications@github.com:

I second this. Removal should be easy. @zopyx https://github.com/zopyx
do you already have some branch where I can try code / help with this task?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1742 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAkRP3qxp5QvPU3-NbK-AWF-yXcgtC1eks5q7cl9gaJpZM4Jzclf
.

@jensens jensens moved this from In Process (approved) to Stalled (approved with no activity) in PLIPs Feb 23, 2017

@jensens jensens changed the title PLIP: remove support for old style resource registries in Plone 5.1 PLIP: remove support for old style resource registries in Plone 5.2 Jun 12, 2018

@jensens jensens modified the milestones: Plone 5.1, Plone 5.2 Jun 12, 2018

@jensens jensens moved this from Todo to In Progress in Clean-up Tasks Oct 23, 2018

@jensens

This comment has been minimized.

Copy link
Member

commented Oct 23, 2018

parts solved by #2573

@hvelarde

This comment has been minimized.

Copy link
Member

commented Oct 23, 2018

just for the record: an alternate method for registering static resources in Plone add-ons that works in both Plone 4 and 5 is described here:

http://hvelarde.blogspot.com/2018/09/look-ma-no-resource-registries.html

@jensens jensens moved this from Stalled (approved but inactive) to In Process (approved) in PLIPs Nov 20, 2018

@jensens jensens moved this from In Process (approved) to Merged in PLIPs Feb 12, 2019

@jensens jensens closed this Feb 12, 2019

@erral erral referenced this issue Mar 20, 2019
0 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.