Flask 2.2 deprecated the decorators @before_first_request and @before_app_first_request (and a lot of other stuff). Flask 2.3 removed most of the things 2.2 deprecated. Those two decorators are used in a lot of invenio and flask packages. The main usage is to create the menu after the app has been initialized but before of the first request.
flask-menu provides the register_menu decorator which uses both deprecated decorators. register_menu is used in multiple view.py files to decorate endpoints to add menu entries.
Involved Packages for the decorators @before_first_request and @before_app_first_request
@record_once is not deprecated but follows the same idea as @before_first_request and @before_app_first_request and it could (will) be replaced with the same solution.
General
Flask 2.2 deprecated the decorators
@before_first_request
and@before_app_first_request
(and a lot of other stuff). Flask 2.3 removed most of the things 2.2 deprecated. Those two decorators are used in a lot of invenio and flask packages. The main usage is to create the menu after the app has been initialized but before of the first request.flask-menu provides the
register_menu
decorator which uses both deprecated decorators.register_menu
is used in multipleview.py
files to decorate endpoints to add menu entries.Involved Packages for the decorators
@before_first_request
and@before_app_first_request
invenio-administration, invenio-records-rest, invenio-oauth2server, invenio-oauthclient, flask-menu, invenio-admin, invenio-communities, invenio-app-rdm, invenio-pages, invenio-accounts, invenio-deposit
Side Note: invenio-admin and invenio-deposit are deprecated.
Involved packages for the
@register_menu
decoratorinvenio-accounts, invenio-oauthclient, invenio-userprofiles, invenio-oauth2server, invenio-github, invenio-theme, invenio-notifications
This list shows that
register_menu
is used a lot which makes the refactoring a little bit harder.Involved packages for the
@record_once
decoratorinvenio-communities, invenio-vocabularies, invenio-requests, invenio-users-resources, invenio-userprofiles, invenio-oauthclient, invenio-accounts, invenio-rdm-records
@record_once
is not deprecated but follows the same idea as@before_first_request
and@before_app_first_request
and it could (will) be replaced with the same solution.Problems
WIP
Solution
WIP