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

Backends api #208

Merged
merged 4 commits into from
Dec 20, 2024
Merged

Backends api #208

merged 4 commits into from
Dec 20, 2024

Conversation

tristanpoland
Copy link
Member

@tristanpoland tristanpoland commented Dec 13, 2024

This pull request adds a new backend_api and updates the build process to handle backend and plugin discovery. The most important changes are the addition of a new backend_api package, updates to the Cargo.toml files, and enhancements to the build script to automate backend and plugin management.

New Package Addition:

  • Added a new backend_api package with its own Cargo.toml file, including dependencies and build dependencies.

Updates to Cargo.toml:

  • Modified the main Cargo.toml to include the new backend_api package and removed the chronos_plugin.

Build Script Enhancements:

  • Added a new build.rs script in the backend_api package to automate the discovery of backends and plugins, update Cargo.toml files, and generate necessary backend files.# This PR adds the .allow-imports file flag

The adding the .allow-imports file to your backend root allows backends to import plugins. Adding this file to a plugin allows it access to other plugins (Adding this flag to plugins is NOT recommended as it creates some error prone behavior due to missing dependencies).
The Horizon plugins and backends APIs respectively will handle this automatically pre-compile-time to allow for inter plugin and backend-to-plugin communication.

Notes

  • You will not be able to use other plugins with .allow-imports enabled in another .allow-imports plugin, this is to prevent circular dependencies entirely.
  • This is an unstable feature, it may change in the future until it's announced as stable.

@tristanpoland tristanpoland marked this pull request as draft December 13, 2024 16:13
The .allow-imports file allows plugins to import other plugins. The Horizon plugins API will handle this automatically pre-compile-time to allow for inter plugin communication.

## Note
You ***will not*** be able to use other plugins with .allow-imports enabled
@tristanpoland tristanpoland marked this pull request as ready for review December 13, 2024 16:29
@tristanpoland tristanpoland requested a review from Caznix December 13, 2024 16:29
@tristanpoland tristanpoland marked this pull request as draft December 14, 2024 05:56
@tristanpoland
Copy link
Member Author

I have yet again marked this PR as a draft as I am rethinking other possible ways to execute this. It is possible that we will go for it an entirely separate dedicated back-end API as opposed to nearly hooking into the existing plugins API. This will help keep plug in life cycle management to clean as well as keep the plug-in spec clear and concise.

@tristanpoland tristanpoland marked this pull request as ready for review December 20, 2024 16:49
@tristanpoland
Copy link
Member Author

We are finally ready to merge this. The dedicated backends API is complete! 🎉

Copy link
Member

@WilliamAnimate WilliamAnimate left a comment

Choose a reason for hiding this comment

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

looks good

@tristanpoland tristanpoland merged commit 1e050b3 into main Dec 20, 2024
3 checks passed
@tristanpoland tristanpoland deleted the backends-api branch December 20, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants