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

Experimental: Split core and api #718

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

CedNaru
Copy link
Member

@CedNaru CedNaru commented Oct 11, 2024

Not meant to be merged but more an experiment to see if we can properly split the current godot-library into 2. So we can keep the api gen outside the core library.
The line changes are huge, but at the end of the day, it's just moving stuff around and renaming some packages.

I encourage you to just check out the branch directly and check for yourself. Most of the changes are in the api generator.

The main idea is that the now "core" layer contains Godot global enum + Object + RefCounted, as well as the numbered generic Callable and Signal. Everything else is then generated in the "Api" layer.

The biggest challenge with splitting the library are the circular references between the core and api types.
The core layer is fully standalone, it only requires Object and Refcounted to be implemented in it to work.
The Api layer needs core as a dependency, the main issue is that now some core internal classes and methods are not available. For this, I now rely on a "hack", I added a public object Internals that indirectly expose the internal methods I need to access.
I don't want to keep that hack around, but once everything compile and pass the unit test, it will be much easier to see the set of classes and methods having a visibility issue, and we can proceed forward with improving that.

@CedNaru CedNaru force-pushed the experimental/split-core-and-api branch from ea23a1f to 2930f2f Compare October 11, 2024 14:19
@CedNaru CedNaru force-pushed the experimental/split-core-and-api branch from 2930f2f to d88fba9 Compare October 11, 2024 14:53
@CedNaru CedNaru force-pushed the experimental/split-core-and-api branch from c13c5f6 to 41b9d0e Compare October 12, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant