Content
View differences
Updated by Sebastian Schuster almost 13 years ago
Currently, the plugins are loaded by Bundler with Bundler.require before the Core is loaded. Since some plugins patch core classes, they trigger loading of the patched core classes in turn triggering loading of other core classes. This creates problems especially at the infamous circular dependency of user, project, and principal. Loading user first leads to the loading of the three classes to fail with an unitialized constant exception. Thus, the plugin load order dictates the class load order of core classes.
It would be desirable to load all core classes first in a specified order before plugins change these classes.
Ideas to solve this include:
\- Using Bundler.setup instead of Bundler.require and loading dependencies manually
\- Have plugins patch classes on class loading using ActiveSupport callbacks
\- Use a fix modifying rails as implemented in [PR263](https://github.com/opf/openproject/pull/263/files)
(the latter one needs a more thorough review on possible side effects and has the disadvantage of
depending on rails internals better kept opaque)
It would be desirable to load all core classes first in a specified order before plugins change these classes.
Ideas to solve this include:
\- Using Bundler.setup instead of Bundler.require and loading dependencies manually
\- Have plugins patch classes on class loading using ActiveSupport callbacks
\- Use a fix modifying rails as implemented in [PR263](https://github.com/opf/openproject/pull/263/files)
(the latter one needs a more thorough review on possible side effects and has the disadvantage of
depending on rails internals better kept opaque)